:root {
  color-scheme: dark;
  --bg: #020705;
  --bg-alt: #030807;
  --surface-1: #07110F;
  --surface-2: #0B1714;
  --border-dark: rgba(140, 255, 190, 0.12);
  --border-strong: rgba(140, 255, 190, 0.28);
  --neon-green: #35FF88;
  --neon-green-soft: #9AFFC8;
  --text-primary: #ECFFF5;
  --text-secondary: #94B8A7;
  --danger: #FF5C7A;
  --warning: #FFD166;
  --success: #35FF88;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-glow: 0 0 0 1px rgba(53, 255, 136, 0.14), 0 20px 70px rgba(0, 0, 0, 0.38), 0 0 44px rgba(53, 255, 136, 0.10);
  --font-system: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-system);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(53, 255, 136, 0.12), transparent 26rem),
    linear-gradient(135deg, #020705 0%, #04100D 55%, #020705 100%);
  color: var(--text-primary);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(154, 255, 200, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(154, 255, 200, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 2px solid var(--neon-green);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px clamp(16px, 5vw, 56px);
  background: rgba(2, 7, 5, 0.78);
  border-bottom: 1px solid var(--border-dark);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(53, 255, 136, 0.22), rgba(154, 255, 200, 0.04));
  box-shadow: var(--shadow-glow);
  color: var(--neon-green);
  font-size: 0.82rem;
  font-weight: 900;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.site-nav a:hover {
  color: var(--text-primary);
  background: rgba(154, 255, 200, 0.06);
}

.site-nav .nav-action {
  color: #00170A;
  background: var(--neon-green);
}

.site-nav .nav-action:hover {
  color: #00170A;
  background: var(--neon-green-soft);
}

.hero {
  width: min(1240px, calc(100% - 32px));
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  margin: 0 auto;
  padding: 40px 0 72px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--neon-green);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 10ch;
  margin: 0 0 20px;
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  line-height: 0.9;
  font-weight: 900;
}

.hero-subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2.2vw, 1.24rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 850;
  transition: transform 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #00170A;
  background: var(--neon-green);
  box-shadow: 0 0 32px rgba(53, 255, 136, 0.24);
}

.button-primary:hover {
  background: var(--neon-green-soft);
}

.button-secondary {
  color: var(--neon-green-soft);
  border-color: var(--border-strong);
  background: rgba(154, 255, 200, 0.04);
}

.dashboard-preview,
.feature-card,
.plan-card {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)), rgba(7, 17, 15, 0.78);
  box-shadow: var(--shadow-glow);
  backdrop-filter: blur(18px);
}

.dashboard-preview {
  min-height: 490px;
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 3vw, 24px);
}

.dashboard-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(2, 7, 5, 0.42), rgba(2, 7, 5, 0.86));
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
}

.preview-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.preview-topline strong {
  color: var(--text-primary);
}

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

.preview-grid article {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(3, 8, 7, 0.72);
}

.preview-grid .wide {
  grid-column: 1 / -1;
}

.preview-grid span,
.plan-card li,
.feature-card p {
  color: var(--text-secondary);
}

.preview-grid strong {
  display: block;
  margin-top: 14px;
  color: var(--text-primary);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.meter {
  height: 10px;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(148, 184, 167, 0.12);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-green-soft));
  box-shadow: 0 0 22px rgba(53, 255, 136, 0.35);
}

.meter-72 span {
  width: 72%;
}

.section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 68px 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

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

.feature-card,
.plan-card {
  padding: 22px;
}

.feature-card h3,
.plan-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  line-height: 1.55;
}

.plans {
  padding-bottom: 96px;
}

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

.plan-card {
  min-height: 260px;
}

.plan-card.featured {
  border-color: rgba(53, 255, 136, 0.42);
}

.plan-label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--neon-green);
  background: rgba(53, 255, 136, 0.08);
  font-size: 0.8rem;
  font-weight: 900;
}

.plan-price {
  display: block;
  margin: 14px 0 12px;
  color: var(--neon-green);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 950;
  line-height: 1;
}

.plan-card ul {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  padding-left: 18px;
}

