:root {
  /* Light theme (default) */
  --bg-page: #f3f4f6;
  --bg-main: #f9fafb;

  --bg-surface: #ffffff;
  --bg-surface-soft: #f9fafb;
  --bg-chip: rgba(15, 23, 42, 0.04);
  --border-subtle: rgba(209, 213, 219, 1);

  --primary: #0f766e;
  --primary-soft: rgba(15, 118, 110, 0.12);
  --primary-strong: #115e59;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --danger: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.08);

  --text-main: #111827;
  --text-muted: #4b5563;
  --text-soft: #9ca3af;
  --text-strong: #020617;

  --shadow-soft: 0 18px 35px rgba(15, 23, 42, 0.08);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --gap-main: 20px;

  /* Portfolio colours */
  --stock-nvda: #4f46e5;
  --stock-voo: #22c55e;
  --stock-msft: #0ea5e9;
  --stock-aapl: #f97316;
  --stock-tsla: #ef4444;
}

/* Dark theme overrides */
body.theme-dark {
  --bg-page: #020617;
  --bg-main: #020617;

  --bg-surface: rgba(15, 23, 42, 0.96);
  --bg-surface-soft: rgba(15, 23, 42, 0.94);
  --bg-chip: rgba(148, 163, 184, 0.12);
  --border-subtle: rgba(148, 163, 184, 0.35);

  --primary: #3b82f6;
  --primary-soft: rgba(37, 99, 235, 0.16);
  --primary-strong: #1d4ed8;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);

  --text-main: #e5e7eb;
  --text-muted: #d1d5db;
  --text-soft: #9ca3af;
  --text-strong: #f9fafb;

  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent horizontal scroll */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background: var(--bg-main);
}

/* =============== SIDEBAR =============== */

.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.04);
  padding: 16px 12px 18px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: conic-gradient(from 160deg, #22c55e, #3b82f6, #22d3ee, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-strong);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-soft);
}

.sidebar-close {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

/* Sidebar nav */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.nav-label-heading {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 8px 4px 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 90ms ease;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: var(--bg-surface-soft);
  color: var(--text-main);
}

.nav-label {
  flex: 1;
  text-align: left;
}

.nav-pill {
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.7);
  transform: translateY(-1px);
  color: var(--text-main);
}

.nav-item.active {
  background: radial-gradient(circle at top left, var(--primary-soft), var(--bg-surface-soft));
  border-color: var(--primary);
  color: var(--text-strong);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.nav-item.active .nav-icon {
  background: var(--primary);
  color: #f9fafb;
  border-color: var(--primary);
}

/* Mini investments graph in sidebar */

.sidebar-mini {
  margin-top: 10px;
  padding: 10px 9px;
  border-radius: 14px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.sidebar-mini-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.sidebar-mini-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.sidebar-mini-meta {
  font-size: 11px;
  color: var(--text-soft);
}

.sidebar-mini-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 3fr) auto;
  align-items: center;
  gap: 4px;
}

.mini-bar-label {
  font-size: 11px;
  color: var(--text-muted);
}

.mini-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-chip);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  width: calc(var(--w, 0.5) * 100%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform-origin: left;
  transform: scaleX(1);
}

.mini-bar-value {
  font-size: 11px;
  color: var(--text-soft);
}

/* Sidebar footer */

.sidebar-footer {
  margin-top: auto;
}

/* Backdrop for mobile sidebar */

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
  z-index: 25;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* =============== MAIN =============== */

.main {
  min-width: 0;
  padding: 24px 18px 32px;
  max-width: 100%;
  margin-left: 260px;
}

/* TOPBAR */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.topbar-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.menu-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.welcome-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.welcome-title {
  font-size: 22px;
  font-weight: 650;
  color: var(--text-strong);
}

.welcome-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  max-width: 520px;
}

/* Right side: grid so email lines up under search */

.topbar-right {
  display: grid;
  grid-template-columns: minmax(0, 260px) auto auto auto;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-right > .user-pill {
  grid-column: 1 / -1;
  justify-self: flex-start;
}

/* Search */

.search {
  position: relative;
  max-width: 260px;
  flex: 0 1 260px;
}

.search input[type="search"] {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: var(--bg-surface-soft);
  color: var(--text-main);
  padding: 7px 28px 7px 24px;
  font-size: 13px;
  outline: none;
}

.search input::placeholder {
  color: var(--text-soft);
}

.search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #9ca3af;
}

