@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --font-size: 16px;
  --primary: oklch(0.55 0.18 230);
  --primary-foreground: #ffffff;
  --accent: oklch(0.85 0.15 150);
  --accent-foreground: #000000;
  --background: oklch(0.98 0.02 50);
  --foreground: oklch(0.15 0 0);
  --card: #ffffff;
  --card-foreground: oklch(0.15 0 0);
  --muted: oklch(0.92 0.02 50);
  --muted-foreground: oklch(0.55 0 0);
  --destructive: oklch(0.50 0.18 25);
  --destructive-foreground: #ffffff;
  --border: oklch(0.88 0.02 50);
  --input-bg: oklch(0.96 0.02 50);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

.dark {
  --background: oklch(0.16 0 0);
  --foreground: oklch(0.97 0 0);
  --card: oklch(0.21 0 0);
  --card-foreground: oklch(0.97 0 0);
  --muted: oklch(0.27 0 0);
  --muted-foreground: oklch(0.78 0 0);
  --primary: oklch(0.68 0.18 230);
  --accent: oklch(0.26 0 0);
  --accent-foreground: oklch(0.97 0 0);
  --border: oklch(0.35 0 0);
  --input-bg: oklch(0.24 0 0);
}

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

html {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
}

body {
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

.hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#main-page {
  display: block;
  width: 100%;
  min-height: 100vh;
}

.login-container {
  background: var(--card);
  padding: 2rem 2.5rem;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(80, 40, 200, 0.08), 0 2px 12px rgba(0,0,0,0.04);
  width: 100%;
  max-width: 380px;
}

.app-icon { display: flex; justify-content: center; margin-bottom: 1.5rem; }

.login-logo svg { width: 72px; height: 72px; }

.login-container h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.login-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--foreground);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.52 0.22 270 / 0.18);
}

#login-form button[type="submit"] {
  width: 100%;
  padding: 0.9rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 0.25rem;
  transition: opacity 0.2s, transform 0.2s;
}

#login-form button[type="submit"]:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.error {
  color: oklch(0.42 0.16 25);
  background: oklch(0.96 0.03 25);
  border: 1px solid oklch(0.78 0.1 25);
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.dark .error {
  color: oklch(0.85 0.1 25);
  background: oklch(0.22 0.06 25);
  border-color: oklch(0.38 0.12 25);
}

/* ── Banner ──────────────────────────────────────────────────── */

.top-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3%;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.banner-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 9px;
}

.banner-logo-wrap.admin-logo { cursor: pointer; }

.banner-logo-wrap svg,
.banner-logo-wrap .app-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: contain;
  display: block;
}

/* Login logo */
.login-logo { display: flex; justify-content: center; align-items: center; }

.login-logo svg,
.login-logo .app-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: contain;
}

/* Upload overlay */
.logo-change-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.banner-logo-wrap.admin-logo:hover .logo-change-overlay {
  opacity: 1;
}

.app-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}

.icon-btn:hover { background: var(--border); }

.user-name {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.logout-btn {
  background: var(--destructive);
  color: var(--destructive-fg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.logout-btn:hover { opacity: 0.88; }

/* ── Content ─────────────────────────────────────────────────── */

.content-area {
  margin-top: 80px;
  padding: 1.5rem 3%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Toolbar ─────────────────────────────────────────────────── */

.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

#task-search {
  flex: 1;
  min-width: 180px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--foreground);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#task-search:focus { border-color: var(--primary); }

.filter-group {
  display: flex;
  background: var(--muted);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ── Buttons ─────────────────────────────────────────────────── */

.primary-btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.primary-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.ghost-btn:hover { background: var(--muted); }

/* ── New Task Form ───────────────────────────────────────────── */

.task-form-card {
  background: var(--card);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px oklch(0.52 0.22 270 / 0.12);
}

.task-form-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.task-form-card input[type="text"],
.task-form-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  background: var(--input-bg);
  color: var(--foreground);
  font-family: inherit;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.task-form-card textarea { resize: vertical; font-family: inherit; }

.task-form-card input:focus,
.task-form-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.52 0.22 270 / 0.15);
}

.form-actions { display: flex; gap: 0.6rem; }

/* ── Task Cards ──────────────────────────────────────────────── */

#tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.task-card:hover { box-shadow: 0 4px 16px rgba(80, 40, 200, 0.08); }

.task-card.task-done {
  border-left-color: var(--muted-foreground);
  opacity: 0.75;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
}

/* Circle checkbox */
.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  color: transparent;
  font-size: 0.7rem;
  font-weight: 900;
}

.task-check::after { content: '✓'; }

.task-check.done {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.task-check:hover:not(.done) { border-color: var(--primary-light); }

.task-meta { flex: 1; min-width: 0; }

.task-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--foreground);
  display: block;
  line-height: 1.4;
}

