* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
-webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f4f6f8;
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    padding: 12px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    color: #0f172a;
}

.form-section {
    background: #ffffff;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#add-form {
display: flex;
flex-direction: column;
gap: 10px;
}

#item-input {
width: 100%;
height: 48px;
padding: 0 14px;
border: 1px solid #cbd5e1;
border-radius: 8px;
font-size: 1rem;
outline: none;
}

#item-input:focus {
border-color: #2563eb;
}

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

#status-select {
flex: 1;
height: 48px;
padding: 0 10px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #fff;
font-size: 0.95rem;
}

#submit-btn {
flex: 1.2;
height: 48px;
background: #2563eb;
color: white;
border: none;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: opacity 0.2s;
}

#submit-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}

#submit-btn:active:not(:disabled) {
background: #1d4ed8;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 8px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 10px;
}

.filter-btn {
    flex: 1;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Card List */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    user-select: none;
    transition: all 0.15s ease-in-out;
}

.card.optimistic-saving {
    opacity: 0.5;
    pointer-events: none;
}

.card-body {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    min-height: 54px;
}

.item-title {
    font-size: 1rem;
    font-weight: 500;
    word-break: break-word;
}

.card.is-done .item-title {
    text-decoration: line-through;
    color: #94a3b8;
}

.badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 8px;
}

.badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.badge.done {
    background: #dcfce7;
    color: #15803d;
}

.delete-btn {
    width: 48px;
    height: 54px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:active {
    color: #ef4444;
}

.state-msg {
    text-align: center;
    color: #64748b;
    margin-top: 20px;
    font-size: 0.95rem;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: opacity 0.2s ease;
    z-index: 100;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.hidden { opacity: 0; pointer-events: none; }
