* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f7f6;
    color: #18332c;
}

.topbar {
    min-height: 78px;
    background: #ffffff;
    border-bottom: 1px solid #dfe8e4;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.55rem;
}

.topbar p {
    margin: 3px 0 0;
    color: #6c7b76;
    font-size: .92rem;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 16px 42px;
}

.quick-add {
    background: #ffffff;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(0,0,0,.05);
    margin-bottom: 22px;
}

.quick-add textarea,
.task-edit,
.login-card input {
    width: 100%;
    border: 1px solid #cfdad6;
    border-radius: 11px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.quick-add textarea {
    resize: vertical;
    min-height: 68px;
    max-height: 130px;
    font-size: 1rem;
    margin-bottom: 9px;
}

.task-edit {
    resize: vertical;
    min-height: 68px;
    max-height: 130px;
    border: none;
    padding: 0;
    background: transparent;
    font-size: .98rem;
    line-height: 1.35;
}

.primary-btn,
.done-btn,
.small-btn,
.restore-btn,
.logout-btn,
.restore-selected-btn,
.delete-selected-btn {
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    font: inherit;
}

.primary-btn {
    padding: 10px 16px;
    background: #177a56;
    color: white;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 0 11px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.28rem;
}

.count {
    background: #dcece5;
    color: #176744;
    min-width: 27px;
    height: 27px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: .9rem;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.task-card {
    background: #fff9cf;
    border: 1px solid #eee3a9;
    border-radius: 14px;
    padding: 14px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 5px 14px rgba(0,0,0,.045);
}

.small-btn {
    margin-top: 7px;
    padding: 6px 10px;
    background: #e7ecea;
    color: #3a4c46;
    font-size: .86rem;
}

.done-btn {
    width: 100%;
    padding: 9px;
    background: #177a56;
    color: white;
}

.completed-section {
    margin-top: 28px;
}

.completed-toolbar {
    background: #ffffff;
    border: 1px solid #dde6e2;
    border-radius: 12px;
    padding: 9px 11px;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.select-all-label,
.completed-task-select {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

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

.completed-task-select span {
    text-decoration: line-through;
    color: #77847f;
    overflow-wrap: anywhere;
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

.restore-selected-btn,
.delete-selected-btn {
    padding: 7px 10px;
    font-size: .86rem;
}

.restore-selected-btn {
    background: #e6f2ed;
    color: #21634d;
}

.delete-selected-btn {
    background: #fbe5e5;
    color: #9b2525;
}

.completed-list {
    display: grid;
    gap: 7px;
}

.completed-item {
    background: white;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid #dde6e2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.completed-checkbox,
#select-all-completed {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.restore-btn {
    padding: 6px 9px;
    background: #edf3f0;
    color: #356253;
    font-size: .84rem;
    white-space: nowrap;
}

.logout-btn {
    padding: 8px 12px;
    background: #eef3f1;
    color: #27463b;
}

.empty-state {
    background: #ffffff;
    border: 1px dashed #cdd9d4;
    color: #73817c;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.flash {
    padding: 9px 12px;
    border-radius: 9px;
    margin-bottom: 11px;
}

.flash.error {
    background: #ffe5e5;
    color: #8e2525;
}

.flash.success {
    background: #e4f4ec;
    color: #216649;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: #ffffff;
    padding: 26px;
    border-radius: 19px;
    box-shadow: 0 18px 45px rgba(0,0,0,.08);
}

.login-logo {
    display: block;
    width: auto;
    max-width: 135px;
    max-height: 88px;
    object-fit: contain;
    margin: 0 auto 8px;
}

.login-card h1 {
    text-align: center;
    margin: 8px 0 4px;
    font-size: 1.55rem;
}

.login-card .muted {
    text-align: center;
    color: #74817d;
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin: 11px 0 5px;
    font-weight: 600;
}

.login-card .primary-btn {
    width: 100%;
    margin-top: 15px;
}

@media (max-width: 700px) {
    .topbar {
        min-height: 68px;
        padding: 12px 14px;
    }

    .topbar p {
        display: none;
    }

    .container {
        padding: 14px 11px 36px;
    }

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

    .quick-add {
        border-radius: 13px;
    }

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

    .bulk-actions {
        width: 100%;
    }

    .restore-selected-btn,
    .delete-selected-btn {
        flex: 1;
    }

    .completed-item {
        align-items: flex-start;
    }
}

.login-help {
    text-align: center;
    margin-top: 17px;
}

.login-help a {
    color: #177a56;
    text-decoration: none;
    font-weight: 650;
}

.login-help a:hover {
    text-decoration: underline;
}
