:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-secondary: rgba(255, 255, 255, 0.06);
  --card: rgba(14, 23, 39, 0.72);
  --card-solid: #0e1727;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f3f7ff;
  --muted: #9db0ce;
  --accent: #7c5cff;
  --accent-2: #15d1ff;
  --accent-3: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 16px;
  --gradient: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(21, 209, 255, 0.18));
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3ff;
  --bg-secondary: rgba(122, 142, 184, 0.08);
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --card-border: rgba(10, 24, 52, 0.08);
  --text: #0d1b32;
  --muted: #5e708c;
  --accent: #5b55ff;
  --accent-2: #0ea5e9;
  --accent-3: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 60px rgba(63, 89, 145, 0.15);
  --gradient: linear-gradient(135deg, rgba(91, 85, 255, 0.18), rgba(14, 165, 233, 0.12));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.background-grid,
.background-orb {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-grid {
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 50%, transparent 82%);
}

.background-orb {
  filter: blur(80px);
  opacity: 0.35;
}

.orb-a {
  background: radial-gradient(circle, rgba(124, 92, 255, 0.8), transparent 55%);
  transform: translate(-20%, -18%);
}

.orb-b {
  background: radial-gradient(circle, rgba(21, 209, 255, 0.65), transparent 55%);
  transform: translate(50%, 20%);
}

.hidden {
  display: none !important;
}

.auth-screen,
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1450px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.auth-card,
.auth-preview {
  padding: 28px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.brand-pill.solid {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(21, 209, 255, 0.18));
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(91, 85, 255, 0.35);
}

.auth-card h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 24px 0 14px;
}

.auth-copy,
.muted-text {
  color: var(--muted);
}

.feature-row,
.quick-actions,
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.feature-row {
  margin: 24px 0 28px;
}

.mini-feature,
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text);
}

.primary-btn,
.icon-btn,
.link-btn,
.chip-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary-btn,
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  box-shadow: 0 16px 35px rgba(91, 85, 255, 0.35);
}

.primary-btn:hover,
.google-btn:hover,
.icon-btn:hover,
.chip-btn:hover {
  transform: translateY(-1px) scale(1.01);
}

.google-btn {
  width: 100%;
  background: white;
  color: #101828;
}

.link-btn {
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: left;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.auth-preview {
  display: grid;
  gap: 18px;
}

.preview-header,
.surface-title,
.fx-footer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.preview-tile,
.summary-card,
.goal-card,
.list-item {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-tile span:first-child,
.panel-icon,
.summary-card .material-symbols-rounded,
.goal-icon,
.list-item .item-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(21, 209, 255, 0.2));
  color: var(--text);
}

.preview-tile.glow,
.summary-card.primary {
  background: var(--gradient);
}

.topbar {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-brand h2,
.hero-copy h3,
.panel h3 {
  margin: 0 0 6px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
}

.profile-chip img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.hero-row,
.analytics-grid,
.workspace-grid,
.calendar-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-row {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hero-copy,
.hero-side,
.panel {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-2);
}

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

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

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  position: relative;
  overflow: hidden;
}

.summary-card strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.summary-card small {
  color: var(--muted);
}

.stats-surface {
  display: grid;
  gap: 16px;
  align-content: start;
}

.stack-card {
  display: flex;
  flex-direction: column;
}

.list-stack,
.goal-grid {
  display: grid;
  gap: 12px;
}

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

.list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.item-copy {
  display: grid;
  gap: 4px;
}

.item-copy p,
.item-copy h4,
.goal-card h4,
.preview-tile h3,
.preview-tile p,
.goal-card p {
  margin: 0;
}

.item-meta,
.goal-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.amount-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.amount-pill.positive {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-3);
}

.amount-pill.negative {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.status-pill.pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.status-pill.paid {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-3);
}

.status-pill.overdue {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.list-actions,
.goal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.soft-btn,
.ghost-btn {
  appearance: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  border: 1px solid var(--card-border);
}

.soft-btn {
  background: var(--bg-secondary);
  color: var(--text);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 92, 255, 0.6);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.select-wrap {
  position: relative;
}

.select-wrap select,
.select-wrap input {
  padding-left: 48px;
}

.select-wrap > .material-symbols-rounded {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 1;
}

.select-wrap.compact select {
  min-width: 120px;
  padding: 12px 16px 12px 44px;
}

.full-span {
  grid-column: 1 / -1;
}

.status-switch {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.status-switch input {
  width: auto;
}

.goal-card {
  display: grid;
  gap: 14px;
}

.goal-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.setup-banner,
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(10, 18, 32, 0.95);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.setup-banner {
  top: 18px;
}

.toast {
  bottom: 22px;
}

.anchor-target {
  scroll-margin-top: 100px;
}

.empty-state {
  padding: 22px;
  border-radius: 18px;
  border: 1px dashed var(--card-border);
  color: var(--muted);
  text-align: center;
}

.fc {
  --fc-border-color: rgba(255, 255, 255, 0.08);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.03);
  --fc-button-bg-color: rgba(255, 255, 255, 0.07);
  --fc-button-border-color: rgba(255, 255, 255, 0.08);
  --fc-button-hover-bg-color: rgba(255, 255, 255, 0.12);
  --fc-button-hover-border-color: rgba(255, 255, 255, 0.12);
  --fc-button-active-bg-color: rgba(124, 92, 255, 0.65);
  --fc-button-active-border-color: rgba(124, 92, 255, 0.65);
  --fc-today-bg-color: rgba(124, 92, 255, 0.08);
}

.fc .fc-toolbar-title,
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  color: var(--text);
}

.fc .fc-button {
  border-radius: 14px;
  text-transform: capitalize;
}

.fc-event {
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 6px !important;
}

.fc-event.status-paid {
  background: rgba(16, 185, 129, 0.85) !important;
}

.fc-event.status-pending {
  background: rgba(245, 158, 11, 0.85) !important;
}

.fc-event.status-overdue {
  background: rgba(239, 68, 68, 0.88) !important;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

@media (max-width: 1120px) {
  .auth-screen,
  .hero-row,
  .analytics-grid,
  .workspace-grid,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .goal-grid,
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-brand,
  .topbar-actions {
    justify-content: space-between;
  }

  .form-grid,
  .goal-grid,
  .summary-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .list-item,
  .goal-head {
    grid-template-columns: 1fr;
  }

  .list-actions,
  .goal-actions {
    justify-content: flex-start;
  }

  .profile-chip {
    width: 100%;
  }
}
