* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --text: #16181d;
    --muted: #7b8190;
    --border: #e8eaf0;
    --primary: #635bff;
    --primary-dark: #5148e5;
    --green: #27ae60;
    --orange: #f39c12;
    --red: #e74c3c;
    --sidebar: #ffffff;
}

body.dark {
    --background: #101114;
    --surface: #181a1f;
    --surface-2: #202228;
    --text: #f4f4f5;
    --muted: #9498a5;
    --border: #2b2e36;
    --sidebar: #15171b;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--text);
    transition: 0.25s;
}

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 250px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 40px;
    font-size: 19px;
    font-weight: 800;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 12px 14px;
    border-radius: 10px;
    text-align: left;
    font-size: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: 0.2s;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.nav-item.active {
    background: #eeecff;
    color: var(--primary);
    font-weight: 600;
}

body.dark .nav-item.active {
    background: #29264a;
}

.nav-item span {
    width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
}

/* MAIN */

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 30px 45px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h2 {
    font-size: 20px;
}

.topbar p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* SECTIONS */

.section {
    display: none;
}

.active-section {
    display: block;
}

.welcome {
    background: linear-gradient(120deg, #625bff, #817aff);
    border-radius: 18px;
    padding: 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.small-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    opacity: 0.7;
    margin-bottom: 7px;
}

.welcome h1 {
    font-size: 27px;
    margin-bottom: 7px;
}

.welcome p {
    opacity: 0.8;
}

.progress-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 8px solid rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

/* CARDS */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
}

.stat-card strong {
    font-size: 24px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.blue {
    background: #e9edff;
    color: #5265df;
}

.green {
    background: #e5f8ed;
    color: #27ae60;
}

.purple {
    background: #eee9ff;
    color: #7857df;
}

.orange {
    background: #fff0d8;
    color: #e69518;
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
}

.panel,
.chart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel-header h3 {
    font-size: 16px;
}

.panel-header button {
    border: none;
    background: none;
    color: var(--primary);
    font-size: 13px;
}

.task-list {
    display: flex;
    flex-direction: column;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.task-row:last-child {
    border-bottom: none;
}

.task-check {
    width: 19px;
    height: 19px;
    border: 2px solid #c7cad4;
    border-radius: 5px;
    cursor: pointer;
}

.task-check.completed {
    background: var(--green);
    border-color: var(--green);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-info {
    flex: 1;
}

.task-info strong {
    font-size: 14px;
    display: block;
}

.task-info small {
    color: var(--muted);
}

.priority {
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
}

.priority-high {
    background: #ffe6e4;
    color: var(--red);
}

.priority-medium {
    background: #fff1d8;
    color: #c77d00;
}

.priority-low {
    background: #e4f7ed;
    color: #219653;
}

.activity {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    gap: 12px;
}

.activity-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 5px;
}

.activity-item strong {
    display: block;
    font-size: 13px;
}

.activity-item small {
    color: var(--muted);
}

/* SECTION HEADER */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-heading h1 {
    font-size: 27px;
    margin-bottom: 5px;
}

.section-heading p {
    color: var(--muted);
}

.primary-button,
.timer-button {
    background: var(--primary);
    border: none;
    color: white;
    border-radius: 9px;
    padding: 11px 16px;
    font-weight: 600;
    transition: .2s;
}

.primary-button:hover,
.timer-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    padding: 11px 16px;
}

.full {
    width: 100%;
}

/* FILTER */

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 8px;
}

.filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* TASKS */

.large-task-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 0 20px;
}

.large-task-list .task-row {
    padding: 18px 5px;
}

.delete-task {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 18px;
}

.delete-task:hover {
    color: var(--red);
}

/* SUBJECTS */

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.subject-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 22px;
}

.subject-color {
    width: 45px;
    height: 45px;
    background: #eeecff;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 18px;
}

.subject-card h3 {
    margin-bottom: 5px;
}

.subject-card p {
    color: var(--muted);
    font-size: 13px;
}

/* POMODORO */

.pomodoro-container {
    max-width: 700px;
    margin: 40px auto;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 45px;
    border-radius: 20px;
}

.pomodoro-container h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.pomodoro-container > p {
    color: var(--muted);
}

.timer {
    font-size: 100px;
    font-weight: 700;
    margin: 40px 0;
    letter-spacing: 5px;
}

.timer-mode {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.timer-mode-btn {
    border: none;
    background: var(--surface-2);
    color: var(--muted);
    padding: 9px 15px;
    border-radius: 8px;
}

.timer-mode-btn.active {
    background: var(--primary);
    color: white;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.timer-button {
    padding: 13px 30px;
}

.session-info {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    color: var(--muted);
}

.session-info strong {
    color: var(--text);
    margin-left: 8px;
}

/* STATS */

.stats-big-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.big-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 25px;
}

.big-stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.big-stat strong {
    font-size: 30px;
}

.chart-panel h3 {
    margin-bottom: 30px;
}

.fake-chart {
    height: 260px;
    display: flex;
    align-items: end;
    justify-content: space-around;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.bar {
    width: 50px;
    background: var(--primary);
    border-radius: 7px 7px 0 0;
    position: relative;
    min-height: 20px;
}

.bar span {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--muted);
}

/* NOTES */

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
    min-height: 170px;
}

.note h3 {
    margin-bottom: 12px;
}

.note textarea {
    width: 100%;
    height: 100px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

/* MODAL */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.open {
    display: flex;
}

.modal-content {
    width: 420px;
    background: var(--surface);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 25px;
    color: var(--muted);
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
}

.modal-content input:focus,
.modal-content select:focus {
    border-color: var(--primary);
}

/* RESPONSIVE */

@media (max-width: 1000px) {

    .stats-grid,
    .stats-big-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .subjects-grid,
    .notes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {

    .sidebar {
        width: 70px;
        padding: 20px 8px;
    }

    .logo span,
    .nav-item:not(.active) {
        font-size: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .nav-item span {
        font-size: 18px;
    }

    .logo {
        justify-content: center;
        padding: 0;
    }

    .main {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 20px;
    }

    .stats-grid,
    .stats-big-grid,
    .subjects-grid,
    .notes-grid {
        grid-template-columns: 1fr;
    }

    .welcome {
        padding: 22px;
    }

    .welcome-progress {
        display: none;
    }

    .section-heading {
        align-items: flex-start;
        gap: 15px;
    }

    .timer {
        font-size: 65px;
    }

    .pomodoro-container {
        padding: 30px 20px;
    }
}