:root {
  --bg: #050608;
  --bg-soft: #0a0c10;
  --panel: #111318;
  --panel-strong: #171a21;
  --panel-soft: #1d2028;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f4f8;
  --text-strong: #ffffff;
  --muted: #96a0b1;
  --muted-2: #727b8a;
  --accent: #4d8cff;
  --accent-2: #2fd1a6;
  --accent-3: #d7a24a;
  --danger: #ff6a63;
  --positive: #89f0c9;
  --positive-text: #89f0c9;
  --negative: #ff9b95;
  --negative-text: #ff9b95;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-soft: #f1f3f5;
  --panel: #ffffff;
  --panel-strong: #f8f9fa;
  --panel-soft: #e9ecef;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --text: #212529;
  --text-strong: #000000;
  --muted: #6c757d;
  --muted-2: #495057;
  --accent: #0d6efd;
  --accent-2: #198754;
  --accent-3: #fd7e14;
  --danger: #dc3545;
  --positive: #198754;
  --positive-text: #146c43;
  --negative: #dc3545;
  --negative-text: #b02a37;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(77, 140, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(47, 209, 166, 0.08), transparent 24%),
    linear-gradient(180deg, #07080b 0%, #050608 100%);
  color: var(--text);
  font-family: "Inter", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(77, 140, 255, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(47, 209, 166, 0.04), transparent 24%),
    linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(18px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(215, 162, 74, 0.24), rgba(77, 140, 255, 0.18));
  color: #f7d487;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.brand-name,
.brand-sub {
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-name {
  font-size: 16px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.nav-item {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  transition: 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  display: block;
  color: var(--muted-2);
  transition: 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item:hover svg {
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(77, 140, 255, 0.18), rgba(77, 140, 255, 0.08));
  color: var(--text);
  border-color: rgba(77, 140, 255, 0.18);
}

.nav-item.active svg {
  color: #9fb7ff;
}

.sidebar-card {
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.promo-card {
  margin-top: auto;
}

.sidebar-card h3,
.card h3,
.footer-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.sidebar-card p,
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.promo-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #f2d58a;
  background: rgba(215, 162, 74, 0.1);
}

.ghost-btn,
.link-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  transition: 0.2s ease;
}

.ghost-btn:hover,
.link-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.link-btn {
  border: none;
  background: transparent;
  color: #9fb7ff;
  padding: 0;
}

.main-shell {
  min-width: 0;
  overflow-x: hidden;
  padding: 16px 14px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 18px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-dropdown {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(460px, 42vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  padding: 12px 0;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.primary-btn {
  border: 1px solid rgba(77, 140, 255, 0.55);
  background: linear-gradient(180deg, #4d8cff, #256be7);
  color: #fff;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(77, 140, 255, 0.18);
}

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 106, 99, 0.15);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.avatar,
.profile-photo {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffdba1, #c08c38);
  color: #111;
  font-weight: 800;
}

.avatar {
  width: 34px;
  height: 34px;
  font-size: 0.8rem;
}

.profile-photo {
  width: 84px;
  height: 84px;
  font-size: 1.15rem;
  background: radial-gradient(circle at top, #f6d58b, #8d5f1d 70%);
}

.profile-photo {
  width: 78px;
  height: 78px;
}

.user-name,
.profile-head h1 {
  font-weight: 800;
}

.user-role {
  color: var(--muted);
  font-size: 0.82rem;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-page {
  display: none;
}

.app-page.active {
  display: block;
}

.dashboard-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 12px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.dashboard-main {
  overflow: hidden;
}

.hero-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr;
  gap: 16px;
  align-items: center;
}

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

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-head h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.7rem;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 209, 166, 0.14);
  color: #8ef2cf;
  font-size: 0.82rem;
}

.meta-list {
  list-style: none;
  display: grid;
  gap: 5px;
  margin: 14px 0 0;
  padding: 0;
  color: var(--muted);
}

.meta-list li::before {
  content: "•";
  margin-right: 8px;
  color: var(--muted-2);
}

.score-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
}

.score-label,
.card-tag,
.card-foot,
.report-date {
  color: var(--muted);
  font-size: 0.86rem;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.score-number {
  font-size: 2rem;
  font-weight: 800;
}

.score-number span {
  font-size: 0.92rem;
  color: var(--muted);
}

.score-caption {
  color: #8ef2cf;
  margin-top: 3px;
}

.mini-bar {
  width: 160px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fd1a6, #4d8cff);
}

.score-gauge,
.progress-ring,
.retirement-gauge,
.cashflow-ring {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(#2fd1a6 0 215deg, #4d8cff 215deg 285deg, #f3b44a 285deg 360deg);
  position: relative;
}

.score-gauge::after,
.progress-ring::after,
.retirement-gauge::after,
.cashflow-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #11141a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.score-gauge-inner,
.progress-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-gauge-inner span {
  font-size: 1.6rem;
  font-weight: 800;
}

.score-gauge[data-score] {
  background:
    conic-gradient(#2fd1a6 0 calc(attr(data-score number) * 1%), #151924 0 100%);
}

@supports not (background: conic-gradient(red, blue)) {
  .score-gauge,
  .progress-ring,
  .retirement-gauge,
  .cashflow-ring {
    background: var(--panel-soft);
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 0;
}

.metric-card {
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-card > div:last-child {
  min-width: 0;
}

.metric-icon {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.metric-icon.green {
  background: rgba(47, 209, 166, 0.14);
  color: #89f0c9;
}

.metric-icon.red {
  background: rgba(255, 106, 99, 0.14);
  color: #ff9b95;
}

.metric-icon.blue {
  background: rgba(77, 140, 255, 0.16);
  color: #9bb9ff;
}

.metric-icon.purple {
  background: rgba(168, 102, 255, 0.16);
  color: #d0b2ff;
}

.metric-icon.amber {
  background: rgba(215, 162, 74, 0.15);
  color: #ffd88a;
}

.metric-card p,
.metric-card span {
  color: var(--muted);
  margin: 0;
}

.metric-card h2 {
  margin: 4px 0;
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.main-column,
.side-column {
  min-width: 0;
}

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

.chart-card,
.section-card,
.analysis-card,
.report-card,
.advisor-card {
  min-width: 0;
  overflow: hidden;
  padding: 16px;
}

.advisor-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.card-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.donut-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.donut-chart {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background:
    conic-gradient(
      #4d8cff 0 30%,
      #2fd1a6 30% 50%,
      #f3b44a 50% 60%,
      #a86cff 60% 75%,
      #ff6a63 75% 85%,
      #6fd7ff 85% 100%
    );
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: #10131a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

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

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend-item strong {
  color: var(--text);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.bar-chart,
.line-chart {
  height: 160px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 6px 4px 0;
}

.bar-group {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.bar-track {
  height: 118px;
  display: flex;
  align-items: end;
  gap: 8px;
  justify-content: center;
  padding-bottom: 10px;
}

.bar {
  width: 18px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(77, 140, 255, 0.95), rgba(77, 140, 255, 0.55));
  box-shadow: 0 12px 20px rgba(77, 140, 255, 0.12);
}

.bar.expense {
  background: linear-gradient(180deg, rgba(255, 106, 99, 0.95), rgba(255, 106, 99, 0.52));
}

.bar-label {
  display: block;
  margin-top: 10px;
}

.line-chart svg {
  width: 100%;
  height: 160px;
  display: block;
}

.ring-layout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.progress-ring {
  width: 112px;
  height: 112px;
  background:
    conic-gradient(#4d8cff 0 260deg, #2fd1a6 260deg 320deg, #f3b44a 320deg 360deg);
}

.progress-ring.small,
.retirement-gauge {
  width: 116px;
  height: 116px;
}

.progress-ring-inner strong {
  display: block;
  font-size: 1.7rem;
}

.progress-ring-inner span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.goal-stats {
  display: grid;
  gap: 10px;
}

.goal-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.goal-stat strong {
  color: var(--text);
}

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

.goal-card {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}

.goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.goal-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(77, 140, 255, 0.15);
  color: #9fb7ff;
  font-weight: 800;
}

.goal-name {
  margin: 0 0 6px;
  font-size: 1rem;
}

.goal-value {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 8px;
  gap: 10px;
}

.goal-value strong,
.goal-footer strong {
  overflow-wrap: anywhere;
}

.goal-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.goal-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fd1a6, #4d8cff);
}

.goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.sub-title {
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.mini-table td,
.mini-table th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
}

.mini-table th {
  color: var(--muted);
  font-weight: 600;
}

.portfolio-matrix {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.matrix-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.matrix-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 12px 0;
}
.matrix-item:first-child {
  padding-top: 0;
}
.matrix-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.matrix-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.matrix-value {
  display: block;
  font-size: 0.95rem;
}

.matrix-score {
  font-size: 1rem;
  color: var(--text);
}

.insurance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.insurance-item {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
}

.insurance-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.insurance-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.insurance-content strong {
  font-size: 0.95rem;
  color: var(--text);
}

.insurance-val {
  font-size: 0.88rem;
}

.insurance-need {
  font-size: 0.8rem;
  color: var(--muted);
}

.insurance-item.life {
  background: linear-gradient(135deg, rgba(255, 106, 99, 0.1), rgba(255, 106, 99, 0.02));
  border-color: rgba(255, 106, 99, 0.15);
}
.insurance-item.life .insurance-icon {
  background: rgba(255, 106, 99, 0.15);
  color: #ff9b95;
}
.insurance-item.life .insurance-val { color: #ff9b95; }

.insurance-item.health {
  background: linear-gradient(135deg, rgba(47, 209, 166, 0.1), rgba(47, 209, 166, 0.02));
  border-color: rgba(47, 209, 166, 0.15);
}
.insurance-item.health .insurance-icon {
  background: rgba(47, 209, 166, 0.15);
  color: #89f0c9;
}
.insurance-item.health .insurance-val { color: #89f0c9; }

.insurance-item.critical {
  background: linear-gradient(135deg, rgba(215, 162, 74, 0.1), rgba(215, 162, 74, 0.02));
  border-color: rgba(215, 162, 74, 0.15);
}
.insurance-item.critical .insurance-icon {
  background: rgba(215, 162, 74, 0.15);
  color: #ffd88a;
}
.insurance-item.critical .insurance-val { color: #ffd88a; }

.insurance-item.disability {
  background: linear-gradient(135deg, rgba(168, 102, 255, 0.1), rgba(168, 102, 255, 0.02));
  border-color: rgba(168, 102, 255, 0.15);
}
.insurance-item.disability .insurance-icon {
  background: rgba(168, 102, 255, 0.15);
  color: #d0b2ff;
}
.insurance-item.disability .insurance-val { color: #d0b2ff; }

.split-row,
.footer-tools {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.bottom-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

.cashflow-bottom {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.mini-bars {
  display: grid;
  gap: 12px;
}

.mini-bar-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 70px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.mini-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini-bar-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

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

.retirement-copy {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.retirement-copy strong {
  color: var(--text);
  font-size: 1rem;
}

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

.ai-badge {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(77, 140, 255, 0.5), rgba(47, 209, 166, 0.3));
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(77, 140, 255, 0.15);
}

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

.advisor-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.advisor-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.advisor-item h4,
.advisor-item p {
  margin: 0;
}

.advisor-item h4 {
  overflow-wrap: anywhere;
}

.advisor-item p {
  color: var(--muted);
  font-size: 0.84rem;
}

.priority {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.priority.high {
  background: rgba(255, 106, 99, 0.14);
  color: #ff9b95;
}

.priority.medium {
  background: rgba(215, 162, 74, 0.14);
  color: #ffd88a;
}

.priority.low {
  background: rgba(47, 209, 166, 0.14);
  color: #89f0c9;
}

.full-btn {
  width: 100%;
}

.report-sheet {
  margin: 12px 0;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.report-brand strong,
.report-brand span {
  display: block;
}

.report-brand span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.report-sheet h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.report-sheet ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.report-sheet li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.report-image {
  margin-top: 14px;
  height: 136px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(77, 140, 255, 0.16), rgba(47, 209, 166, 0.1)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='360' viewBox='0 0 600 360'%3E%3Crect width='600' height='360' fill='%23131820'/%3E%3Cpath d='M42 265 L170 165 L260 210 L360 120 L510 210 L558 168' fill='none' stroke='%234d8cff' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M42 300 H558' stroke='%23ffffff' stroke-opacity='0.1'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.report-card .full-btn {
  margin-top: 6px;
}

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

@media (min-width: 1700px) {
  .dashboard-board {
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 14px;
  }

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

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

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

.risk-meter {
  min-height: 145px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.risk-arc {
  width: 180px;
  height: 90px;
  border-radius: 180px 180px 0 0;
  background: conic-gradient(from 270deg, #77dd86 0 28%, #f2d54e 28% 58%, #ff6a63 58% 100%);
  position: relative;
  overflow: hidden;
}

.risk-arc::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 62px;
  border-radius: 120px 120px 0 0;
  background: #11141a;
}

.page-workspace {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.page-hero,
.page-panel {
  padding: 22px;
}

.page-hero h1 {
  margin: 0 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
}

.page-hero p,
.page-panel p {
  color: var(--muted);
  margin: 0;
}

.page-panel {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.page-tool {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.page-tool strong {
  display: block;
  margin-bottom: 6px;
}

.page-tool span {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-card {
  padding: 18px;
}

.footer-card p {
  max-width: 46ch;
}

.tab-btn {
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  box-shadow: none;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.tab-btn.active.tab-blue {
  border-color: rgba(77, 140, 255, 0.5);
  background: linear-gradient(180deg, rgba(77, 140, 255, 0.1), rgba(77, 140, 255, 0.02));
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(77, 140, 255, 0.1);
}

.tab-btn.active.tab-green {
  border-color: rgba(47, 209, 166, 0.5);
  background: linear-gradient(180deg, rgba(47, 209, 166, 0.1), rgba(47, 209, 166, 0.02));
  color: var(--accent-2);
  box-shadow: 0 4px 12px rgba(47, 209, 166, 0.1);
}

.tab-btn.active.tab-red {
  border-color: rgba(255, 106, 99, 0.5);
  background: linear-gradient(180deg, rgba(255, 106, 99, 0.1), rgba(255, 106, 99, 0.02));
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(255, 106, 99, 0.1);
}

/* Functional Pages Styles */
h2.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-strong);
}
p.section-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 24px;
  max-width: 60ch;
  line-height: 1.5;
}
.grid.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media(max-width: 768px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 16px;
  color: var(--text);
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type=number],
input[type=text],
select {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-strong);
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type=number]:focus,
input[type=text]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(77, 140, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(77, 140, 255, 0.15);
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.ledger th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 700;
}
.ledger td {
  padding: 12px 10px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.ledger tr:last-child td {
  border-bottom: none;
}
.ledger .num {
  text-align: left;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.ledger tfoot td {
  font-weight: 800;
  border-top: 2px solid var(--line-strong);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.sage, .pos { background: rgba(47, 209, 166, 0.15); color: #89f0c9; }
.badge.clay, .neg { background: rgba(255, 106, 99, 0.15); color: #ff9b95; }
.badge.brass { background: rgba(215, 162, 74, 0.15); color: #ffd88a; }

.hint {
  font-size: 0.85rem;
  color: var(--muted-2);
  margin-top: 12px;
  line-height: 1.5;
}

.icon-x {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
}
.icon-x:hover {
  color: var(--danger);
  background: rgba(255, 106, 99, 0.1);
}

.row-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Screen Size Responsiveness for smaller laptops */
@media (max-width: 1440px), (max-height: 750px) {
  html {
    font-size: 14px;
  }
  
  .card {
    padding: 14px !important;
  }
  
  input[type=number],
  input[type=text],
  select {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .main-shell {
    padding: 12px 10px 20px;
  }
  
  .ledger td, .ledger th {
    padding: 8px 8px;
    font-size: 0.85rem;
  }
  
  h2.section-title {
    font-size: 1.3rem;
  }
  
  .grid.cols-2, .grid.cols-3, .grid.cols-4 {
    gap: 12px;
  }
  
  label {
    margin-bottom: 4px;
    font-size: 0.75rem;
  }
  
  .sidebar {
    padding: 14px 10px 12px;
  }
  
  .nav-item {
    padding: 6px 8px;
    font-size: 0.82rem;
  }
}

select option {
  background: #111318;
  color: #f2f4f8;
}

/* Mobile Hamburger Menu & Overlay */
.hamburger-btn {
  display: none;
  margin-right: 12px;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 8px;
  border-radius: 4px;
}
.hamburger-btn:hover {
  background: var(--panel-soft);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.sidebar-open .mobile-overlay {
  display: block;
  opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 850px) {
  .app-shell {
    display: block;
  }
  
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--panel);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Grid Layout Fallbacks */
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .metrics {
    grid-template-columns: 1fr !important;
  }

  /* Topbar Fixes */
  .topbar {
    padding: 12px 14px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .topbar-left, .topbar-right {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .topbar-left .search-box,
  .topbar-left .client-dropdown {
    display: none !important; /* Hide on mobile to save space */
  }

  .topbar-right .primary-btn,
  .topbar-right .icon-btn[aria-label="Messages"],
  .topbar-right .icon-btn[aria-label="Notifications"] {
    display: none !important; /* Hide extra actions on mobile */
  }
  
  .topbar-right .user-chip > div:nth-child(2),
  .topbar-right .user-chip > span {
    display: none !important; /* Hide user name, role and chevron text on mobile */
  }
  
  .user-chip {
    padding: 4px;
    background: transparent;
    border: none;
  }
  
  /* Ledger table overflow handling */
  .card {
    overflow-x: auto;
  }
  
  table.ledger {
    min-width: 600px;
  }
  
  /* Dashboard specific fix */
  #dashboard-container .grid.cols-3 {
    grid-template-columns: 1fr;
  }
  
  /* Mobile Spacing & Typography Fixes */
  .main-shell {
    padding-top: 24px !important;
  }
  
  h2.section-title {
    font-size: 1.35rem;
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
  }
  
  p.section-sub {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .icon-btn {
    border-radius: 50%;
    border-color: transparent;
    background: transparent;
  }
  
  .avatar {
    width: 38px;
    height: 38px;
  }
}

/* Accordion Component for Inputs */
details.accordion {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}
details.accordion[open] {
  padding-bottom: 0;
  border-color: rgba(219, 163, 81, 0.4);
}
.accordion-header {
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-strong);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.accordion-header::-webkit-details-marker {
  display: none;
}
.accordion-header::after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform 0.3s ease;
}
details[open] .accordion-header::after {
  transform: rotate(-180deg);
}
.accordion-body {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  padding-top: 20px;
}
