:root {
  --bg: #f6f8fc;
  --bg-soft: rgba(255, 255, 255, 0.72);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text: #162033;
  --muted: #5f6b86;
  --border: rgba(22, 32, 51, 0.08);
  --shadow: 0 24px 80px rgba(35, 50, 80, 0.12);
  --brand: #2f6bff;
  --brand-soft: #dce6ff;
  --accent: #14b8a6;
  --accent-soft: #d9fff8;
  --warn: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-body: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

[data-theme="dark"] {
  --bg: #08111f;
  --bg-soft: rgba(9, 18, 33, 0.72);
  --surface: rgba(13, 22, 39, 0.86);
  --surface-strong: rgba(18, 28, 48, 0.98);
  --text: #edf4ff;
  --muted: #a3b0ca;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --brand: #7da6ff;
  --brand-soft: rgba(125, 166, 255, 0.18);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.16);
  --warn: #fbbf24;
  --danger: #fb7185;
  --success: #34d399;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 107, 255, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.16), transparent 26%),
    linear-gradient(180deg, var(--bg), var(--bg));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(22, 32, 51, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(22, 32, 51, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 85%);
  pointer-events: none;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.app-root {
  min-height: calc(100vh - 56px);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.65;
  pointer-events: none;
}

.orb-one {
  width: 320px;
  height: 320px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle at 30% 30%, rgba(47, 107, 255, 0.45), rgba(47, 107, 255, 0.08));
}

.orb-two {
  width: 260px;
  height: 260px;
  right: -90px;
  top: 100px;
  background: radial-gradient(circle at 30% 30%, rgba(20, 184, 166, 0.4), rgba(20, 184, 166, 0.08));
}

.auth-layout,
.dashboard-layout {
  display: grid;
  gap: 18px;
}

.auth-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: center;
  min-height: calc(100vh - 56px);
}

.hero-card,
.panel,
.card,
.task-card,
.modal,
.info-box,
.calendar-day,
.stat-card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.hero-card {
  border-radius: 32px;
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.32), rgba(20, 184, 166, 0.24));
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-title {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.8vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.68;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.hero-point {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-point strong {
  display: block;
  margin-bottom: 6px;
}

.auth-card,
.panel,
.card,
.modal {
  border-radius: 24px;
}

.auth-card {
  padding: 22px;
}

.segmented {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: var(--brand-soft);
  margin-bottom: 16px;
}

.segmented button,
.chip,
.icon-button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.small-button {
  border: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.segmented button {
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(30, 47, 83, 0.08);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field,
.input,
.select,
.textarea {
  width: 100%;
}

.field label,
.label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.input,
.select,
.textarea {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  outline: none;
  box-shadow: none;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  padding: 11px 16px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), #6ea0ff);
  color: white;
  box-shadow: 0 18px 32px rgba(47, 107, 255, 0.25);
}

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.danger-button {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.icon-button,
.small-button {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

button:hover,
.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.small-button:hover,
.card-action:hover {
  transform: translateY(-1px);
}

.error-banner,
.success-banner,
.notice-banner {
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

.error-banner {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.success-banner {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.notice-banner {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
}

.dashboard-layout {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.sidebar,
.main-column,
.right-column {
  display: grid;
  gap: 14px;
}

.sidebar {
  position: sticky;
  top: 16px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tab-button {
  flex: 1 1 120px;
  border: 0;
  border-radius: 16px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  box-shadow: 0 16px 30px rgba(47, 107, 255, 0.22);
}

.theme-switch,
.profile-theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
}

.theme-label {
  font-weight: 800;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  width: 58px;
  height: 34px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 3px;
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-thumb {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: transform 160ms ease;
}

.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-color: transparent;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(24px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  font-weight: 900;
}

.brand-name {
  font-weight: 900;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.nav-list button.active {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 16px 38px rgba(30, 47, 83, 0.08);
}

.panel {
  padding: 16px;
}

.panel-head,
.section-head,
.topbar,
.task-row,
.task-meta,
.card-header,
.calendar-head,
.modal-head,
.info-line,
.stat-head,
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 10px;
}

.section-title,
.panel-title {
  margin: 0;
  font-size: 1rem;
}

.panel-copy,
.helper,
.meta,
.task-description,
.activity-item small,
.calendar-caption,
.card-subtitle,
.secondary-text {
  color: var(--muted);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.topbar {
  padding: 12px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.stat-grid,
.task-grid,
.calendar-grid,
.activity-list,
.tag-list {
  display: grid;
  gap: 12px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 14px;
  border-radius: 20px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.stat-label {
  color: var(--muted);
  margin-top: 6px;
}

.content-grid {
  display: grid;
  gap: 14px;
}

.form-card {
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  gap: 10px;
}

.form-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.task-card {
  border-radius: 20px;
  padding: 14px;
  display: grid;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.task-card:hover {
  transform: translateY(-3px);
}

.task-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.task-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

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

.pill-row,
.tag-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill,
.tag-pill,
.priority-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.priority-pill.low {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.priority-pill.medium {
  background: rgba(47, 107, 255, 0.12);
  color: var(--brand);
}

.priority-pill.high {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warn);
}

.priority-pill.urgent {
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
}

.status-pill.completed {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.status-pill.todo,
.status-pill.in_progress {
  background: rgba(47, 107, 255, 0.12);
  color: var(--brand);
}

.status-pill.archived {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.tag-pill {
  background: rgba(47, 107, 255, 0.08);
  color: var(--brand);
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.calendar-panel,
.activity-panel,
.tags-panel,
.profile-panel,
.metrics-panel,
.sidebar-panel {
  padding: 14px;
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
  min-height: 88px;
  border-radius: 20px;
  padding: 10px;
}

.calendar-day.muted {
  opacity: 0.55;
}

.calendar-day strong {
  display: block;
  margin-bottom: 8px;
}

.day-dot {
  display: block;
  margin-top: auto;
  width: 100%;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item,
.tag-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child,
.tag-item:last-child {
  border-bottom: 0;
}

.detail-drawer,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(920px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 18px;
}

.modal-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
}

.stack {
  display: grid;
  gap: 10px;
}

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

.kbd {
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.85rem;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.empty-state {
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 1200px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-points,
  .form-row.two,
  .stat-grid,
  .calendar-grid,
  .tab-bar {
    grid-template-columns: 1fr;
  }

  .tab-button {
    flex: 1 1 100%;
  }

  .topbar,
  .section-head,
  .panel-head,
  .task-row,
  .card-header,
  .calendar-head,
  .modal-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
