:root {
  --bg-0: #f5f7fb;
  --bg-1: #e9eef8;
  --surface: #ffffff;
  --surface-strong: #f8fbff;
  --line: #d8e1f0;
  --line-strong: #c6d3e8;
  --text: #0f1d36;
  --text-muted: #5f718f;
  --brand: #0f62fe;
  --brand-2: #12a4a7;
  --navy: #0c1b35;
  --success: #0f8a67;
  --warn: #9b6a00;
  --danger: #b42344;
  --shadow-soft: 0 14px 32px rgba(15, 38, 76, 0.08);
  --shadow-mid: 0 22px 45px rgba(10, 28, 60, 0.14);
  --radius-lg: 1rem;
  --radius-md: 0.8rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(960px 460px at 6% -14%, rgba(15, 98, 254, 0.2), transparent 62%),
    radial-gradient(740px 320px at 94% -10%, rgba(18, 164, 167, 0.22), transparent 60%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg-0) 55%, var(--bg-1) 100%);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.page-title,
.hero-title {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 9999;
  background: #ffffff;
  color: #132d56;
  padding: 0.5rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid #b8cae5;
  box-shadow: var(--shadow-soft);
}

.skip-link:focus {
  left: 10px;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

.app-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
}

.app-glow.one {
  width: 360px;
  height: 360px;
  top: 96px;
  left: -120px;
  background: rgba(15, 98, 254, 0.24);
}

.app-glow.two {
  width: 400px;
  height: 400px;
  right: -140px;
  top: 220px;
  background: rgba(18, 164, 167, 0.2);
}

.navbar.app-nav {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: linear-gradient(120deg, rgba(9, 24, 49, 0.92), rgba(16, 40, 77, 0.9)) !important;
  backdrop-filter: blur(11px);
  border-bottom: 1px solid rgba(132, 166, 217, 0.24);
  box-shadow: 0 10px 24px rgba(7, 19, 39, 0.35);
}

.app-brand-dot {
  width: 0.75rem;
  height: 0.75rem;
  display: inline-block;
  border-radius: 999px;
  background: linear-gradient(135deg, #2fd6c2, #53a4ff);
  box-shadow: 0 0 0 5px rgba(89, 172, 255, 0.15);
  margin-right: 0.55rem;
}

.navbar-brand {
  font-size: 1.03rem;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.nav-link {
  font-size: 0.92rem;
  color: #d9e8ff;
  border-radius: 0.55rem;
  padding: 0.38rem 0.55rem !important;
  margin-right: 0.2rem;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(97, 155, 233, 0.24);
}

.nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
  background: rgba(121, 190, 255, 0.28);
}

.navbar-text {
  color: #e3edfc !important;
  font-size: 0.86rem;
  max-width: 245px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  padding-top: 1.8rem;
  padding-bottom: 2.2rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 1rem;
  padding: 0.95rem 1rem 1.7rem;
}

.app-main-inner {
  padding-top: 0.1rem;
  padding-bottom: 1rem;
}

.app-offcanvas {
  background: linear-gradient(180deg, rgba(9, 24, 49, 0.98), rgba(18, 49, 88, 0.97));
  color: #e6f1ff;
}

.app-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(127, 175, 243, 0.3);
}

.app-offcanvas .offcanvas-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.app-workspace-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1052;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0f62fe, #12a4a7);
  box-shadow: 0 14px 28px rgba(8, 31, 70, 0.34);
}

.app-workspace-fab i {
  font-size: 1.35rem;
  line-height: 1;
}

.app-workspace-fab:hover,
.app-workspace-fab:focus {
  color: #ffffff;
  background: linear-gradient(135deg, #0c54da, #0f8d90);
}

.app-sidebar {
  position: sticky;
  top: 84px;
  height: calc(100vh - 102px);
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(130, 170, 230, 0.36);
  background: linear-gradient(180deg, rgba(11, 28, 55, 0.94), rgba(16, 50, 90, 0.9));
  box-shadow: 0 20px 40px rgba(4, 16, 36, 0.35);
  padding: 0.95rem 0.78rem;
}

.sidebar-title {
  color: #d4e5ff;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  margin: 0.35rem 0.52rem 0.72rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  border-radius: 0.72rem;
  color: #ddedff;
  text-decoration: none;
  padding: 0.58rem 0.64rem;
  margin-bottom: 0.26rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 160ms ease;
}

.sidebar-link i {
  font-size: 0.95rem;
}

.sidebar-link:hover {
  color: #ffffff;
  transform: translateX(2px);
  background: rgba(110, 177, 250, 0.22);
}

.sidebar-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(84, 164, 255, 0.35), rgba(47, 215, 196, 0.24));
  box-shadow: inset 0 0 0 1px rgba(173, 215, 255, 0.45);
}