.task-card.task-done .task-title {
  text-decoration: line-through;
  color: var(--muted-foreground);
}

.task-desc-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtask-progress {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.subtask-progress.all-done {
  background: oklch(0.88 0.12 145);
  color: oklch(0.4 0.15 145);
}

.dark .subtask-progress.all-done {
  background: oklch(0.3 0.12 145);
  color: oklch(0.75 0.12 145);
}

.task-expand-btn {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.task-expand-btn:hover { background: var(--muted); color: var(--foreground); }
.task-expand-btn.expanded { transform: rotate(180deg); }

.task-delete-btn {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.task-delete-btn:hover { background: var(--destructive); color: var(--destructive-fg); }

/* ── Task Body (expanded) ────────────────────────────────────── */

.task-body {
  border-top: 1px solid var(--border);
  padding: 1rem 1.1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Description */
.task-description {
  font-size: 0.88rem;
  color: var(--foreground);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  background: var(--muted);
  min-height: 42px;
  line-height: 1.6;
  transition: background 0.15s;
}

.task-description:hover { background: var(--input-bg); }

.task-description.empty { color: var(--muted-foreground); font-style: italic; }

.task-description.editing { cursor: default; background: transparent; padding: 0; }

.desc-edit-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--input-bg);
  color: var(--foreground);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  box-shadow: 0 0 0 3px oklch(0.52 0.22 270 / 0.12);
}

.desc-edit-textarea:focus { outline: none; }

.desc-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Subtasks */
.subtasks-section h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted-foreground);
  margin-bottom: 0.6rem;
}

.subtasks-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }

.subtask-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.subtask-item:hover { background: var(--muted); }

.subtask-check {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.6rem;
  font-weight: 900;
  transition: all 0.15s;
  padding: 0;
}

.subtask-check::after { content: '✓'; }

.subtask-check.done {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.subtask-check:hover:not(.done) { border-color: var(--primary-light); }

.subtask-title {
  flex: 1;
  font-size: 0.87rem;
  color: var(--foreground);
}

.subtask-item.subtask-done .subtask-title {
  text-decoration: line-through;
  color: var(--muted-foreground);
}

.subtask-delete-btn {
  background: transparent;
  border: none;
  color: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
  transition: all 0.12s;
  flex-shrink: 0;
}

.subtask-item:hover .subtask-delete-btn { color: var(--muted-foreground); }
.subtask-delete-btn:hover { background: var(--destructive) !important; color: var(--destructive-fg) !important; }

/* Add subtask */
.add-subtask-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-subtask-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.add-subtask-input:focus {
  outline: none;
  border-style: solid;
  border-color: var(--primary);
  background: var(--input-bg);
}

.add-subtask-input::placeholder { color: var(--muted-foreground); }

.add-subtask-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.15s;
}

.add-subtask-btn:hover { opacity: 0.85; }

/* ── Empty state ─────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted-foreground);
}

.empty-state svg { margin-bottom: 1rem; opacity: 0.35; }
.empty-state p { font-size: 0.95rem; }
.empty-state strong { display: block; font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--foreground); opacity: 0.6; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .tasks-toolbar { flex-direction: column; align-items: stretch; }
  #task-search { min-width: 0; }
  .filter-group { justify-content: center; }
  .content-area { padding: 1rem 4%; margin-top: 70px; }
  .user-name { display: none; }
  .top-banner { padding: 0 4%; }
}

@media (max-width: 400px) {
  .login-container { padding: 1.5rem 1.25rem; }
}

/* ── Modal ───────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content-sm { max-width: 400px; }

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  line-height: 1;
}

.close-modal:hover { color: var(--foreground); }

/* ── Settings ────────────────────────────────────────────────── */

