@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f5f6fc;
    --card: #ffffff;
    --text: #20213a;
    --muted: #85879e;
    --border: #ececf5;
    --primary: #7064f5;
    --primary-dark: #5849df;
    --soft: #f0eeff;
    --green: #21a67a;
    --red: #e35d6a;
    --shadow: 0 8px 30px rgba(37, 35, 90, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.25s, color 0.25s;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
    transition: 0.2s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(112, 100, 245, 0.3);
    outline-offset: 2px;
}

.navbar {
    height: 76px;
    padding: 0 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 23px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn,
.secondary-btn,
.primary-btn {
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.icon-btn {
    width: 43px;
    height: 43px;
    padding: 0;
    background: var(--card);
}

.secondary-btn {
    color: var(--text);
    background: var(--card);
}

.secondary-btn:hover,
.icon-btn:hover {
    border-color: var(--primary);
}

.primary-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.container {
    max-width: 1250px;
    margin: auto;
    padding: 42px 28px 24px;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 30px;
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1.6px;
    margin-bottom: 10px;
}

.welcome h1 {
    font-size: clamp(30px, 4vw, 43px);
    letter-spacing: -1.7px;
    margin-bottom: 10px;
}

.welcome h1 span {
    color: var(--primary);
}

.subtitle,
.panel-subtitle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.date-card {
    min-width: 150px;
    padding: 18px 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: var(--shadow);
}

.date-card span {
    color: var(--muted);
    font-size: 12px;
}

.date-card strong {
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 24px;
}

.stat-card,
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 20px;
    position: relative;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--soft);
    border-radius: 11px;
    font-size: 18px;
    margin-bottom: 15px;
}

.stat-card p {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 7px;
}

.stat-card h2 {
    font-size: 27px;
    letter-spacing: -1px;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
    gap: 22px;
    align-items: start;
}

.panel {
    padding: 24px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 23px;
}

.panel h2 {
    font-size: 20px;
    letter-spacing: -0.5px;
}

.task-badge {
    color: var(--primary);
    background: var(--soft);
    font-size: 11px;
    font-weight: 700;
    padding: 8px 11px;
    border-radius: 20px;
    white-space: nowrap;
}

.task-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px auto;
    gap: 9px;
    margin-bottom: 20px;
}

.task-form input,
.task-form select {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
}

.task-form input:focus,
.task-form select:focus {
    border-color: var(--primary);
    outline: none;
}

.task-form .primary-btn {
    font-size: 12px;
    padding: 11px 13px;
    white-space: nowrap;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 22px;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a59bff);
    border-radius: inherit;
    transition: width 0.3s;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: 0.2s;
}

.task-item:hover {
    border-color: #d7d2ff;
}

.task-check {
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.task-details {
    flex: 1;
    min-width: 0;
}

.task-name {
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--muted);
}

.task-meta {
    margin-top: 6px;
    display: flex;
    gap: 7px;
    align-items: center;
}

.priority {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 5px;
}

.priority.High {
    color: #cf4b5a;
    background: #ffeaed;
}

.priority.Medium {
    color: #a56b16;
    background: #fff4dc;
}

.priority.Low {
    color: #168663;
    background: #e2f8ef;
}

.task-status {
    color: var(--muted);
    font-size: 10px;
}

.delete-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    padding: 5px;
    border-radius: 7px;
    flex-shrink: 0;
}

.delete-btn:hover {
    color: var(--red);
    background: #ffeaed;
}

.empty-message {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    padding: 28px 10px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.timer-panel {
    text-align: center;
}

.timer-panel .eyebrow {
    text-align: left;
}

.timer-panel h2 {
    margin-bottom: 8px;
}

.timer-ring {
    width: 205px;
    height: 205px;
    border-radius: 50%;
    margin: 25px auto;
    padding: 9px;
    background: conic-gradient(var(--primary) 0deg, #e9e6ff 0deg);
    display: grid;
    place-items: center;
}

.timer-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.timer-inner span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.timer-inner strong {
    font-size: 42px;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}

.timer-modes {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-bottom: 19px;
    flex-wrap: wrap;
}

.mode-btn {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 11px;
    font-weight: 600;
}

.mode-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--soft);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.timer-controls button {
    font-size: 12px;
    padding: 10px 14px;
}

.coach-panel {
    background: linear-gradient(135deg, var(--card), var(--soft));
}

.coach-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
}

.coach-title .eyebrow {
    margin-bottom: 5px;
}

.coach-icon {
    width: 45px;
    height: 45px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--card);
    font-size: 23px;
}

.coach-panel>p:not(.coach-note) {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.coach-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #dcd7ff;
    background: var(--card);
    color: var(--primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.coach-btn:hover {
    background: var(--soft);
}

.coach-note {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.6;
    margin-top: 12px;
}

footer {
    text-align: center;
    padding: 32px 0 8px;
    color: var(--muted);
    font-size: 11px;
}

.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: var(--text);
    color: var(--card);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
    z-index: 10;
    text-align: center;
    max-width: 90%;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Dark mode */

body.dark {
    --bg: #141522;
    --card: #1d1e2e;
    --text: #f0f0fb;
    --muted: #a0a2ba;
    --border: #303146;
    --primary: #968bff;
    --primary-dark: #7d70f0;
    --soft: #292641;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body.dark .priority.High {
    background: #44252e;
    color: #ff9da8;
}

body.dark .priority.Medium {
    background: #453722;
    color: #ffd18a;
}

body.dark .priority.Low {
    background: #1c4038;
    color: #82e0bd;
}

body.dark .coach-panel {
    background: linear-gradient(135deg, var(--card), #292641);
}

body.dark .timer-ring {
    background: conic-gradient(var(--primary) var(--timer-progress, 0deg), #343148 0deg);
}

/* Responsive layout */

@media (max-width: 950px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .right-column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

@media (max-width: 650px) {
    .navbar {
        padding: 0 18px;
        height: 66px;
    }

    .logo {
        font-size: 20px;
    }

    .container {
        padding: 28px 15px;
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .date-card {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h2 {
        font-size: 24px;
    }

    .panel {
        padding: 18px;
    }

    .task-form {
        grid-template-columns: 1fr 1fr;
    }

    .task-form input {
        grid-column: 1 / -1;
    }

    .task-form .primary-btn {
        grid-column: 1 / -1;
    }

    .right-column {
        display: flex;
    }

    .timer-ring {
        width: 185px;
        height: 185px;
    }

    .timer-inner strong {
        font-size: 37px;
    }

    .nav-actions {
        gap: 7px;
    }

    .nav-actions .secondary-btn {
        padding: 10px;
        font-size: 11px;
    }
}