:root {
  --bg: #f3f4fb;
  --bg-glow: rgba(99, 102, 241, 0.12);
  --panel: #ffffff;
  --panel-2: #f7f8fe;
  --panel-3: #eef0fb;
  --text: #1a1f36;
  --text-soft: #3d4460;
  --muted: #6b7280;
  --border: #e4e7f2;
  --border-strong: #d4d8e8;
  --accent: #6366f1;
  --accent-strong: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(20, 27, 58, 0.06);
  --shadow-md: 0 12px 30px -16px rgba(20, 27, 58, 0.28);
  --shadow-lg: 0 32px 80px -32px rgba(20, 27, 58, 0.42);
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 276px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090d18;
    --bg-glow: rgba(99, 102, 241, 0.16);
    --panel: #111728;
    --panel-2: #0d1322;
    --panel-3: #1a2238;
    --text: #e8ebf7;
    --text-soft: #c3c9de;
    --muted: #929bb5;
    --border: #222b45;
    --border-strong: #2e3856;
    --accent: #818cf8;
    --accent-strong: #6366f1;
    --accent-soft: rgba(129, 140, 248, 0.16);
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 14px 36px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 36px 90px -30px rgba(0, 0, 0, 0.85);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1000px 600px at 85% -10%, var(--bg-glow), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family:
    "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

input,
textarea,
select {
  font: inherit;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.spacer {
  flex: 1;
}

/* ---------------------------------- Auth --------------------------------- */

.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  color: #f8f9ff;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(236, 72, 153, 0.35), transparent 65%),
    linear-gradient(145deg, #4f46e5 0%, #6366f1 45%, #8b5cf6 100%);
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -120px -160px auto;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 60px solid rgba(255, 255, 255, 0.08);
}

.auth-brand h1 {
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.03em;
}

.auth-tagline {
  max-width: 420px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.86);
}

.brand-points {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-points span {
  color: #c7d2fe;
  font-size: 11px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
}

.auth-card {
  width: min(430px, 100%);
  padding: clamp(26px, 4vw, 40px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-card h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin-top: 6px;
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-switch {
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.brand-glyph {
  width: 64px;
  height: 64px;
  border-radius: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(145deg, #6366f1, #8b5cf6);
  box-shadow:
    0 18px 40px -16px rgba(79, 70, 229, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-glyph.small {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 24px;
}

.brand-glyph.tiny {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
}

/* ------------------------------- Form fields ----------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.field small {
  font-weight: 400;
  font-size: 12px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  font-size: 13px;
}

/* --------------------------------- Buttons -------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
  white-space: nowrap;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px -12px rgba(79, 70, 229, 0.8);
}

.button.primary:hover:not(:disabled) {
  box-shadow: 0 14px 30px -12px rgba(79, 70, 229, 0.95);
}

.button.ghost {
  background: var(--panel-2);
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.button.ghost:hover {
  background: var(--panel-3);
}

.button.danger {
  color: var(--danger);
}

.button.danger.ghost {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.button.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.button.wide {
  width: 100%;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.icon-btn:hover {
  background: var(--panel-3);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.mini-btn {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.mini-btn:hover {
  background: var(--panel-3);
  color: var(--accent);
}

/* -------------------------------- App shell ------------------------------- */

.app-shell {
  min-height: 100dvh;
  display: flex;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100dvh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  z-index: 90;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sidebar-close,
.menu-btn {
  display: none;
}

.nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-dot.all {
  background: linear-gradient(145deg, #6366f1, #a855f7);
}

.project-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 999px;
}

.nav-item.active .nav-count {
  color: var(--accent);
  border-color: transparent;
  background: rgba(99, 102, 241, 0.14);
}

.nav-section {
  margin-top: 18px;
  padding: 0 11px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.new-project {
  display: flex;
  gap: 6px;
  padding: 2px;
  margin-bottom: 4px;
}

.new-project input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 13px;
  outline: none;
}

.new-project input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-row {
  position: relative;
  display: flex;
  align-items: center;
}

.project-row .nav-item {
  padding-right: 30px;
}

.project-delete {
  position: absolute;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.project-row:hover .project-delete {
  opacity: 1;
}

.project-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  background: linear-gradient(145deg, #6366f1, #ec4899);
}

.user-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-email {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-sub {
  font-size: 11px;
  color: var(--muted);
}

.logout-btn {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.sidebar-overlay {
  display: none;
}

/* ---------------------------------- Main ---------------------------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.head-titles {
  min-width: 0;
  flex: 1;
}

.head-titles h1 {
  font-size: 21px;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head-titles p {
  font-size: 12.5px;
  margin-top: 1px;
}

.head-progress {
  width: 170px;
  flex-shrink: 0;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.35s ease;
}

.content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 32px 120px;
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  font-size: 12.5px;
  font-weight: 550;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
  flex-shrink: 0;
}

.quick-add {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.quick-add:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.quick-add-icon {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.quick-add input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  padding: 8px 0;
}

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

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 2px 12px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--panel-3);
}

.segmented button {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.toolbar-hint {
  font-size: 12px;
  color: var(--muted);
}

/* --------------------------------- Tasks ---------------------------------- */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.task-node {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.task-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.task-row.dragging {
  opacity: 0.45;
  transform: scale(0.995);
}

.drag-handle {
  color: var(--border-strong);
  font-size: 15px;
  cursor: grab;
  user-select: none;
  padding: 0 1px;
  transition: color 0.15s ease;
}

.task-row:hover .drag-handle {
  color: var(--muted);
}

.drag-handle:active {
  cursor: grabbing;
}

.checkbox {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.checkbox:hover {
  border-color: var(--accent);
}

.checkbox:active {
  transform: scale(0.92);
}

.checkbox .checkmark {
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.checkbox.checked {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.checkbox.checked .checkmark {
  opacity: 1;
  transform: scale(1);
}

.task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-title {
  text-align: left;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.task-title:hover {
  color: var(--accent);
}

.task-row.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.note-chip {
  color: var(--accent);
  border-color: transparent;
  background: var(--accent-soft);
}

.due-chip.overdue {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-high {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.priority-medium {
  background: var(--warning);
}

.priority-low {
  background: #94a3b8;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.task-row:hover .task-actions,
.task-row:focus-within .task-actions {
  opacity: 1;
}

.expand-btn {
  font-size: 15px;
}

.expand-btn span {
  display: inline-block;
  transition: transform 0.18s ease;
  transform: rotate(0deg);
}

.expand-btn span.rotated {
  transform: rotate(-90deg);
}

.subtasks {
  margin: 5px 0 2px 21px;
  padding-left: 12px;
  border-left: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subtask-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px 32px;
}

.subtask-arrow {
  color: var(--muted);
  font-size: 14px;
}

.subtask-add input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--panel);
  font-size: 13px;
  outline: none;
}

.subtask-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.drop-zone {
  margin-top: 16px;
  padding: 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.45;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.drop-zone.active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 64px 20px 40px;
}

.empty-glyph {
  font-size: 52px;
  line-height: 1;
  color: var(--border-strong);
  margin-bottom: 14px;
}

.empty-state h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.empty-state p {
  max-width: 380px;
  margin: 8px auto 0;
  font-size: 13.5px;
}

/* --------------------------------- Modal ---------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 22, 0.58);
  backdrop-filter: blur(5px);
  animation: fade-in 0.15s ease;
}

.modal {
  width: min(580px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.18s ease;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --------------------------------- Toasts --------------------------------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 44px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #101528;
  color: #eef1fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slide-up 0.2s ease;
}

.toast-close {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  color: #ffffff;
}

/* -------------------------------- Boot/404 -------------------------------- */

.boot-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.not-found {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.not-found-code {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(145deg, var(--accent), #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found .button {
  margin-top: 12px;
}

/* -------------------------------- Animation ------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------- Responsive ------------------------------ */

@media (hover: none) {
  .task-actions,
  .project-delete {
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 34px 26px 30px;
    gap: 10px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .brand-points {
    display: none;
  }

  .brand-glyph {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 26px;
  }

  .auth-panel {
    padding: 22px;
  }

  .auth-card {
    margin-top: -12px;
    box-shadow: var(--shadow-md);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(6, 9, 18, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    display: inline-flex;
  }

  .main-head {
    padding: 14px 18px;
    gap: 8px;
  }

  .head-titles h1 {
    font-size: 18px;
  }

  .head-progress {
    display: none;
  }

  .task-actions,
  .project-delete {
    opacity: 1;
  }

  .content {
    padding: 18px 16px 110px;
  }

  .toolbar {
    margin-top: 16px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: 88dvh;
    border-radius: 18px;
  }

  .modal-foot {
    border-radius: 0 0 18px 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .subtasks {
    margin-left: 10px;
    padding-left: 9px;
  }

  .subtask-add {
    margin-left: 20px;
  }

  .task-actions .icon-btn {
    width: 27px;
  }

  .drag-handle {
    display: none;
  }

  .quick-add .button {
    padding: 9px 12px;
  }

  .segmented button {
    padding: 5px 9px;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
