:root {
  --primary: #4285f4;
  --background: #f9f9f9;
  --on-background: #222;
  --card: #fff;
  --border: #e0e0e0;
  --shadow: 0 1px 6px 0 #0001;
}

body {
  background: var(--background);
  color: var(--on-background);
  font-family: 'Segoe UI', 'Arial', sans-serif;
  margin: 0;
  min-height: 100vh;
}

body.dark {
  --background: #1a1a1a;
  --on-background: #f3f3f3;
  --card: #232323;
  --border: #333;
}

.tasks-container {
  max-width: 340px;
  margin: 40px auto;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px 20px 16px 20px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.35rem;
  margin: 0;
}

#modeToggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--on-background);
  opacity: 0.7;
  transition: opacity 0.2s;
}
#modeToggle:hover {
  opacity: 1;
}

.input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 6px 0;
  background: none;
  border: none;
}

.input-bar input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--card);
  color: var(--on-background);
  outline: none;
  transition: border-color 0.2s;
}

.input-bar input:focus {
  border-color: var(--primary);
}

.input-bar button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.4rem;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.input-bar button:hover {
  background: #3367d6;
}

.todo-list {
  list-style: none;
  margin: 0; padding: 0;
  min-height: 80px;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 11px 13px;
  transition: box-shadow 0.2s;
  box-shadow: var(--shadow);
  gap: 7px;
}
.todo-item.completed span {
  text-decoration: line-through;
  opacity: 0.5;
}
.todo-item .left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.todo-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 1.1rem;
  height: 1.1rem;
}

.todo-item .important-btn {
  font-size: 1.2rem;
  border: none;
  background: none;
  color: gold;
  cursor: pointer;
  margin-left: 2px;
}

.todo-item .del-btn {
  border: none;
  background: none;
  color: #d34a4a;
  font-size: 1.05rem;
  cursor: pointer;
  margin-left: 8px;
}

footer {
  margin-top: 12px;
  text-align: right;
  font-size: 0.93rem;
  color: #888;
}
