:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --panel: #ffffff;
  --soft: #f5f5f7;
  --accent: #0071e3;
  --accent-strong: #005bb5;
  --blue: #0071e3;
  --green: #34c759;
  --pink: #ff2d55;
  --orange: #ff9500;
  --purple: #af52de;
  --teal: #5ac8fa;
  --yellow: #ffcc00;
  --indigo: #5856d6;
  --positive: #1f7a4d;
  --warning: #9a5a00;
  --info: #665200;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(90, 200, 250, 0.22), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(255, 45, 85, 0.14), transparent 26%),
    radial-gradient(circle at 78% 78%, rgba(52, 199, 89, 0.14), transparent 30%),
    var(--soft);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
  gap: 56px;
  align-items: center;
  padding: clamp(28px, 5vw, 72px);
  animation: page-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-panel {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(3.3rem, 7vw, 6.8rem);
  line-height: 0.97;
  letter-spacing: 0;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  font-size: 1.65rem;
  letter-spacing: 0;
  font-weight: 760;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  letter-spacing: 0;
  font-weight: 760;
}

h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.intro {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.28rem;
  line-height: 1.55;
}

.feature-grid {
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.feature-grid div,
.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1), border-color 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-grid div:hover,
.integration-card:hover,
.metric-card:hover,
.data-panel:hover,
.photo-widget:hover {
  border-color: rgba(0, 113, 227, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.09);
  transform: translateY(-3px);
}

.feature-grid strong,
.feature-grid span,
.integration-card strong {
  display: block;
}

.feature-grid strong {
  margin-bottom: 6px;
}

.feature-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-card,
.section-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 500ms cubic-bezier(0.16, 1, 0.3, 1), background-color 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card {
  display: grid;
  gap: 20px;
  padding: 30px;
}

label {
  display: grid;
  gap: 8px;
  color: #333336;
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.nav-item {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  font-weight: 760;
  text-decoration: none;
  transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 113, 227, 0.22);
}

.secondary-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.nav-item:hover,
.ghost-button:hover {
  background: var(--soft);
  transform: translateY(-1px);
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.button-icon,
.mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--accent);
  font-weight: 900;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.helper-text {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 26px 22px;
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 4px;
}

.sidebar-brand span:not(.mark) {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.mark {
  background: var(--accent);
  color: #ffffff;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: var(--ink);
  padding-inline: 13px;
}

.nav-item.active {
  background: #e8f2ff;
  color: var(--accent-strong);
}

.ghost-button {
  margin-top: auto;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.content {
  min-width: 0;
  padding: clamp(22px, 3vw, 40px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  margin-inline: calc(clamp(22px, 3vw, 40px) * -1);
  padding: 12px clamp(22px, 3vw, 40px) 18px;
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: blur(18px);
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  padding: 0 13px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.ready {
  border-color: rgba(31, 122, 77, 0.25);
  background: #eaf7f0;
  color: var(--positive);
}

.status-pill.warning {
  border-color: rgba(154, 90, 0, 0.25);
  background: #fff4df;
  color: var(--warning);
}

.section-panel {
  min-height: calc(100vh - 116px);
  padding: clamp(18px, 2.4vw, 30px);
  animation: section-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.photo-settings-grid {
  grid-template-columns: 1fr;
}

.photo-settings-grid label {
  max-width: 860px;
}

.finance-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #ececf0;
  padding: 4px;
  width: fit-content;
}

.finance-tab {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 760;
  transition: background-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.finance-tab:hover,
.finance-tab.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.finance-dashboard,
.transaction-form {
  display: grid;
  gap: 16px;
}

.finance-hero {
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  background:
    radial-gradient(circle at 15% 20%, rgba(90, 200, 250, 0.46), transparent 32%),
    radial-gradient(circle at 78% 15%, rgba(255, 45, 85, 0.28), transparent 28%),
    radial-gradient(circle at 72% 85%, rgba(255, 204, 0, 0.26), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f5f5f7 100%);
  box-shadow: var(--shadow);
}

.finance-hero h4 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  font-weight: 820;
}

.finance-hero p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.goal-ring {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: end;
  background:
    radial-gradient(circle, #ffffff 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.56) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 20px 42px rgba(0, 0, 0, 0.12);
}

.goal-ring span {
  color: var(--ink);
  font-size: 2.4rem;
  font-weight: 850;
}

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

.visual-metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.metric-card,
.data-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1), border-color 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.25;
}

.metric-card::before {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 999px;
  display: block;
  margin-bottom: 14px;
  background: var(--blue);
}

.accent-blue::before { background: var(--blue); }
.accent-green::before { background: var(--green); }
.accent-pink::before { background: var(--pink); }
.accent-orange::before { background: var(--orange); }
.accent-purple::before { background: var(--purple); }
.accent-teal::before { background: var(--teal); }
.accent-yellow::before { background: var(--yellow); }
.accent-indigo::before { background: var(--indigo); }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1fr);
  gap: 14px;
}

.chart-panel canvas,
.timeline-panel canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  display: block;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 247, 0.78));
}

