:root {
  --bg: #0d0f14;
  --bg-soft: #11151c;
  --card: rgba(22, 27, 34, 0.88);
  --card-strong: #161b22;
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf2f7;
  --muted: #93a1b3;
  --accent: #00c896;
  --accent-soft: rgba(0, 200, 150, 0.14);
  --warning: #f5b942;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 200, 150, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(45, 140, 255, 0.12), transparent 28%),
    linear-gradient(160deg, #0d0f14 0%, #0a1118 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  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: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 90%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: rgba(10, 14, 20, 0.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-block strong,
h1,
h2,
h3,
h4 {
  font-family: "Syne", sans-serif;
}

.brand-block strong {
  display: block;
  font-size: 1.2rem;
}

.brand-block span {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 200, 150, 0.28), rgba(0, 200, 150, 0.08));
  color: var(--accent);
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 1px rgba(0, 200, 150, 0.22);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 15px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 200, 150, 0.22);
  transform: translateX(4px);
}

.nav-link i {
  width: 18px;
  text-align: center;
  color: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.content {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  padding: 32px;
}

.hero-bar,
.panel-header,
.card-head,
.progress-topline,
.summary-inline,
.form-actions,
.utility-actions,
.goal-values,
.challenge-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-bar {
  margin-bottom: 28px;
  padding: 24px 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-bar h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  max-width: 760px;
}

.hero-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  color: #c8fff1;
  background: rgba(0, 200, 150, 0.12);
  border: 1px solid rgba(0, 200, 150, 0.22);
  white-space: nowrap;
}

.eyebrow,
.section-label,
.metric-label,
label span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeUp 280ms ease;
}

.panel-header {
  margin-bottom: 20px;
}

.panel-header h2,
.card-head h3,
.goal-hero h3 {
  margin: 8px 0 0;
  font-size: 1.55rem;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 150, 0.12), transparent 70%);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 200, 150, 0.2);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.3);
}

.goal-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.goal-copy h3 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.goal-values {
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.goal-values div,
.challenge-values div,
.summary-inline div {
  min-width: 150px;
}

.goal-values span,
.challenge-values span,
.summary-inline span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.goal-values strong,
.challenge-values strong,
.summary-inline strong {
  font-size: 1.3rem;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 14px 0;
}

.progress-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00c896, #39f3c3);
  box-shadow: 0 0 22px rgba(0, 200, 150, 0.45);
  transition: width 1000ms cubic-bezier(0.2, 1, 0.2, 1);
}

.summary-grid,
.dashboard-grid,
.settings-grid,
.two-column {
  display: grid;
  gap: 20px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.dashboard-grid {
  grid-template-columns: 1.6fr 1fr;
}

.two-column {
  grid-template-columns: 420px minmax(0, 1fr);
}

.settings-grid {
  grid-template-columns: 1.3fr 0.9fr;
}

.metric-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.metric-card small,
.muted-text,
.list-total,
.insight-text,
.settings-note li {
  color: var(--muted);
}

.chart-card {
  min-height: 420px;
}

.insight-card {
  min-height: 200px;
}

.challenge-card {
  grid-column: 2;
}

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

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

label {
  display: grid;
  gap: 10px;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(0, 200, 150, 0.55);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

input[type="month"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

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

.btn-primary {
  color: #04140f;
  background: linear-gradient(135deg, #00c896, #61f9d0);
  box-shadow: 0 14px 34px rgba(0, 200, 150, 0.22);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger {
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.26);
}

.utility-actions,
.form-actions {
  flex-wrap: wrap;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

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

thead {
  background: rgba(255, 255, 255, 0.04);
}

th,
td {
  padding: 15px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-pill.necessario {
  color: #dbfff5;
  background: rgba(0, 200, 150, 0.12);
}

.type-pill.superfluo {
  color: #ffe7cc;
  background: rgba(245, 185, 66, 0.12);
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: rgba(0, 200, 150, 0.3);
}

.icon-btn.delete:hover {
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffd6d6;
}

.alert-banner {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
}

.alert-banner.warning {
  border-color: rgba(245, 185, 66, 0.24);
  background: rgba(245, 185, 66, 0.12);
  color: #ffe9b6;
}

.alert-banner.success {
  border-color: rgba(0, 200, 150, 0.2);
  background: rgba(0, 200, 150, 0.12);
  color: #c9fff0;
}

.utility-card .settings-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.settings-note ul {
  padding-left: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.94);
  border: 1px solid rgba(0, 200, 150, 0.2);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 40;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-row td {
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .settings-grid,
  .two-column,
  .goal-hero {
    grid-template-columns: 1fr;
  }

  .challenge-card {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 100%;
  }

  .page-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    inset: 0 0 auto;
    width: 100%;
    padding: 18px 16px;
    gap: 18px;
  }

  .sidebar-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .nav-link:hover,
  .nav-link.active {
    transform: none;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: 20px 16px 40px;
  }

  .hero-bar,
  .panel-header,
  .card-head,
  .progress-topline,
  .summary-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .summary-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .goal-values,
  .challenge-values,
  .utility-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-bar {
    padding: 20px;
  }

  .card {
    padding: 18px;
  }
}