/* Buttons */

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  position: relative;
}

.icon-btn.notification::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  border: 2px solid var(--bg-page);
  top: 3px;
  right: 3px;
}

.circle-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-main);
}

.pill-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  color: var(--text-main);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn:hover,
.circle-btn:hover,
.icon-btn:hover {
  border-color: var(--primary);
}

/* User pill */

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
  min-width: 260px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-name {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* SECTION + SUMMARY */

.section {
  margin-bottom: 18px;
}

.section-heading {
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-soft);
}

/* SUMMARY ROW */

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: var(--gap-main);
}

.summary-card {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-card.primary {
  background: radial-gradient(circle at top left, var(--primary-soft), var(--bg-surface));
  border-color: rgba(15, 118, 110, 0.8);
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.summary-tag {
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 11px;
  color: var(--text-muted);
}

.summary-amount {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-strong);
}

.summary-change {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
}

.summary-change.positive {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.6);
}

.summary-change.negative {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.6);
}

.summary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.summary-pill {
  font-size: 11px;
  color: var(--text-soft);
}

.summary-chip {
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  background: var(--bg-chip);
  color: var(--text-muted);
}

.summary-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  margin-right: 4px;
}

/* GRID TWO */

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: var(--gap-main);
}

.panel {
  border-radius: var(--radius-xl);
  padding: 14px 16px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.panel-subtext {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary-strong);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* TABS: 30d / 90d / 1Y */

.panel-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.8);
  gap: 3px;
}

body.theme-dark .panel-tabs {
  background: rgba(15, 23, 42, 0.95);
}

.panel-tabs .tab {
  border-radius: 999px;
  border: none;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  background: transparent;
  min-width: 44px;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.1s ease;
}

.panel-tabs .tab:hover {
  background: var(--bg-chip);
  color: var(--text-main);
  transform: translateY(-1px);
}

.panel-tabs .tab.active {
  background: var(--primary);
  color: #f9fafb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
}

/* SPENDING CHART – TALLER BARS */

.spending-chart {
  margin-top: 8px;
  height: 260px;          /* taller chart */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 14px;
  align-items: flex-end;
  padding-top: 4px;
}

.bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.bar-body {
  width: 84%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 1), rgba(37, 99, 235, 1));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.32);
  transform-origin: bottom;
  transform: scaleY(0);
  min-height: 42px;       /* minimum visible height */
  transition: transform 260ms ease-out;
}

body.theme-dark .bar-body {
  box-shadow: 0 16px 32px rgba(15, 23, 42, 1);
}

.bar-body.bar-visible {
  transform: scaleY(var(--h, 0.3));  /* JS sets --h between 0.15–1 */
}

.bar-label {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-main);
}

.bar-day {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-soft);
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-soft);
  flex-wrap: wrap;
  gap: 8px;
}

.legend-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #60a5fa;
}

.legend-dot.alt {
  background: #22c55e;
}

.legend-pill {
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--bg-chip);
  color: var(--text-muted);
}

/* BILLS */

.bills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.bill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 12px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.bill-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bill-logo {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-main);
}

.bill-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bill-name {
  font-size: 12px;
  color: var(--text-main);
}

.bill-meta {
  font-size: 11px;
  color: var(--text-soft);
}

.bill-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bill-amount {
  font-size: 12px;
  color: var(--text-main);
}

.bill-status {
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 6px;
  align-self: flex-end;
}

.bill-status.due {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.8);
}

.bill-status.paid {
  background: var(--accent-soft);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.8);
}

/* TABLE WRAPPER (MOBILE-FRIENDLY) */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table-wrapper::-webkit-scrollbar {
  height: 4px;
}
.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

/* TABLES */

.accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}

.accounts-table th,
.accounts-table td {
  padding: 6px 4px;
  text-align: left;
  white-space: nowrap;
}

.accounts-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(148, 163, 184, 0.6);
}

.accounts-table tr + tr td {
  border-top: 1px solid rgba(229, 231, 235, 0.9);
}

body.theme-dark .accounts-table tr + tr td {
  border-top: 1px solid rgba(15, 23, 42, 0.95);
}