.error-page {
  width: min(620px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  margin: 0 auto;
}

.error-page h1 {
  max-width: none;
  font-size: clamp(2.4rem, 8vw, 5rem);
}

.error-page p {
  color: var(--text-secondary);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .dashboard-preview {
    min-height: 420px;
  }

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

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    width: min(100% - 24px, 1240px);
    min-height: auto;
    padding: 34px 0 52px;
  }

  h1 {
    font-size: 4.2rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

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

  .section {
    width: min(100% - 24px, 1240px);
    padding: 46px 0;
  }
}

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

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    radial-gradient(circle at 85% 5%, rgba(53, 255, 136, 0.10), transparent 24rem),
    linear-gradient(135deg, #020705 0%, #04100d 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--border-dark);
  background: rgba(2, 7, 5, 0.72);
  backdrop-filter: blur(18px);
}

.app-brand {
  margin-bottom: 28px;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.side-nav a,
.icon-link,
.row-actions button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.side-nav a:hover,
.icon-link:hover,
.row-actions button:hover {
  color: var(--text-primary);
  border-color: var(--border-dark);
  background: rgba(154, 255, 200, 0.06);
}

.app-main {
  min-width: 0;
  padding: 20px clamp(16px, 3vw, 42px) 84px;
}

.app-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin: -20px calc(clamp(16px, 3vw, 42px) * -1) 26px;
  padding: 14px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--border-dark);
  background: rgba(2, 7, 5, 0.78);
  backdrop-filter: blur(18px);
}

.topbar-kicker {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.profile-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  max-width: 260px;
  height: 46px;
  max-height: 46px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.profile-switch button {
  width: auto;
  min-width: 104px;
  max-width: 124px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.profile-switch button.active {
  color: #00170a;
  background: var(--neon-green);
}

.profile-switch button:hover {
  transform: translateY(-1px);
}

.profile-switch .switch-icon,
.profile-switch svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  min-height: 18px;
  max-height: 18px;
  display: block;
  stroke: currentColor;
}

.profile-switch button span {
  display: inline-block;
  max-width: 72px;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
}

.profile-switch svg path {
  fill: currentColor;
  stroke: none;
}

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

.content-grid.narrow {
  max-width: 900px;
}

.page-title,
.panel-heading.inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.page-title h1,
.panel-heading h1,
.panel-heading h2 {
  margin: 0;
  max-width: none;
  font-size: clamp(1.65rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.panel {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 30px);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)), rgba(7, 17, 15, 0.82);
  box-shadow: var(--shadow-glow);
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading p {
  max-width: 720px;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

.dashboard-section {
  display: grid;
  gap: 14px;
}

.section-heading.compact {
  max-width: none;
  margin-bottom: 0;
}

.section-heading.compact h2 {
  font-size: clamp(1.35rem, 2.8vw, 2.2rem);
}

.dashboard-brief {
  display: flex;
  align-items: center;
  min-height: 142px;
  border-color: rgba(53, 255, 136, 0.28);
  background:
    linear-gradient(135deg, rgba(53, 255, 136, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(7, 17, 15, 0.86);
}

.dashboard-brief h2 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 4vw, 3.2rem);
  line-height: 1;
}

.dashboard-brief p {
  margin: 0;
  max-width: 920px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.55;
}

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

.metric-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.category-card,
.item-row {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
}

.metric-card {
  min-height: 124px;
  padding: 18px;
}

.metric-card.metric-featured {
  min-height: 156px;
  border-color: rgba(53, 255, 136, 0.26);
  background:
    linear-gradient(180deg, rgba(53, 255, 136, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.035);
}

.metric-card span,
.category-card span,
.item-row p,
.settings-list span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  color: var(--text-primary);
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  line-height: 1.05;
}

.metric-card.metric-featured strong {
  font-size: clamp(1.8rem, 4.4vw, 3.15rem);
}

.metric-card small {
  display: block;
  margin-top: 12px;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
}

.metric-income strong {
  color: var(--neon-green-soft);
}

.metric-expense strong,
.metric-danger strong {
  color: var(--danger);
}

.metric-warning strong {
  color: var(--warning);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text-primary);
  background: rgba(2, 7, 5, 0.78);
}

textarea {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 800;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 16px;
}

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

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

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-form {
  align-items: end;
}

.form-link {
  color: var(--neon-green);
  font-weight: 850;
}

.auth-copy,
.help-text {
  color: var(--text-secondary);
  line-height: 1.55;
}

.password-meter {
  display: block;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 750;
}

.password-meter::before {
  content: "";
  display: block;
  width: var(--strength, 18%);
  height: 7px;
  margin: 2px 0 8px;
  border-radius: 999px;
  background: var(--strength-color, rgba(255, 209, 102, 0.86));
  box-shadow: 0 0 18px rgba(53, 255, 136, 0.16);
  transition: width 160ms var(--ease), background 160ms var(--ease);
}

.settings-section {
  display: grid;
  gap: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border-dark);
  padding-top: 22px;
}