.timeline-panel {
  display: grid;
  gap: 16px;
}

.timeline-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(220px, 1fr);
  gap: 14px;
  align-items: end;
}

.range-control input {
  accent-color: var(--accent);
}

.finance-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
}

.finance-section summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 820;
}

.section-controls {
  max-width: 420px;
  margin: 18px 0;
}

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

.insight-panel {
  align-self: start;
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.compact-header {
  margin-bottom: 0;
}

.transaction-form {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

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

.wide-field {
  grid-column: span 2;
}

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

.integration-card {
  display: grid;
  gap: 10px;
  background: #ffffff;
  box-shadow: none;
}

.integration-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.integration-state {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-card.ready .integration-state {
  border-color: rgba(31, 122, 77, 0.25);
  background: #eaf7f0;
  color: var(--positive);
}

.integration-card.warning .integration-state {
  border-color: rgba(154, 90, 0, 0.25);
  background: #fff4df;
  color: var(--warning);
}

.integration-card.neutral .integration-state {
  border-color: rgba(102, 82, 0, 0.22);
  background: #fff9d7;
  color: var(--info);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

td {
  min-width: 120px;
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

td[contenteditable="true"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.photo-preview {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.photo-hero {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  text-align: center;
}

.photo-hero img {
  width: 100%;
  height: 460px;
  display: block;
  object-fit: cover;
}

.photo-hero p {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

.photo-widget-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.photo-widget {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background: #ffffff;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms cubic-bezier(0.16, 1, 0.3, 1), border-color 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-widget.wide {
  grid-column: span 2;
}

.photo-widget.tall {
  grid-row: span 2;
}

.photo-widget img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
}

.photo-widget.tall img {
  min-height: 420px;
}

.photo-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}

.photo-widget-footer span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-remove-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 900;
}

iframe {
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

@media (max-width: 900px) {
  .login-view,
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .login-view {
    padding: 24px;
  }

  .feature-grid,
  .integration-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .settings-grid,
  .metric-grid,
  .dashboard-grid,
  .chart-grid,
  .finance-hero,
  .transaction-grid,
  .timeline-controls,
  .photo-widget-grid,
  .topbar,
  .panel-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .goal-ring {
    justify-self: start;
    width: 150px;
    height: 150px;
  }

  .goal-ring span {
    font-size: 1.8rem;
  }

  .photo-widget.wide {
    grid-column: span 1;
  }

  .photo-widget.tall {
    grid-row: span 1;
  }

  .photo-hero img,
  .photo-widget.tall img {
    height: 280px;
    min-height: 280px;
  }

  h1 {
    font-size: 3rem;
  }
}

@media (max-width: 520px) {
  .content,
  .sidebar,
  .login-card {
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }
}

.motion-ready {
  opacity: 0;
  transform: translateY(32px) scale(0.985);
  transition: opacity 760ms cubic-bezier(0.16, 1, 0.3, 1), transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--motion-delay, 0ms);
  will-change: opacity, transform;
}

.motion-ready.motion-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feature-grid div.motion-ready.motion-visible:hover,
.integration-card.motion-ready.motion-visible:hover,
.metric-card.motion-ready.motion-visible:hover,
.data-panel.motion-ready.motion-visible:hover,
.photo-widget.motion-ready.motion-visible:hover {
  transform: translateY(-3px) scale(1);
}

@keyframes page-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes section-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .motion-ready {
    opacity: 1;
    transform: none;
  }
}