.settings-content h2 { margin-bottom: 1.25rem; font-size: 1.15rem; }

.settings-user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.settings-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.settings-username { font-weight: 600; font-size: 0.95rem; }

.settings-role-badge {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  background: var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  display: inline-block;
  margin-top: 2px;
}

.settings-section { margin-bottom: 1.5rem; }
.settings-section h3 { font-size: 0.9rem; margin-bottom: 0.85rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.04em; }

.settings-logout-section { padding-top: 1rem; border-top: 1px solid var(--border); }

.settings-logout-btn {
  width: 100%;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-md);
}
.settings-logout-btn:hover { opacity: 0.88; }

.danger-btn {
  background: var(--destructive);
  color: var(--destructive-fg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.danger-btn:hover { opacity: 0.88; }

/* ── Password success animation ──────────────────────────────── */

.pw-success-anim {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.5rem;
}

.pw-checkmark {
  width: 52px;
  height: 52px;
}

.pw-checkmark-circle {
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: pw-stroke 0.6s cubic-bezier(0.65,0,0.45,1) forwards;
}

.pw-checkmark-check {
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: pw-stroke 0.4s cubic-bezier(0.65,0,0.45,1) 0.5s forwards;
}

@keyframes pw-stroke {
  to { stroke-dashoffset: 0; }
}

.pw-success-text {
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Modern workspace refresh ───────────────────────────────── */

:root {
  --primary: oklch(0.56 0.16 234);
  --primary-hover: oklch(0.49 0.16 234);
  --primary-soft: oklch(0.94 0.04 230);
  --success: oklch(0.63 0.15 154);
  --background: oklch(0.975 0.012 225);
  --card: rgba(255, 255, 255, 0.92);
  --muted: oklch(0.945 0.014 225);
  --muted-foreground: oklch(0.49 0.025 235);
  --border: oklch(0.89 0.022 230);
  --input-bg: rgba(255, 255, 255, 0.78);
  --radius: 20px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 42, 66, 0.04), 0 6px 18px rgba(18, 42, 66, 0.04);
  --shadow-md: 0 18px 48px rgba(21, 63, 93, 0.1);
}

.dark {
  --primary-soft: oklch(0.26 0.055 232);
  --background: oklch(0.16 0.018 238);
  --card: oklch(0.205 0.018 238 / 0.96);
  --muted: oklch(0.245 0.018 238);
  --border: oklch(0.31 0.025 235);
  --input-bg: oklch(0.225 0.018 238);
}

body {
  background:
    radial-gradient(circle at 8% 0%, oklch(0.91 0.055 225 / 0.55), transparent 28rem),
    radial-gradient(circle at 95% 22%, oklch(0.93 0.05 155 / 0.4), transparent 24rem),
    var(--background);
  background-attachment: fixed;
}

.dark body {
  background:
    radial-gradient(circle at 8% 0%, oklch(0.3 0.065 230 / 0.42), transparent 30rem),
    radial-gradient(circle at 95% 22%, oklch(0.25 0.05 155 / 0.25), transparent 25rem),
    var(--background);
}

button, input, textarea { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.task-description:focus-visible {
  outline: 3px solid oklch(0.67 0.14 230 / 0.3);
  outline-offset: 2px;
}

/* Login */
#login-page::before,
#login-page::after {
  content: '';
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  z-index: -1;
}

#login-page::before { left: -8rem; top: -8rem; background: oklch(0.83 0.1 230 / 0.34); }
#login-page::after { right: -8rem; bottom: -9rem; background: oklch(0.86 0.1 154 / 0.28); }

.login-container {
  max-width: 420px;
  padding: 2.5rem;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.dark .login-container { border-color: var(--border); }

.login-product-pill {
  width: max-content;
  margin: 0 auto 1.5rem;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-product-pill span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px oklch(0.63 0.15 154 / 0.13);
}

.login-logo svg,
.login-logo .app-logo-img {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 12px 20px oklch(0.56 0.16 234 / 0.2));
}

.login-container h1 { font-size: 1.75rem; letter-spacing: -0.035em; }
.login-subtitle { margin-bottom: 2rem; font-size: 0.95rem; }

.form-group label { color: var(--foreground); font-weight: 600; }
.form-group input { min-height: 48px; background: var(--input-bg); }
#login-form button[type="submit"] { min-height: 49px; box-shadow: 0 9px 20px oklch(0.56 0.16 234 / 0.22); }

/* Header */
.top-banner {
  height: 68px;
  padding: 0 max(3%, calc((100vw - 1120px) / 2));
  background: color-mix(in oklch, var(--card) 86%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  box-shadow: 0 1px 12px rgba(18, 42, 66, 0.04);
  backdrop-filter: blur(18px);
}

.banner-left { gap: 0.75rem; }
.banner-logo-wrap svg,
.banner-logo-wrap .app-logo-img { width: 38px; height: 38px; border-radius: 11px; }
.app-name { font-size: 1.05rem; letter-spacing: -0.02em; }

.banner-right { gap: 0.65rem; }
.user-name {
  color: var(--foreground);
  font-weight: 600;
  padding: 0 0.35rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  background: transparent;
  border-color: var(--border);
  border-radius: 11px;
}

.icon-btn:hover { background: var(--muted); transform: translateY(-1px); }

.settings-grid-btn {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  place-content: center;
  gap: 3px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}

.settings-grid-btn span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.settings-grid-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

/* Dashboard */
.content-area {
  max-width: 1120px;
  margin-top: 68px;
  padding: 3.25rem 2rem 5rem;
}

.workspace-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.workspace-heading .eyebrow {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workspace-heading h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.workspace-heading p { color: var(--muted-foreground); font-size: 0.96rem; }

.hero-add-btn {
  min-height: 46px;
  padding: 0 1.15rem;
  border-radius: 13px;
  box-shadow: 0 10px 24px oklch(0.56 0.16 234 / 0.2);
}

.hero-add-btn span { margin-right: 0.3rem; font-size: 1.15rem; }

.task-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.overview-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 94px;
  padding: 1.1rem 1.2rem;
  background: var(--card);
  border: 1px solid color-mix(in oklch, var(--border) 85%, transparent);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.overview-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--primary) 38%, var(--border));
  box-shadow: 0 12px 28px rgba(21, 63, 93, 0.09);
}

.overview-card.active {
  border-color: color-mix(in oklch, var(--primary) 64%, var(--border));
  box-shadow: 0 0 0 3px oklch(0.56 0.16 234 / 0.09), var(--shadow-sm);
}

.overview-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.overview-active .overview-icon { background: oklch(0.94 0.05 80); color: oklch(0.63 0.14 72); }
.overview-done .overview-icon { background: oklch(0.94 0.05 154); color: var(--success); }
.dark .overview-active .overview-icon { background: oklch(0.27 0.05 75); color: oklch(0.78 0.11 76); }
.dark .overview-done .overview-icon { background: oklch(0.27 0.05 154); color: oklch(0.75 0.12 154); }

.overview-card strong {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.overview-card div span { color: var(--muted-foreground); font-size: 0.78rem; }

/* Toolbar */
.tasks-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.45rem 0;
}

.toolbar-label { align-self: center; }
.toolbar-label h2 { display: inline; font-size: 1.12rem; letter-spacing: -0.025em; }
.toolbar-label span { margin-left: 0.55rem; color: var(--muted-foreground); font-size: 0.76rem; }

.search-field { position: relative; display: block; }
.search-field svg {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted-foreground);
  stroke-width: 1.8;
  pointer-events: none;
}

