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

:root{
    --bg-primary: #f8f2f2;
    --bg-secondary: #f5f5f3;
    --bg-success: #eaf3de;
    --bg-danger: #fcebeb;
    --text-primary: #080807;
    --text-secondary: #44443f;
    --text-tertiary: #a0a09c;
    --text-four: #f40a0a;
    --text-success: #e7372a;
    --text-danger: #791f1f;
    --border-tertiary: rgba(0, 0, 0, 0.12);
    --border-secondary: rgba(0, 0, 0, 0.22);
    --border-primary: rgba(0, 0, 0, 0.35);
    --border-success: #f51a1a;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body{
    font-family: papyrus;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1rem;
}

#app{
    max-width: 650px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius:var(--radius-lg);
    border: 0.5px solid var(--border-tertiary);
    padding: 2rem; 
}

.header{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 0.5px solid var(--border-tertiary);
    padding-bottom: 1rem;
}

.header h1{
    font-size: 25px;
    font-weight: 1000;
    letter-spacing: 0px;
}

.header .count{
    font-size: 13px;
    color: var(--text-secondary);
}

.input-row{
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.input-row input[type="text"]{
    flex: 1;
    min-width: 180px;
    height: 36px;
    padding: 0 12px;
    border: 0.5px solid var(--border-tertiary);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-row input[type="text"]:focus{
    border-color: var(--border-primary);
    box-shadow: 0 0 0 2px rgba(128, 128, 128, 0.12);
}

.input-row select{
    height: 36px;
    padding: 0 8px;
    border: 0.5px solid var(--border-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline:none;
}

.add-btn{
    height: 36px;
    padding: 0 16px;
    border: 0.5px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15d;
    white-space: nowrap;
    text-align: center;
}

.add-btn:hover{
    background: var(--bg-secondary);
}

.add-btn:active{
    transform: scale(0.98);
}

.filter-row{
    display: flex;
    gap: 6px;
    margin-bottom: 1.25rem;
    flex-wrap:wrap;
}

.filter-btn{
    padding: 4px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
}

.filter-btn:hover {
    border-color: var(--border-secondary);
    color: var(--text-primary);
}
   
.filter-btn.active {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

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

.task-item{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 0.5px solid var(--border-tertiary);
    border-radius: var(--radius-lg);
    transition: border-color 0.12s, opacity 0.2s;
    animation: slideIn 0.18s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

  .task-item:hover { border-color: var(--border-secondary); }
  .task-item.done  { opacity: 0.5; }
   
  .task-check {
    width: 18px;
    height: 18px;
    border: 0.5px solid var(--border-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    background: transparent;
  }
   
  .task-check:hover { border-color: var(--border-primary); }
   
  .task-check.checked {
    background: var(--bg-success);
    border-color: var(--border-success);
  }
   
  .task-check.checked::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border-right: 1.5px solid var(--text-success);
    border-bottom: 1.5px solid var(--text-success);
    transform: rotate(45deg) translate(-1px, -1px);
}
.task-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    cursor: pointer;
  }
   
  .task-item.done .task-text {
    text-decoration: line-through;
    color: var(--text-four);
  }
   
  .task-edit-input {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    line-height: 1.4;
    padding: 0;
  }
   
  /* Priority badges */
   
  .task-priority {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    flex-shrink: 0;
  }
   
  .priority-high   { background: #FCEBEB; color: #791F1F; }
  .priority-medium { background: #FAEEDA; color: #633806; }
  .priority-low    { background: #EAF3DE; color: #27500A; }
   
  /* Delete button */
   
  .delete-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0;
    transition: color 0.12s, background 0.12s;
  }
   
  .task-item:hover .delete-btn { opacity: 1; }
   
  .delete-btn:hover {
    color: var(--text-danger);
    background: var(--bg-danger);
  }
   
  /* Empty state */
   
  .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
    font-size: 14px;
  }
   
  /* Footer */
   
  .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 0.5px solid var(--border-tertiary);
  }
   
  .footer span {
    font-size: 12px;
    color: var(--text-tertiary);
  }
   
  .clear-btn {
    font-size: 12px;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.12s;
  }
   
  .clear-btn:hover { color: var(--text-danger); }