 *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #f4f1eb;
      --card: #ffffff;
      --ink: #1a1a18;
      --muted: #8a8880;
      --accent: #c8773a;
      --accent-light: #f5e6d8;
      --line: #e4e0d8;
      --done-text: #b0ada7;
      --shadow: 0 2px 16px rgba(0,0,0,0.07);
      --radius: 14px;
    }

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--bg);
      color: var(--ink);
      min-height: 100vh;
      padding: 40px 16px 80px;
    }

    /* ── Header ── */
    header {
      max-width: 640px;
      margin: 0 auto 36px;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
    }

    .logo {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 600;
      letter-spacing: -0.5px;
      color: var(--ink);
    }
    .logo span { color: var(--accent); }

    .date-badge {
      font-size: 0.78rem;
      font-weight: 500;
      color: var(--muted);
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    /* ── Stats row ── */
    .stats {
      max-width: 640px;
      margin: 0 auto 28px;
      display: flex;
      gap: 12px;
    }

    .stat {
      flex: 1;
      background: var(--card);
      border-radius: var(--radius);
      padding: 16px 20px;
      box-shadow: var(--shadow);
    }
    .stat-num {
      font-family: 'Playfair Display', serif;
      font-size: 1.7rem;
      font-weight: 600;
      color: var(--ink);
      line-height: 1;
    }
    .stat-num.accent { color: var(--accent); }
    .stat-label {
      font-size: 0.72rem;
      font-weight: 500;
      color: var(--muted);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      margin-top: 4px;
    }

    /* ── Input card ── */
    .input-card {
      max-width: 640px;
      margin: 0 auto 24px;
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 20px;
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .input-card input[type="text"] {
      flex: 1;
      border: none;
      outline: none;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.95rem;
      color: var(--ink);
      background: transparent;
    }
    .input-card input::placeholder { color: var(--muted); }

    .priority-select {
      border: 1.5px solid var(--line);
      border-radius: 8px;
      padding: 6px 10px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.8rem;
      color: var(--muted);
      background: transparent;
      outline: none;
      cursor: pointer;
    }

    .add-btn {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 10px 20px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.88rem;
      font-weight: 500;
      cursor: pointer;
      transition: background 0.2s, transform 0.1s;
      white-space: nowrap;
    }
    .add-btn:hover { background: #b56830; }
    .add-btn:active { transform: scale(0.97); }

    /* ── Filter tabs ── */
    .filters {
      max-width: 640px;
      margin: 0 auto 18px;
      display: flex;
      gap: 8px;
    }

    .filter-btn {
      border: 1.5px solid var(--line);
      border-radius: 20px;
      padding: 6px 16px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--muted);
      background: transparent;
      cursor: pointer;
      transition: all 0.2s;
    }
    .filter-btn.active, .filter-btn:hover {
      background: var(--ink);
      color: #fff;
      border-color: var(--ink);
    }

    /* ── Task list ── */
    .task-list {
      max-width: 640px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .task-item {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 16px 18px;
      display: flex;
      align-items: center;
      gap: 14px;
      animation: slideIn 0.25s ease;
      transition: opacity 0.2s;
      position: relative;
      overflow: hidden;
    }
    .task-item::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 3px;
      border-radius: 3px 0 0 3px;
    }
    .task-item.p-high::before  { background: #d95f4b; }
    .task-item.p-medium::before { background: var(--accent); }
    .task-item.p-low::before   { background: #6dbf9c; }

    @keyframes slideIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .task-item.completed { opacity: 0.55; }

    /* Checkbox */
    .check-box {
      width: 22px; height: 22px;
      border: 2px solid var(--line);
      border-radius: 50%;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: all 0.2s;
    }
    .check-box:hover { border-color: var(--accent); }
    .check-box.checked {
      background: var(--accent);
      border-color: var(--accent);
    }
    .check-box.checked::after {
      content: '';
      width: 5px; height: 9px;
      border: 2px solid #fff;
      border-top: none; border-left: none;
      transform: rotate(45deg) translateY(-1px);
    }

    /* Text */
    .task-text {
      flex: 1;
      font-size: 0.93rem;
      font-weight: 400;
      color: var(--ink);
      line-height: 1.4;
      transition: color 0.2s;
    }
    .task-item.completed .task-text {
      text-decoration: line-through;
      color: var(--done-text);
    }

    /* Priority pill */
    .priority-pill {
      font-size: 0.68rem;
      font-weight: 500;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      padding: 3px 9px;
      border-radius: 20px;
    }
    .pill-high   { background: #fdecea; color: #d95f4b; }
    .pill-medium { background: var(--accent-light); color: var(--accent); }
    .pill-low    { background: #e3f6ed; color: #3a9c6c; }

    /* Delete btn */
    .del-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--line);
      font-size: 1.1rem;
      line-height: 1;
      padding: 2px 4px;
      transition: color 0.2s;
      flex-shrink: 0;
    }
    .del-btn:hover { color: #d95f4b; }

    /* Empty state */
    .empty {
      text-align: center;
      padding: 56px 20px;
      color: var(--muted);
      font-size: 0.9rem;
    }
    .empty-icon {
      font-size: 2.4rem;
      margin-bottom: 12px;
      display: block;
      opacity: 0.4;
    }

    /* Progress bar */
    .progress-wrap {
      max-width: 640px;
      margin: 0 auto 24px;
    }
    .progress-bar {
      height: 4px;
      background: var(--line);
      border-radius: 4px;
      overflow: hidden;
    }
    .progress-fill {
      height: 100%;
      background: var(--accent);
      border-radius: 4px;
      transition: width 0.4s ease;
    }
    .progress-label {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 6px;
      text-align: right;
    }