:root {
  --ink: #10224a;
  --muted: #5b6680;
  --paper: #f5f8ff;
  --white: #ffffff;
  --blue: #1f4fb2;
  --blue-dark: #163c91;
  --blue-soft: #eaf1ff;
  --orange: #ff7626;
  --orange-soft: #fff0e8;
  --line: #dce5f7;
  --green: #18875a;
  --shadow: 0 22px 70px rgba(16, 34, 74, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.portal-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
  background:
    linear-gradient(115deg, rgba(245, 248, 255, 0.96) 0%, rgba(245, 248, 255, 0.82) 56%, rgba(255, 240, 232, 0.9) 100%),
    url("assets/hero-advisory-launch.jpg") center / cover;
}

.brand-panel,
.login-card,
.panel,
.metric-grid article,
.record-card,
.upload-panel,
.fund-table,
.document-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.brand-panel {
  max-width: 760px;
  padding: clamp(24px, 5vw, 44px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.brand-lockup img,
.sidebar-logo img {
  width: min(300px, 70vw);
  max-height: 130px;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.login-copy {
  margin-top: clamp(34px, 6vw, 70px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 16px;
  font-size: 24px;
}

h4 {
  margin-bottom: 14px;
  font-size: 18px;
}

.login-copy p:last-child,
.form-note,
.panel p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.trust-list span,
.secure-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.login-card {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.email-otp-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
}

.email-otp-note strong {
  color: var(--blue);
  font-size: 14px;
}

.email-otp-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c7d5ef;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 12px 14px;
}

input:focus {
  outline: 3px solid rgba(31, 79, 178, 0.16);
  border-color: var(--blue);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(255, 118, 38, 0.24);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--blue);
}

.status-text {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-weight: 700;
}

.support-link {
  color: var(--blue);
  font-weight: 800;
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.sidebar-logo img {
  width: 180px;
  max-height: 84px;
}

.portal-nav {
  display: grid;
  gap: 8px;
}

.portal-nav button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.portal-nav button.is-active,
.portal-nav button:hover {
  border-color: #d3def5;
  background: var(--blue-soft);
  color: var(--blue);
}

.logout-button {
  margin-top: auto;
}

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

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}

.portal-header h2 {
  margin-bottom: 0;
}

.portal-section {
  display: none;
}

.portal-section.is-active {
  display: block;
}

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

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-wide {
  grid-column: span 2;
}

.admin-grid .panel p {
  margin-bottom: 16px;
}

.metric-grid article {
  padding: 20px;
  box-shadow: none;
}

.metric-grid span,
.record-card span,
.fund-row span,
.document-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 28px;
  line-height: 1.1;
}

.metric-grid small,
.record-card small,
.fund-row small,
.document-row small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel,
.upload-panel,
.fund-table {
  padding: 22px;
  box-shadow: none;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.timeline span {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

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

.record-card {
  padding: 20px;
  box-shadow: none;
}

.record-card strong {
  display: block;
  margin: 10px 0;
  font-size: 20px;
}

.record-card .amount {
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
}

.fund-table {
  display: grid;
  gap: 10px;
}

.fund-row,
.document-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(110px, 0.8fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: var(--paper);
}

.document-row {
  grid-template-columns: minmax(170px, 1fr) minmax(110px, 0.5fr) auto;
  margin-bottom: 12px;
  box-shadow: none;
}

.upload-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 24px;
  border: 2px dashed #b9c9ea;
  border-radius: 8px;
  background: var(--blue-soft);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

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

.upload-drop.compact {
  min-height: 120px;
}

.upload-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-drop span {
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  text-transform: none;
}

.upload-drop small {
  max-width: 520px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
  text-transform: none;
}

.uploaded-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.uploaded-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

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

@media (max-width: 1080px) {
  .login-view,
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .portal-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .login-view,
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .portal-header,
  .section-head,
  .timeline div,
  .uploaded-item {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-nav,
  .metric-grid,
  .record-grid,
  .admin-grid,
  .client-upload-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .admin-wide {
    grid-column: auto;
  }

  .fund-row,
  .document-row {
    grid-template-columns: 1fr;
  }

  .timeline span {
    text-align: left;
  }
}