.acct-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.acct-title {
  font-size: 12px;
  color: var(--text-main);
}

.acct-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.acct-badge {
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  background: var(--bg-chip);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--text-muted);
  cursor: pointer;
}

/* TRANSACTIONS */

.transactions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
  padding-right: 3px;
}

.txn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 12px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.txn-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.txn-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 12px;
  color: var(--text-main);
}

.txn-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.txn-title {
  font-size: 12px;
  color: var(--text-main);
}

.txn-sub {
  font-size: 11px;
  color: var(--text-soft);
}

.txn-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.txn-amount {
  font-size: 12px;
}

.txn-amount.negative {
  color: var(--danger);
}

.txn-amount.positive {
  color: #166534;
}

.txn-badge {
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  align-self: flex-end;
  background: var(--bg-chip);
  color: var(--text-muted);
}

.transactions::-webkit-scrollbar {
  width: 4px;
}
.transactions::-webkit-scrollbar-track {
  background: transparent;
}
.transactions::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

/* NOTIFICATIONS PANEL */

.notifications-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
  padding-right: 3px;
  font-size: 12px;
}

.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.notif-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-title {
  color: var(--text-main);
  font-size: 12px;
}

.notif-meta {
  color: var(--text-soft);
  font-size: 11px;
}

.notif-tag {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--bg-chip);
  color: var(--text-muted);
  align-self: flex-start;
}

.notifications-list::-webkit-scrollbar {
  width: 4px;
}
.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}
.notifications-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

/* PORTFOLIO DONUT CHART */

.donut-layout {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 4px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(
    var(--stock-voo) 0deg 155deg,
    var(--stock-nvda) 155deg 240deg,
    var(--stock-msft) 240deg 290deg,
    var(--stock-aapl) 290deg 325deg,
    var(--stock-tsla) 325deg 360deg
  );
  position: relative;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.donut::before {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
}

.donut-center {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.donut-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.donut-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.donut-legend {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 12px;
  margin-top: 6px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.swatch-nvda {
  background: var(--stock-nvda);
}

.swatch-voo {
  background: var(--stock-voo);
}

.swatch-msft {
  background: var(--stock-msft);
}

.swatch-aapl {
  background: var(--stock-aapl);
}

.swatch-tsla {
  background: var(--stock-tsla);
}

.legend-name {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
}

.legend-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-left: auto;
  text-align: right;
}

/* MINI INVESTMENTS LIST */

.mini-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.mini-list-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.mini-list-item-meta {
  font-size: 11px;
  color: var(--text-soft);
}

/* SEND MONEY */

.send-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: flex-end;
  margin-top: 6px;
}

.send-form-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.send-form-row label {
  color: var(--text-soft);
}

.send-form-row input,
.send-form-row select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--bg-surface-soft);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.send-form-row input:focus,
.send-form-row select:focus {
  border-color: var(--primary);
}

.send-submit {
  margin-top: 14px;
  justify-self: flex-start;
}

.send-status {
  margin-top: 8px;
}

.send-status.success {
  color: #166534;
}

.send-status.error {
  color: var(--danger);
}

/* HOLDINGS PRICE CHANGE */

.stock-change {
  font-size: 12px;
}

.stock-change.positive {
  color: #166534;
}

.stock-change.negative {
  color: var(--danger);
}

/* RELATIONSHIP SUMMARY */

.relationship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.relationship-card {
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--bg-surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.relationship-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.relationship-metric {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
}

.relationship-note {
  font-size: 11px;
  color: var(--text-soft);
}

/* SUPPORT CARD */

.support-card {
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--primary-soft), var(--bg-surface-soft));
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 12px;
  color: var(--text-muted);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.support-card p {
  margin-bottom: 8px;
}

.support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 0;
  background: var(--primary-strong);
  color: #f9fafb;
  font-size: 11px;
  cursor: pointer;
}

/* RESPONSIVE */

@media (max-width: 920px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease-out;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 18px 12px 28px;
  }

  .sidebar-close {
    display: none; /* rely on toggle button changing to × */
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    margin-top: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .topbar-right > .user-pill {
    min-width: 0;
  }

  .summary-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .send-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .send-submit {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .welcome-title {
    font-size: 20px;
  }

  .welcome-subtitle {
    max-width: 100%;
  }

  .topbar {
    gap: 10px;
  }
}