#task-search {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.9rem 0.55rem 2.35rem;
  background: var(--card);
  border-color: var(--border);
}

#task-search:focus { box-shadow: 0 0 0 3px oklch(0.56 0.16 234 / 0.1); }
.filter-group { align-self: center; min-height: 42px; padding: 4px; border: 1px solid var(--border); }
.filter-btn { padding: 0.45rem 0.8rem; border-radius: 8px; }
.filter-btn.active { box-shadow: 0 3px 10px oklch(0.56 0.16 234 / 0.18); }

/* Forms and task cards */
.task-form-card {
  padding: 1.5rem;
  border: 1px solid color-mix(in oklch, var(--primary) 45%, var(--border));
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  animation: reveal-card 0.22s ease-out;
}

.task-form-card h3 { font-size: 1.08rem; }
.task-form-card input[type="text"], .task-form-card textarea { background: var(--input-bg); }

#tasks-list { gap: 0.8rem; }
.task-card {
  border: 1px solid color-mix(in oklch, var(--border) 88%, transparent);
  border-left: 1px solid color-mix(in oklch, var(--border) 88%, transparent);
  border-radius: 17px;
  box-shadow: var(--shadow-sm);
  animation: reveal-card 0.25s ease-out both;
}

.task-card:hover {
  border-color: color-mix(in oklch, var(--primary) 26%, var(--border));
  box-shadow: 0 12px 32px rgba(21, 63, 93, 0.09);
  transform: translateY(-1px);
}

