:root {
  --bg: #ffffff;
  --text: #172026;
  --muted: #66727f;
  --line: #d8e0e7;
  --soft-line: #edf2f5;
  --teal: #008f8d;
  --teal-dark: #007a78;
  --teal-soft: #e4f7f5;
  --coral: #ed4b45;
  --success: #108463;
  --shadow: 0 18px 48px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-mark path:first-child {
  fill: rgba(255, 255, 255, 0.13);
}

.shell {
  min-height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(380px, 0.92fr);
}

.intro-panel,
.auth-panel,
.account-home {
  min-height: calc(100vh - 66px);
}

.intro-panel {
  padding: 48px clamp(32px, 5vw, 76px) 34px;
  border-right: 1px solid var(--line);
}

.feature-hero {
  min-height: 176px;
  padding: 26px 30px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border: 1px solid #c8e7e4;
  border-radius: 8px;
  background: #f3fbfa;
}

.feature-hero-icon {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
}

.feature-hero svg {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 10px 18px rgba(0, 143, 141, 0.16));
}

.feature-hero span,
.feature-hero strong {
  display: block;
}

.feature-hero span {
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 700;
}

.feature-hero strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1.3;
}

.benefits {
  margin-top: 30px;
}

.benefits h1 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
}

.intro-lead {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.benefits li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.benefits li span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  flex: 0 0 auto;
}

.benefits svg {
  width: 25px;
  height: 25px;
}

.benefits li div {
  display: grid;
  gap: 4px;
  padding-top: 1px;
}

.benefits li strong {
  color: #35404a;
  font-size: 16px;
}

