:root {
  --teal: #2a7f7f;
  --teal-dark: #1e5c5c;
  --bg: #f4f6f7;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #d94a4a;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ---------- Login ---------- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 320px;
  text-align: center;
}
.login-box h1 { color: var(--teal-dark); font-size: 1.4rem; margin-bottom: 4px; }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.login-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}
.error { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; }

/* ---------- App ---------- */
header {
  background: var(--teal-dark);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header h1 { font-size: 1.2rem; margin: 0; }

.tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.tab-btn {
  background: none;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tab-btn.active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

main { padding: 24px; max-width: 900px; margin: 0 auto; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.toolbar select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-primary { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: #eee; color: var(--text); }
.btn-secondary:hover { background: #ddd; }

.cards-list { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid var(--teal);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card.done { opacity: 0.55; border-left-color: #999; }
.card-main { flex: 1; }
.card-desc { font-size: 0.95rem; margin-bottom: 6px; }
.card-meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  color: white;
}
.card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.icon-btn:hover { background: #f0f0f0; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 { margin-top: 0; color: var(--teal-dark); }
.modal-box label { display: block; font-size: 0.85rem; margin: 10px 0 4px; color: var(--muted); }
.modal-box input, .modal-box select, .modal-box textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}