.task-card.task-done { opacity: 0.68; border-left-color: var(--border); }
.task-header { min-height: 72px; padding: 1rem 1.2rem; gap: 0.85rem; }
.task-header { cursor: pointer; }

.task-drag-handle {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-template-rows: repeat(3, 3px);
  gap: 3px;
  width: 16px;
  flex: 0 0 16px;
  padding: 5px 2px;
  color: var(--muted-foreground);
  cursor: grab;
  touch-action: none;
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
  user-select: none;
}

.task-drag-handle i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
}

.task-card:hover .task-drag-handle { opacity: 1; color: var(--primary); }
.task-drag-handle:active { cursor: grabbing; }
.task-card.dragging {
  opacity: 0.38;
  transform: scale(0.985);
  border-style: dashed;
  box-shadow: none;
  user-select: none;
}
.task-card.drag-over-before { box-shadow: 0 -4px 0 -1px var(--primary), var(--shadow-sm); }
.task-card.drag-over-after { box-shadow: 0 4px 0 -1px var(--primary), var(--shadow-sm); }
.task-card.drag-over-before,
.task-card.drag-over-after { border-color: color-mix(in oklch, var(--primary) 38%, var(--border)); }

.task-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 12000;
  margin: 0;
  pointer-events: none;
  opacity: 0.76;
  border-color: color-mix(in oklch, var(--primary) 55%, var(--border));
  box-shadow: 0 18px 44px rgba(10, 34, 55, 0.24);
  animation: none;
  transition: none;
  will-change: transform;
  cursor: grabbing;
}

.task-drag-ghost .task-header { cursor: grabbing; }
.task-drag-ghost .task-drag-handle { color: var(--primary); opacity: 1; }
.task-title { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; }
.task-desc-hint { margin-top: 0.25rem; font-size: 0.78rem; }

.task-check {
  width: 24px;
  height: 24px;
  border-color: color-mix(in oklch, var(--primary) 34%, var(--border));
}

.task-check.done { box-shadow: 0 4px 10px oklch(0.56 0.16 234 / 0.25); }
.subtask-progress { padding: 0.25rem 0.6rem; background: var(--primary-soft); color: var(--primary); }
.task-expand-btn, .task-delete-btn { min-width: 31px; min-height: 31px; border-radius: 9px; }
.task-body { padding: 1.1rem 1.25rem 1.25rem 3.25rem; background: color-mix(in oklch, var(--muted) 45%, transparent); }
.task-description { border: 1px solid transparent; background: var(--card); }
.task-description:hover { border-color: var(--border); }
.subtask-item { min-height: 38px; }
.add-subtask-input { min-height: 38px; background: var(--card); }
.add-subtask-btn { width: 36px; height: 36px; border-radius: 11px; }

.empty-state {
  margin-top: 0.5rem;
  padding: 4.5rem 2rem;
  background: color-mix(in oklch, var(--card) 65%, transparent);
  border: 1px dashed var(--border);
  border-radius: 20px;
}

