:root {
  --navy-950: #041a35;
  --navy-900: #05264a;
  --navy-800: #08315d;
  --navy-700: #12436f;
  --blue-600: #1e5eb8;
  --gold-500: #f2c300;
  --gold-600: #c99700;
  --silver-100: #f6f8fb;
  --silver-200: #e8edf5;
  --silver-50: #fbfcfe;
  --silver-400: #98a4b5;
  --ink: #202938;
  --muted: #667085;
  --white: #ffffff;
  --success: #147c5a;
  --chart-green: #159a6a;
  --warning: #9b6a00;
  --danger: #a93434;
  --shadow: 0 14px 34px rgba(4, 26, 53, 0.06);
  --soft-shadow: 0 8px 20px rgba(6, 35, 68, 0.045);
  --radius: 8px;
  font-family: Aptos, "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fa 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  background:
    radial-gradient(circle at 24% 0%, rgba(245, 196, 0, 0.12), transparent 24%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: var(--white);
  box-shadow: 8px 0 24px rgba(4, 26, 53, 0.12);
}

.brand-block {
  min-height: 150px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #062344, #041a35);
  color: var(--navy-900);
  overflow: hidden;
}

.brand-block img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: contain;
  object-position: center center;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  font-weight: 520;
}

.nav-item span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: rgba(245, 196, 0, 0.9);
  font-size: 12px;
  font-weight: 560;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-item.is-active span {
  background: var(--gold-500);
  color: var(--navy-950);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer p {
  margin: 0 0 4px;
  font-weight: 560;
}

.sidebar-footer small {
  color: rgba(255, 255, 255, 0.7);
}

.workspace {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 48px) 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  min-width: 0;
}

.mobile-menu {
  display: none;
}

.eyebrow,
.subtitle {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  font-size: 13px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: var(--navy-950);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 560;
  line-height: 1.16;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  color: var(--navy-900);
  font-size: 18px;
  font-weight: 560;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.icon-button,
.profile-button,
.text-button,
.primary-button,
.secondary-button,
.help-button,
.quick-actions button,
.table-like button,
.security-grid button,
.loan-list button {
  border: 0;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 560;
}

.icon-button {
  background: var(--white);
  color: var(--navy-900);
  border: 1px solid rgba(6, 35, 68, 0.08);
  box-shadow: none;
}

.profile-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(245, 196, 0, 0.75);
  background: var(--navy-900);
  color: var(--white);
}

.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(4, 26, 53, 0.94), rgba(9, 46, 89, 0.9)),
    var(--navy-900);
  color: var(--white);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  gap: 4px;
}

.hero-copy span {
  color: var(--gold-500);
  font-size: 13px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-copy strong {
  font-size: 19px;
  font-weight: 560;
}

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

.primary-button {
  background: #f3c316;
  color: var(--navy-950);
}

.primary-button:hover {
  background: #ffda35;
}

.secondary-button {
  border: 1px solid rgba(6, 35, 68, 0.12);
  background: var(--white);
  color: var(--navy-900);
}

.hero-strip .secondary-button {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.view-panel {
  display: none;
}

.view-panel.is-visible {
  display: block;
}

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

.metric-card,
.panel,
.digital-card {
  border: 1px solid rgba(6, 35, 68, 0.07);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--soft-shadow);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  color: var(--navy-950);
  font-size: 23px;
  font-weight: 560;
  letter-spacing: 0;
}

.metric-card span,
.metric-card small,
.product-list small,
.chart-legend,
.quick-actions button,
.help-button {
  font-weight: 430;
}

.product-list strong,
.quick-actions button,
.panel-title h2,
.table-like strong {
  font-weight: 560;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(340px, 1.4fr) minmax(230px, 0.8fr);
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  color: var(--navy-700);
  font-weight: 560;
}

.product-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-list span,
.quick-actions button::before {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: rgba(6, 35, 68, 0.055);
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 520;
}

.product-list strong,
.product-list small {
  display: block;
}

.product-list small {
  color: var(--muted);
}

.movement-panel canvas {
  width: 100%;
  height: 240px;
  border-radius: var(--radius);
  background:
    linear-gradient(#eef2f7 1px, transparent 1px),
    linear-gradient(90deg, #eef2f7 1px, transparent 1px);
  background-size: 100% 25%, 16.66% 100%;
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--chart-green);
}

.chart-legend strong {
  color: var(--success);
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions button {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  min-height: 48px;
  background: var(--silver-50);
  color: var(--navy-900);
  font-size: 15px;
}

.quick-actions button::before {
  content: ">";
}

.help-button {
  width: 100%;
  margin-top: 18px;
  min-height: 48px;
  background: var(--navy-900);
  color: var(--white);
  font-weight: 560;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 16px;
}

.wide-panel {
  min-width: 0;
}

.table-like {
  display: grid;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  overflow: auto;
}

.table-like > div {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--silver-200);
}

.table-like > div:first-child {
  background: var(--silver-50);
  color: var(--navy-900);
}

.table-like > div:last-child {
  border-bottom: 0;
}

.table-like button,
.security-grid button,
.loan-list button {
  background: var(--navy-900);
  color: var(--white);
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-weight: 560;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  color: var(--ink);
}

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

.feature-row div {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--silver-50);
}

.feature-row span {
  color: var(--navy-950);
  font-size: 22px;
  font-weight: 560;
}

.feature-row small,
.risk-note {
  color: var(--muted);
}

.certificate-card {
  padding: 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 196, 0, 0.16), transparent 24%),
    linear-gradient(135deg, var(--navy-900), var(--navy-950));
  color: var(--white);
}