.app-footer {
  padding: 0.62rem 0;
  border-top: 1px solid #d2deef;
  background: rgba(248, 251, 255, 0.82);
  color: #607190;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
  padding: 0.55rem 0 0.35rem;
}

.footer-brand {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: #17375f;
}

.footer-heading {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #365884;
  margin-bottom: 0.2rem;
}

.footer-note {
  font-size: 0.84rem;
  color: #5f718f;
  line-height: 1.35;
}

.footer-note a {
  color: #1c5ca7;
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #d7e2f1;
  padding-top: 0.45rem;
  margin-top: 0.5rem;
}

.page-head {
  margin-bottom: 0.9rem;
}

.page-title {
  margin: 0;
  font-size: clamp(1.42rem, 1.2rem + 0.56vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0.32rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 68ch;
}

.card,
.table-responsive,
.surface-block,
.landing-card,
.aux-card,
.alert,
.list-group-item {
  border-radius: var(--radius-lg);
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-strong) 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -35% -85% -35%;
  height: 160px;
  background: radial-gradient(circle at center, rgba(81, 150, 244, 0.16), transparent 66%);
  pointer-events: none;
}

.list-group-item {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.table-responsive {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.table {
  margin-bottom: 0;
}

.table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #445f88;
  background: #edf4ff;
  border-bottom: 1px solid #c7d8ef;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table td {
  border-color: #dee8f7;
  vertical-align: middle;
  font-size: 0.9rem;
}

.table tbody tr:hover td {
  background: #f6f9ff;
}

.surface-block {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.landing-hero,
.hero-panel {
  border-radius: 1.2rem;
  border: 1px solid rgba(117, 167, 231, 0.4);
  color: #edf4ff;
  background:
    linear-gradient(120deg, rgba(9, 26, 52, 0.88), rgba(18, 65, 121, 0.74)),
    url("/static/img/hero-invest.svg") center/cover no-repeat;
  box-shadow: var(--shadow-mid);
}

.landing-hero {
  min-height: 400px;
  padding: 2.2rem;
  display: grid;
  align-content: end;
}

.hero-panel {
  min-height: 230px;
  margin-bottom: 1rem;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.hero-subtitle {
  margin: 0.42rem 0 0;
  color: #d8e9ff;
  font-size: 0.92rem;
}

.landing-section {
  margin-top: 1.06rem;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.landing-card {
  border: 1px solid var(--line);
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%);
  box-shadow: var(--shadow-soft);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.timeline-item {
  border: 1px solid #d4e1f3;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  padding: 0.9rem;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f62fe, #12a4a7);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.faq-item {
  border: 1px solid #d5e2f4;
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 0.9rem;
}

.landing-cta {
  border: 1px solid rgba(117, 167, 231, 0.45);
  border-radius: 1rem;
  background:
    linear-gradient(120deg, rgba(9, 26, 52, 0.9), rgba(18, 65, 121, 0.76)),
    url("/static/img/hero-invest.svg") center/cover no-repeat;
  color: #eaf3ff;
  box-shadow: var(--shadow-mid);
  padding: 1.3rem;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.78rem;
  margin-bottom: 1rem;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  padding: 0.88rem 0.92rem;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(17, 45, 89, 0.16);
}

.kpi-label {
  margin-bottom: 0.3rem;
  color: #5d7091;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.69rem;
}

.kpi-value {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.27rem 0.56rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid #c8d7ee;
  color: #314f7b;
  background: #edf3ff;
}

.status-pill.success {
  border-color: #97ddc7;
  color: #0f6a53;
  background: #e3f9f1;
}

.status-pill.warn {
  border-color: #f0d394;
  color: #7d5b17;
  background: #fff8e7;
}

.status-pill.fail {
  border-color: #ebb4c2;
  color: #91293f;
  background: #ffeff3;
}

.form-shell {
  display: grid;
  grid-template-columns: 1.35fr 0.92fr;
  gap: 0.9rem;
}

.aux-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #eef5ff 100%);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.aux-title {
  color: #385883;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.44rem;
}

.aux-list {
  margin: 0;
  padding-left: 1.02rem;
  color: #4f6386;
  font-size: 0.89rem;
}

.aux-list li {
  margin-bottom: 0.35rem;
}

.auth-shell {
  max-width: 580px;
  margin: 0 auto;
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  margin-right: 0.44rem;
  background: linear-gradient(135deg, #e0edff, #d6f4f1);
  color: #204f89;
}

.inline-input {
  width: 180px;
}

.action-group {
  display: inline-flex;
  gap: 0.32rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-actions {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
}

.table-actions form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed #adc4e5;
  border-radius: var(--radius-md);
  padding: 0.95rem;
  background: #f4f8ff;
  color: #5c7295;
}

.chart-wrap {
  position: relative;
  height: 320px;
}

.chart-wrap-sm {
  height: 320px;
}

.btn {
  border-radius: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-dark {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #0a4fd1, #0e8c99);
}

.btn-dark:hover,
.btn-dark:focus {
  color: #ffffff;
  background: linear-gradient(135deg, #0a44b4, #0d7580);
}

.btn-outline-dark {
  color: #214772;
  border-color: #5779a6;
  background: #f4f8ff;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  color: #ffffff;
  border-color: #2f5c95;
  background: #2f5c95;
}

.btn-outline-danger {
  color: #8f2940;
  border-color: #d7919f;
  background: #fff3f6;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: #ffffff;
  border-color: #b42344;
  background: #b42344;
}

.form-control,
.form-select {
  border-radius: 0.72rem;
  border: 1px solid #c8d8ef;
  background: #fcfdff;
}

.form-control:focus,
.form-select:focus {
  border-color: #76a9ec;
  box-shadow: 0 0 0 0.2rem rgba(69, 132, 216, 0.16);
}

form label {
  color: #2b4771;
  font-weight: 500;
}

pre {
  border-radius: 0.8rem;
  border: 1px solid #d4e1f4;
  background: #f4f8ff;
  padding: 1rem;
}

code {
  color: #1f548f;
}

.text-muted,
.small.text-muted {
  color: var(--text-muted) !important;
}

.badge {
  border-radius: 999px;
  padding: 0.43rem 0.66rem;
}

.alert {
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
}

.alert-success {
  border-color: #b8e9db;
  color: #0f5f4d;
  background: #e9faf4;
}

.alert-danger,
.alert-error {
  border-color: #efc0cc;
  color: #86223a;
  background: #fff1f5;
}

.alert-info {
  border-color: #c4dbf8;
  color: #214f85;
  background: #edf5ff;
}

.alert-warning {
  border-color: #f1dfb7;
  color: #7f611e;
  background: #fff8e9;
}

.reveal-item {
  animation: reveal-up 380ms ease both;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.app-glow.one,
.app-glow.two {
  animation: pulse-glow 11s ease-in-out infinite;
}

.btn:focus-visible,
.nav-link:focus-visible,
.sidebar-link:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(72, 149, 243, 0.48);
  outline-offset: 2px;
}

@media (max-width: 992px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0.78rem 0.78rem 1.2rem;
  }

  .app-sidebar {
    display: none;
  }

  .app-workspace-fab {
    display: inline-flex;
  }

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

  .form-shell {
    grid-template-columns: 1fr;
  }

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

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

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

  .hero-panel {
    min-height: 190px;
  }

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

@media (max-width: 768px) {
  .app-main {
    padding-top: 1.2rem;
    padding-bottom: 1.4rem;
    padding-bottom: 5rem;
  }

  .landing-hero {
    min-height: 320px;
    padding: 1.4rem;
  }

  .navbar-text {
    max-width: 170px;
  }

  .inline-input {
    width: 100%;
  }

  .action-group,
  .table-actions {
    width: 100%;
    justify-items: stretch;
  }

  .action-group form,
  .table-actions form {
    width: 100%;
    justify-content: stretch;
  }

  .d-flex.gap-2.flex-wrap > .btn {
    flex: 1 1 auto;
  }

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

  .chart-wrap,
  .chart-wrap-sm {
    height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