.modal { background: rgba(8, 20, 32, 0.55); backdrop-filter: blur(5px); }
.modal-content { border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 28px 70px rgba(5, 18, 30, 0.28); }

@keyframes reveal-card {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 780px) {
  .content-area { padding: 2.25rem 1rem 4rem; }
  .tasks-toolbar { grid-template-columns: 1fr minmax(200px, 280px); }
  .task-overview { gap: 0.65rem; }
  .overview-card { min-height: 82px; padding: 0.85rem; }
  .overview-icon { width: 38px; height: 38px; flex-basis: 38px; }
}

@media (max-width: 640px) {
  .top-banner { height: 62px; padding: 0 1rem; }
  .app-name { font-size: 0.95rem; }
  .content-area { margin-top: 62px; padding-top: 1.75rem; }
  .workspace-hero { align-items: center; margin-bottom: 1.4rem; }
  .workspace-heading p { display: none; }
  .hero-add-btn { width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  .hero-add-btn span { margin: 0; font-size: 1.35rem; }
  .task-overview { grid-template-columns: repeat(3, 1fr); }
  .overview-card { display: block; text-align: center; }
  .overview-icon { margin: 0 auto 0.55rem; }
  .overview-card strong { font-size: 1.25rem; }
  .overview-card div span { font-size: 0.67rem; }
  .tasks-toolbar { display: grid; grid-template-columns: 1fr; }
  .toolbar-label { display: flex; justify-content: space-between; }
  .filter-group { width: 100%; }
  .filter-btn { flex: 1; }
  .task-header { padding: 0.9rem; gap: 0.62rem; }
  .task-body { padding: 1rem; }
  .subtask-progress { font-size: 0.67rem; }
}

@media (max-width: 390px) {
  .task-overview { grid-template-columns: 1fr; }
  .overview-card { display: flex; text-align: left; min-height: 72px; }
  .overview-icon { margin: 0; }
  .login-container { padding: 2rem 1.3rem; }
}

/* ── Unified profile settings (Goodwater Recipes) ───────────── */

.modal-content-sm { max-width: 480px; }

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-content .settings-header h2 {
  margin: 0;
  padding-right: 1.5rem;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.profile-role {
  margin-top: 0.2rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.settings-content .settings-avatar {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  box-shadow: 0 7px 16px oklch(0.56 0.16 234 / 0.2);
}

.settings-content .settings-section {
  margin: 0;
  padding: 1.25rem;
  background: color-mix(in oklch, var(--background) 72%, var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.settings-content .settings-section h3 {
  margin: 0 0 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.settings-content .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.settings-content .form-group { margin-bottom: 1rem; }

.settings-content input,
.settings-content textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--foreground);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.settings-content input:focus,
.settings-content textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.56 0.16 234 / 0.1);
}

.settings-content input[readonly] {
  color: var(--muted-foreground);
  cursor: not-allowed;
}

#profile-description { min-height: 96px; resize: vertical; }

.password-field { position: relative; }
.password-field input { padding-right: 5rem; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  padding: 0.35rem 0.45rem;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-content .primary-btn { width: 100%; min-height: 43px; }
.form-message { min-height: 1.2rem; margin: -0.2rem 0 0.75rem; font-size: 0.82rem; }
.message-success { color: var(--success); }
.message-error { color: var(--destructive); }

.settings-content .settings-logout-section { padding: 1rem 1.25rem; }
.settings-content .danger-btn {
  width: 100%;
  min-height: 43px;
  background: transparent;
  border: 1px solid color-mix(in oklch, var(--destructive) 48%, var(--border));
  color: var(--destructive);
}
.settings-content .danger-btn:hover { background: var(--destructive); color: white; }

button.close-modal {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
}
button.close-modal:hover { background: var(--muted); }

@media (max-width: 520px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-content-sm {
    max-width: none;
    max-height: 94vh;
    padding: 1.35rem 1rem 1.5rem;
    border-radius: 22px 22px 0 0;
  }
  .settings-content { gap: 1rem; }
  .settings-content .form-row { grid-template-columns: 1fr; gap: 0; }
}
