/* ----- RESET & VARIABLES ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f1f6fa;
    font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at 10% 30%, rgba(60, 130, 160, 0.04) 0%, transparent 60%);
}

.app-container {
    max-width: 860px;
    width: 100%;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(20, 50, 70, 0.12);
    padding: 2.2rem 2.5rem;
    transition: 0.2s;
    border: 1px solid rgba(110, 160, 190, 0.15);
}

/* HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.8rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    background: #1e4f66;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

h1 {
    font-weight: 700;
    font-size: 1.9rem;
    color: #122b38;
    letter-spacing: -0.3px;
}

h1 span {
    color: #2a7f9c;
}

.badge-lifestyle {
    background: #e7f0f7;
    color: #1a546b;
    padding: 0.25rem 1.2rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #b6d3e3;
}

.sub {
    color: #3e6a7e;
    border-left: 4px solid #3f9bbf;
    padding-left: 1rem;
    margin-bottom: 1.8rem;
    font-weight: 400;
    background: #f2f9fe;
    border-radius: 0 20px 20px 0;
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
}

/* ADD ROW */
.add-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.add-row input {
    flex: 1;
    padding: 0.9rem 1.4rem;
    border: 2px solid #dce8f0;
    border-radius: 60px;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
    background: #fafdff;
    min-width: 180px;
}

.add-row input:focus {
    border-color: #2a7f9c;
    box-shadow: 0 0 0 4px rgba(42, 127, 156, 0.08);
}

.add-row button {
    background: #1e4f66;
    border: none;
    color: white;
    padding: 0.9rem 2.2rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.add-row button:hover {
    background: #123d50;
    transform: scale(1.02);
}

/* FILTER */
.filter-bar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-chip {
    background: white;
    border: 1.5px solid #d0dfe9;
    padding: 0.3rem 1.4rem;
    border-radius: 60px;
    font-weight: 500;
    font-size: 0.85rem;
    color: #1d4a5e;
    cursor: pointer;
    transition: 0.1s;
}

.filter-chip.active {
    background: #1e4f66;
    border-color: #1e4f66;
    color: white;
}

.filter-chip:hover {
    border-color: #2a7f9c;
}

/* TODO LIST */
.todo-list {
    list-style: none;
    margin: 0.8rem 0 1.5rem;
}

.todo-item {
    background: #f8fcff;
    border: 1px solid #e2edf5;
    border-radius: 16px;
    padding: 0.9rem 1.4rem;
    margin-bottom: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: 0.15s;
    animation: fadeIn 0.2s ease;
}

.todo-item:hover {
    background: #f2faff;
    border-color: #b9d3e3;
}

.todo-item .task-text {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: #142f3d;
    word-break: break-word;
}

.todo-item .task-text.done {
    text-decoration: line-through;
    color: #7a9aaa;
    font-weight: 400;
}

.todo-item .task-category {
    background: #dae9f2;
    border-radius: 40px;
    padding: 0.1rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1f566d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.todo-item .actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ACTION BUTTONS */
.todo-item .actions button {
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.1s;
    font-size: 0.9rem;
    color: #3a6a80;
}

.todo-item .actions .btn-edit   { color: #2563eb; }
.todo-item .actions .btn-edit:hover   { background: #dbeafe; }
.todo-item .actions .btn-toggle { color: #1e7a5a; }
.todo-item .actions .btn-toggle:hover { background: #d4f0e6; }
.todo-item .actions .btn-delete { color: #b1574a; }
.todo-item .actions .btn-delete:hover { background: #fce4e0; }

/* VIEW / EDIT ROWS */
.todo-view-row {
    display: flex; align-items: center; gap: 1rem; width: 100%;
}
.todo-edit-row {
    display: flex; align-items: center; gap: 0.6rem;
    width: 100%; flex-wrap: wrap; padding-top: 2px;
}
.todo-edit-row.hidden { display: none; }
.todo-view-row.hidden { display: none; }

.edit-input {
    flex: 1; min-width: 140px;
    padding: 0.5rem 0.9rem;
    border: 2px solid #2a7f9c;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    background: #fafdff;
    transition: box-shadow 0.15s;
}
.edit-input:focus {
    box-shadow: 0 0 0 3px rgba(42,127,156,0.15);
}

.edit-actions { display: flex; gap: 0.4rem; }
.btn-save-edit, .btn-cancel-edit {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0.45rem 1rem; border-radius: 8px;
    font-size: 0.8rem; font-weight: 600;
    cursor: pointer; border: none; font-family: inherit;
    transition: 0.15s;
}
.btn-save-edit   { background: #1e4f66; color: #fff; }
.btn-save-edit:hover   { background: #123d50; }
.btn-cancel-edit { background: #f1f5f9; color: #64748b; border: 1.5px solid #e2e8f0; }
.btn-cancel-edit:hover { background: #e2e8f0; }

/* STATUS */
.status-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.2rem;
    border-top: 1px solid #dce8f0;
    padding-top: 1.2rem;
}

.status-area .count {
    color: #316074;
    font-weight: 500;
    font-size: 0.95rem;
}

.status-area .count strong {
    color: #0d374a;
}

.btn-clear {
    background: transparent;
    border: 1.5px solid #d4b8b8;
    color: #7a4f4a;
    padding: 0.3rem 1.6rem;
    border-radius: 60px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.1s;
}

.btn-clear:hover {
    background: #f7e8e6;
    border-color: #b57a72;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #6e8f9f;
}
.empty-state .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.8rem;
    color: #2a7f9c;
}

/* ANIMATIONS */
@keyframes fadeIn {
    0% { opacity: 0.4; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 650px) {
    .app-container { padding: 1.5rem; }
    h1 { font-size: 1.5rem; }
    .add-row input { min-width: 140px; }
    .add-row button { padding: 0.7rem 1.4rem; }
    .todo-item { flex-wrap: wrap; }
    .todo-item .task-text { width: 100%; order: 1; }
    .todo-item .task-category { order: 2; }
    .todo-item .actions { order: 3; margin-left: auto; }
}

@media (max-width: 450px) {
    .app-container { padding: 1rem; }
    .filter-bar { gap: 0.3rem; }
    .filter-chip { padding: 0.2rem 1rem; font-size: 0.75rem; }
}