.benefits li small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dashboard-preview {
  margin-top: 30px;
  min-height: 224px;
  display: grid;
  grid-template-columns: 154px 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dashboard-preview aside {
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dashboard-preview aside strong {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 15px;
}

.dashboard-preview aside span {
  padding: 9px 10px;
  border-radius: 6px;
}

.dashboard-preview aside .active {
  background: #d7efed;
  color: var(--teal-dark);
  font-weight: 700;
}

.preview-main {
  padding: 16px;
}

.preview-main h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

.metric-row div,
.activity-list {
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  padding: 12px;
}

.metric-row span,
.home-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-row strong,
.home-grid strong {
  color: var(--teal-dark);
  font-size: 16px;
}

.activity-list {
  margin-top: 12px;
}

.activity-list p {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 8px 0;
  color: #3b4650;
  font-size: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.activity-list p:last-child {
  border-bottom: 0;
}

.activity-list time {
  color: var(--muted);
}

.auth-panel {
  padding: 72px clamp(32px, 5.4vw, 80px);
  display: flex;
  flex-direction: column;
}

.tabs {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(2, 118px);
  gap: 18px;
  margin-bottom: 58px;
}

.tab {
  height: 54px;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: transparent;
  color: #69727c;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 750;
}

.tab.active {
  border-bottom-color: var(--teal);
  color: var(--teal);
}

.auth-form {
  width: min(100%, 540px);
  margin: 0 auto;
  display: grid;
}

.auth-form label {
  margin: 0 0 12px;
  color: #35404a;
  font-size: 16px;
  font-weight: 680;
}

.auth-form input {
  height: 58px;
  width: 100%;
  margin-bottom: 28px;
  border: 1px solid #cfd9e2;
  border-radius: 6px;
  padding: 0 18px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 143, 141, 0.13);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 56px;
}

.icon-button {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #74808a;
  cursor: pointer;
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

.message {
  min-height: 24px;
  margin: -2px 0 28px;
  color: var(--coral);
  font-size: 15px;
  font-weight: 650;
}

.message.success {
  color: var(--success);
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.primary-button {
  height: 62px;
  background: var(--teal);
  color: white;
  font-size: 22px;
  box-shadow: 0 14px 30px rgba(0, 143, 141, 0.2);
  transition: background-color 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.primary-button:active {
  transform: translateY(1px);
}

.ghost-button {
  height: 38px;
  padding: 0 16px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.account-home {
  grid-column: 1 / -1;
  padding: 72px clamp(24px, 7vw, 96px);
  background: #f7fafb;
}

.welcome-label {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 16px;
  font-weight: 750;
}

.account-home h1 {
  margin: 0 0 32px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

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

.home-grid article {
  min-height: 130px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-grid strong {
  font-size: 30px;
}

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

.ledger-subtitle {
  margin: -18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.ledger-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rate-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: -10px 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rate-row input {
  width: 92px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  margin-left: 4px;
}

.ledger-button,
.secondary-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.ledger-button {
  background: var(--teal);
  color: white;
}

.ledger-button.stock {
  background: #2563eb;
}

.ledger-button.fund {
  background: #059669;
}

.ledger-button.export {
  background: #4f46e5;
}

.ledger-button.import {
  background: #7c3aed;
}

.secondary-button {
  background: #eef3f6;
  color: #46535f;
}

.ledger-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ledger-stats article {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ledger-stats span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.ledger-stats strong {
  color: var(--text);
  font-size: 26px;
}

.positive {
  color: #108463 !important;
}

.negative {
  color: #d83b36 !important;
}

.neutral {
  color: var(--text) !important;
}

.ledger-message {
  min-height: 22px;
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 14px;
  font-weight: 700;
}

.ledger-message.success {
  color: var(--success);
}

.investment-grid {
  display: grid;
  gap: 18px;
}

.snapshot-panel {
  margin-top: 22px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.snapshot-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.snapshot-table th,
.snapshot-table td {
  padding: 10px;
  border-bottom: 1px solid var(--soft-line);
  text-align: right;
}

.snapshot-table th:first-child,
.snapshot-table td:first-child {
  text-align: left;
}

.investment-card {
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid #2563eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.investment-card.fund {
  border-top-color: #059669;
}

.investment-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  background: #fbfdfe;
  border-bottom: 1px solid var(--line);
}

.investment-card h2 {
  margin: 8px 0 4px;
  font-size: 19px;
}

.investment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.fund .account-type {
  background: #e7f8f0;
  color: #047857;
}

.card-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card-controls button,
.positions-table button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: #46535f;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.account-summary small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.account-summary strong {
  font-size: 18px;
}

.positions-wrap {
  overflow-x: auto;
}

.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.positions-table th,
.positions-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--soft-line);
  text-align: right;
  white-space: nowrap;
}

.positions-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  background: #fbfdfe;
}

.positions-table th:first-child,
.positions-table td:first-child {
  text-align: left;
}

.positions-table td:first-child span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.position-empty,
.investment-empty {
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
}

.investment-empty {
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.investment-empty h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

.investment-empty p {
  margin: 0 0 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 38, 0.42);
}

.ledger-modal {
  width: min(100%, 480px);
  display: grid;
  gap: 11px;
  padding: 24px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 28px 70px rgba(23, 32, 38, 0.24);
}

.ledger-modal h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.ledger-modal label {
  color: #35404a;
  font-size: 13px;
  font-weight: 760;
}

.ledger-modal input,
.ledger-modal select {
  width: 100%;
  height: 42px;
  border: 1px solid #cfd9e2;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

/* Refined visual system for the login and investment workspace. */
:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --text: #172b2d;
  --muted: #6a797b;
  --line: #dce5e3;
  --soft-line: #edf2f1;
  --teal: #167d79;
  --teal-dark: #0b625f;
  --teal-soft: #e2f3f0;
  --coral: #d74b45;
  --shadow: 0 10px 28px rgba(23, 43, 45, 0.07);
}

.topbar {
  height: 64px;
  padding: 0 clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
}

.brand {
  font-size: 20px;
  font-weight: 780;
}

.brand-mark {
  width: 36px;
  height: 36px;
}

.shell {
  min-height: calc(100vh - 64px);
  grid-template-columns: minmax(500px, 1.12fr) minmax(400px, 0.88fr);
}

.intro-panel,
.auth-panel,
.account-home {
  min-height: calc(100vh - 64px);
}

.intro-panel {
  padding: 48px clamp(36px, 5.8vw, 96px) 40px;
  background: #f1f7f5;
}

.feature-hero {
  min-height: 166px;
  border-color: #cfe1de;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-hero-icon {
  border-radius: 22px;
}

.feature-hero strong {
  font-size: 26px;
}

.benefits {
  margin-top: 36px;
}

.benefits h1 {
  font-size: 28px;
}

.benefits ul {
  gap: 18px;
}

.benefits li span {
  border-radius: 12px;
}

.dashboard-preview {
  margin-top: 36px;
  min-height: 214px;
  grid-template-columns: 142px 1fr;
  border-color: #d6e3e0;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(23, 43, 45, 0.1);
}

.dashboard-preview aside {
  border-right-color: var(--soft-line);
}

.dashboard-preview aside .active {
  background: var(--teal-soft);
}

.preview-main {
  padding: 20px;
}

.metric-row div,
.activity-list {
  border-color: #e4ecea;
}

.auth-panel {
  padding: 58px clamp(36px, 6vw, 96px);
  justify-content: center;
  background: var(--surface);
}

.tabs {
  align-self: stretch;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  width: min(100%, 440px);
  padding: 4px;
  margin: 0 auto 42px;
  border-radius: 8px;
  background: #f0f4f3;
}

.tab {
  height: 46px;
  border: 0;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 740;
}

.tab.active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: 0 2px 8px rgba(23, 43, 45, 0.09);
}

.auth-form {
  width: min(100%, 440px);
}

.auth-form input {
  height: 52px;
  border-radius: 7px;
}

.primary-button {
  height: 54px;
  font-size: 18px;
  box-shadow: 0 12px 24px rgba(22, 125, 121, 0.19);
}

.account-home {
  padding: 38px clamp(20px, 5vw, 80px) 64px;
  background: var(--bg);
}

.welcome-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-home h1 {
  margin-bottom: 20px;
  font-size: 32px;
  line-height: 1.15;
}

.ledger-header {
  margin-bottom: 18px;
}

.ledger-subtitle {
  margin: -8px 0 0;
}

.ledger-actions {
  gap: 8px;
}

.rate-row {
  margin: 0 0 22px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rate-row input {
  border-radius: 5px;
}

.ledger-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 13px;
}

.ledger-button:hover {
  filter: brightness(0.94);
}

.secondary-button {
  border-color: #dbe5e3;
  background: var(--surface);
}

.ledger-stats {
  gap: 12px;
  margin-bottom: 16px;
}

.ledger-stats article {
  min-height: 116px;
  padding: 18px;
  border-top: 3px solid var(--teal);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(23, 43, 45, 0.04);
}

.ledger-stats article:nth-child(2) {
  border-top-color: #2563eb;
}

.ledger-stats article:nth-child(3) {
  border-top-color: #a16207;
}

.ledger-stats article:nth-child(4) {
  border-top-color: #7c3aed;
}

.ledger-stats strong {
  font-size: 25px;
}

.snapshot-panel,
.investment-card {
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(23, 43, 45, 0.05);
}

.investment-card-header,
.positions-table th {
  background: #f7faf9;
}

.card-controls button,
.positions-table button {
  border-radius: 5px;
}

.card-controls button:hover,
.positions-table button:hover {
  border-color: #aac9c4;
  color: var(--teal-dark);
}

.positions-table tbody tr:hover {
  background: #f8fbfa;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(22, 125, 121, 0.22);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 18px;
  }

  .brand {
    font-size: 20px;
  }

  .shell {
    display: block;
  }

  .intro-panel {
    min-height: 0;
    padding: 32px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feature-hero {
    min-height: 0;
    padding: 20px;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 16px;
  }

  .feature-hero-icon {
    width: 76px;
    height: 76px;
  }

  .feature-hero svg {
    width: 48px;
    height: 48px;
  }

  .feature-hero strong {
    font-size: 20px;
  }

  .dashboard-preview {
    display: none;
  }

  .auth-panel {
    min-height: 0;
    padding: 38px 20px 56px;
  }

  .tabs {
    grid-template-columns: repeat(2, 96px);
    gap: 12px;
    margin-bottom: 34px;
  }

  .tab {
    height: 48px;
    font-size: 21px;
  }

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

  .account-home {
    padding: 32px 16px 52px;
  }

  .ledger-header {
    display: block;
  }

  .ledger-actions {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .ledger-stats,
  .account-summary,
  .field-row {
    grid-template-columns: 1fr;
  }

  .investment-card-header {
    display: block;
  }

  .card-controls {
    justify-content: flex-start;
    margin-top: 14px;
  }
}