.certificate-card > span {
  color: var(--gold-500);
  font-weight: 560;
}

.certificate-card strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 30px;
}

.certificate-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.loan-list,
.security-grid {
  display: grid;
  gap: 12px;
}

.loan-list > div,
.security-grid > div {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
}

.loan-list small {
  color: var(--muted);
}

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.steps li {
  color: var(--muted);
  font-weight: 560;
}

.steps .done {
  color: var(--success);
}

.credit-status-panel {
  display: grid;
  gap: 14px;
}

.status-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.status-heading h2 {
  margin-bottom: 6px;
}

.status-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.status-heading > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(245, 196, 0, 0.18);
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 560;
}

.credit-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.credit-progress div {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 82px;
  padding: 10px 8px;
  border: 1px solid var(--silver-200);
  border-radius: var(--radius);
  background: var(--silver-50);
  color: var(--muted);
  text-align: center;
}

.credit-progress strong {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--white);
  color: inherit;
  font-weight: 560;
}

.credit-progress .done {
  border-color: rgba(21, 132, 95, 0.2);
  background: rgba(21, 132, 95, 0.1);
  color: var(--success);
}

.credit-progress .active {
  border-color: rgba(245, 196, 0, 0.4);
  background: rgba(245, 196, 0, 0.16);
  color: var(--navy-900);
}

.pending-box {
  padding: 14px;
  border: 1px solid rgba(16, 63, 117, 0.12);
  border-radius: var(--radius);
  background: rgba(16, 63, 117, 0.05);
}

.pending-box strong {
  color: var(--navy-950);
  font-weight: 560;
}

.pending-box p {
  margin: 7px 0 12px;
  color: var(--muted);
}

.status-log {
  display: grid;
  gap: 10px;
}

.status-log div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--silver-200);
}

.status-log div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-log strong {
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 560;
}

.status-log span {
  color: var(--muted);
}

.status-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.status-timeline span {
  min-height: 44px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--silver-50);
  color: var(--muted);
  font-weight: 560;
  text-align: center;
}

.status-timeline .done {
  background: rgba(21, 132, 95, 0.12);
  color: var(--success);
}

.digital-card {
  min-height: 320px;
  padding: 22px;
  background:
    radial-gradient(circle at 90% 12%, rgba(245, 196, 0, 0.24), transparent 24%),
    linear-gradient(140deg, #08213f, #06152b 78%);
  color: var(--white);
}

.digital-card img {
  width: 120px;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.digital-card span,
.digital-card strong,
.digital-card small {
  display: block;
}

.digital-card span {
  margin-top: 58px;
  color: var(--gold-500);
  font-weight: 560;
  text-transform: uppercase;
}

.digital-card strong {
  margin-top: 12px;
  font-size: 32px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-950);
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.balances-hidden [data-money] {
  color: transparent;
  text-shadow: 0 0 12px rgba(4, 26, 53, 0.55);
  user-select: none;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .brand-block {
    min-height: 96px;
    padding: 6px;
  }

  .brand-block img {
    height: 76px;
  }

  .nav-item:not(.is-active) {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    margin: 0;
  }

  .sidebar-footer {
    display: none;
  }

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

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

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(320px, 88vw);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  .mobile-menu {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius);
    background: var(--navy-900);
    color: var(--white);
    font-weight: 560;
  }

  .workspace {
    padding: 18px 14px 28px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero-strip,
  .hero-actions {
    display: grid;
  }

  .metric-grid,
  .feature-row,
  .status-timeline,
  .credit-progress {
    grid-template-columns: 1fr;
  }

  .status-heading {
    display: grid;
  }

  .table-like > div {
    grid-template-columns: 1fr;
  }

  .loan-list > div,
  .security-grid > div {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: auto;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .panel,
  .metric-card,
  .digital-card {
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding: 14px 10px 24px;
  }

  .hero-strip {
    padding: 14px;
  }

  .hero-copy strong {
    font-size: 17px;
  }

  .icon-button,
  .profile-button,
  .text-button,
  .primary-button,
  .secondary-button,
  .help-button,
  .quick-actions button,
  .table-like button,
  .security-grid button,
  .loan-list button {
    min-height: 38px;
    padding-inline: 10px;
  }

.certificate-card strong,
.digital-card strong {
    font-size: 26px;
  }
}

h1,
h2,
.metric-card strong,
.feature-row span,
.certificate-card strong,
.digital-card strong,
.credit-progress strong,
.status-log strong {
  font-weight: 540;
  letter-spacing: 0;
}

.icon-button,
.profile-button,
.text-button,
.primary-button,
.secondary-button,
.help-button,
.quick-actions button,
.table-like button,
.security-grid button,
.loan-list button,
.nav-item {
  font-weight: 520;
}

.hero-copy strong,
.hero-copy span,
.sidebar-footer p,
.nav-item span,
.status-timeline span,
.product-list strong,
.panel-title h2 {
  font-weight: 540;
}

.panel,
.metric-card,
.digital-card {
  background-color: rgba(255, 255, 255, 0.94);
}
