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

:root {
    --bg: #f7f6f3;
    --surface: #ffffff;
    --border: #e4e2dc;
    --border-light: #edecea;
    --text: #1a1916;
    --muted: #888580;
    --hint: #b8b5af;
    --accent: #1a1916;
    --done-text: #b8b5af;
    --tag-bg: #f0efe9;
    --tag-text: #6b6862;
    --today-bg: #1a1916;
    --today-text: #f7f6f3;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.header {
    margin-bottom: 2.5rem;
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.app-title {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.clock {
    font-family: 'DM Mono', monospace;
    font-size: 22px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: -0.5px;
}

.today-date {
    font-size: 14px;
    color: var(--muted);
    font-weight: 300;
}

.progress-wrap {
    margin-bottom: 2rem;
}

.progress-bar-bg {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(.4, 0, .2, 1);
}

.progress-label {
    font-size: 12px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hint);
    margin-bottom: 1rem;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-actions {
    flex-wrap: wrap;
}

input[type="text"],
input[type="time"],
select,
button {
    font-family: 'DM Sans', sans-serif;
}

input[type="text"],
input[type="time"],
select {
    font-size: 14px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

input[type="text"] {
    flex: 1;
}

input[type="text"]:focus,
input[type="time"]:focus,
select:focus {
    border-color: var(--accent);
}

input[type="time"] {
    width: 120px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
}

select {
    flex: 1;
    cursor: pointer;
}

.btn-add,
.btn-secondary,
.icon-btn {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.btn-add {
    background: var(--accent);
    color: #fff;
}

.btn-secondary,
.icon-btn {
    background: var(--tag-bg);
    color: var(--text);
}

.btn-add:hover,
.btn-secondary:hover,
.icon-btn:hover {
    opacity: 0.85;
}

.hidden {
    display: none;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
}

.tab {
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.tab-count {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--hint);
    margin-left: 4px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 5px;
    transition: border-color 0.15s, opacity 0.2s;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.task:hover {
    border-color: var(--border);
}

.task.done {
    opacity: 0.6;
}

.check-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    padding: 0;
}

.check-btn:hover {
    border-color: var(--accent);
}

.check-btn.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.check-btn svg {
    display: none;
}

.check-btn.checked svg {
    display: block;
}

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

.task-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.task.done .task-text {
    text-decoration: line-through;
    color: var(--done-text);
}

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

.tag {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--tag-bg);
    color: var(--tag-text);
}

.tag.today {
    background: var(--today-bg);
    color: var(--today-text);
}

.tag.overdue {
    background: #fff0f0;
    color: #c0392b;
}

.tag.upcoming {
    background: #f0f4ff;
    color: #3b5bdb;
}

.tag.alert {
    background: #fff5d6;
    color: #9a6700;
}

.del-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--hint);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.task:hover .del-btn {
    opacity: 1;
}

.del-btn:hover {
    color: #c0392b;
}

.empty {
    text-align: center;
    padding: 3rem 0;
    color: var(--hint);
    font-size: 14px;
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 360px;
    background: #1a1916;
    color: #f7f6f3;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    border-left: 4px solid #f59f00;
    pointer-events: auto;
    animation: toastIn 0.2s ease;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.toast-text {
    font-size: 13px;
    line-height: 1.4;
    color: #e9e7e1;
}

.toast-close {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    border-radius: 8px;
    height: 32px;
    padding: 0 12px;
    cursor: pointer;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-wrap: wrap;
    }

    input[type="time"],
    select,
    .btn-add,
    .btn-secondary {
        width: 100%;
    }

    .clock {
        font-size: 18px;
    }

    .task {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .icon-btn {
        margin-left: 32px;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}
