* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1f2937;
  padding: 16px;
  padding-bottom: 80px;
}

.app {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 20px;
}
header h1 { font-size: 28px; margin-bottom: 4px; }
.subtitle { opacity: 0.9; font-size: 14px; }

.task-form {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.task-form input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.task-form input:focus { outline: none; border-color: #6366f1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 140px; }

.btn-primary, .btn-secondary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
}
.btn-primary { background: #6366f1; color: white; }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: white;
  color: #6366f1;
  margin-top: 12px;
  border: 2px solid #6366f1;
}
.btn-secondary.enabled { background: #10b981; color: white; border-color: #10b981; }

.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter {
  flex: 1;
  min-width: 80px;
  padding: 10px;
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.filter.active { background: white; color: #6366f1; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.stats {
  color: white;
  text-align: center;
  margin-bottom: 12px;
  font-size: 14px;
  opacity: 0.95;
}

.task-list { list-style: none; }
.task {
  background: white;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  animation: slideIn .3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.task.done { opacity: 0.6; }
.task.done .task-title { text-decoration: line-through; }
.task.overdue { border-left: 4px solid #ef4444; }

.checkbox {
  width: 24px; height: 24px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  margin-top: 2px;
}
.checkbox.checked { background: #10b981; border-color: #10b981; color: white; }
.checkbox.checked::after { content: "✓"; font-weight: bold; }

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 16px; word-break: break-word; }
.task-desc { font-size: 13px; color: #6b7280; margin-top: 2px; word-break: break-word; }
.task-time {
  font-size: 12px;
  color: #6366f1;
  margin-top: 6px;
  display: inline-block;
  background: #eef2ff;
  padding: 3px 8px;
  border-radius: 6px;
}

.task-actions { display: flex; flex-direction: column; gap: 4px; }
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .2s;
}
.icon-btn:hover { background: #f3f4f6; }

.empty-state {
  text-align: center;
  color: white;
  padding: 40px 20px;
}
.empty-state .emoji { font-size: 60px; margin-bottom: 12px; }

@media (max-width: 480px) {
  body { padding: 10px; }
  header h1 { font-size: 24px; }
  .task-form { padding: 12px; }
}