.settings-section h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}

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

.mini-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.mini-panel h3 {
  margin: 0;
}

.check-line,
.check-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-line input,
.check-grid input {
  width: 18px;
  min-height: 18px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 460px);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 5vw, 36px);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.016)), rgba(7, 17, 15, 0.86);
  box-shadow: var(--shadow-glow);
}

.auth-panel h1 {
  margin: 28px 0 22px;
  max-width: none;
  font-size: clamp(2.3rem, 8vw, 4rem);
}

.auth-alt {
  margin: 18px 0 0;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--neon-green);
  font-weight: 850;
}

.flash {
  margin-bottom: 14px;
  border: 1px solid var(--border-dark);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.flash.success { border-color: rgba(53, 255, 136, 0.28); }
.flash.error { border-color: rgba(255, 92, 122, 0.45); }
.flash.warning { border-color: rgba(255, 209, 102, 0.42); }

.responsive-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border-dark);
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--neon-green-soft);
  background: rgba(154, 255, 200, 0.06);
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.paid,
.badge.income {
  color: var(--success);
}

.badge.overdue,
.badge.expense {
  color: var(--danger);
}

.badge.pending {
  color: var(--warning);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.item-row h3 {
  margin: 8px 0 4px;
}

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

.category-card {
  display: grid;
  gap: 10px;
  min-height: 104px;
  padding: 16px;
}

.category-card strong {
  display: block;
  font-size: 1rem;
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lock-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.72rem;
  font-weight: 900;
}

.category-edit-list {
  display: grid;
  gap: 12px;
}

.category-edit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.segmented-filter {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.segmented-filter button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.segmented-filter button.active {
  color: #00170a;
  background: var(--neon-green);
}

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

.subscription-lock {
  min-height: 190px;
  display: grid;
  align-items: center;
  border-color: rgba(255, 209, 102, 0.28);
}

.payment-box textarea {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
}

.upgrade-quote {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  padding: 12px;
  color: var(--text-secondary);
  background: rgba(154, 255, 200, 0.045);
  font-size: 0.88rem;
}

.upgrade-quote strong {
  color: var(--neon-green);
}

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

.settings-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-dark);
  padding: 12px 0;
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-secondary);
  background: rgba(154, 255, 200, 0.035);
}

.bottom-nav {
  display: none;
}

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

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .metric-grid,
  .metric-grid-focus,
  .metric-grid-three,
  .metric-grid-six,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    padding: 8px;
    background: rgba(2, 7, 5, 0.88);
    backdrop-filter: blur(18px);
  }

  .bottom-nav a {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 900;
  }
}

@media (max-width: 720px) {
  .app-topbar,
  .page-title,
  .panel-heading.inline,
  .topbar-actions,
  .month-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .profile-settings-grid,
  .category-edit-card {
    grid-template-columns: 1fr;
  }

  .segmented-filter {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-filter button {
    flex: 1 0 auto;
  }

  .span-2 {
    grid-column: auto;
  }

  .metric-grid,
  .metric-grid-focus,
  .metric-grid-three,
  .metric-grid-six,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 8px 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-weight: 900;
  }
}
