:root {
  --bg: #0b1120;
  --surface: #111a2e;
  --surface-alt: #17233c;
  --border: #253456;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: radial-gradient(circle at top right, #172554 0%, var(--bg) 52%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.status-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.badge-sandbox {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.badge-live {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.badge-neutral {
  background: var(--surface);
  color: var(--text-muted);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 18px;
  background: rgba(17, 26, 46, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.step.active {
  color: #fff;
}

.step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
}

.step.done {
  color: #34d399;
}

.step.done .step-num {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 720px;
  margin: 0 auto;
}

.card-header p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
}

input[type="text"],
input[type="tel"],
input[type="search"],
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

#panInput {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.input-prefix-wrap {
  display: flex;
  align-items: stretch;
}

.input-prefix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.input-prefix-wrap input {
  border-radius: 0 10px 10px 0;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
}

.consent-box input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.actions-row.space-between {
  justify-content: space-between;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #1f2e4d;
}

.btn-ghost {
  background: transparent;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.link-btn {
  background: none;
  border: 0;
  color: #60a5fa;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.sandbox-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.9rem;
}

.mono-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #fbbf24;
}

.otp-field-wrap {
  max-width: 320px;
}

#otpInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
}

.otp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.alert {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.investor-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.eyebrow {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #34d399;
  font-weight: 700;
  margin-bottom: 4px;
}

.investor-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.investor-meta strong {
  color: var(--text);
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.kpi-highlight {
  border-color: rgba(59, 130, 246, 0.65);
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.2), var(--surface));
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  margin-top: 6px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.toolbar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.muted-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input[type="search"] {
  width: 240px;
}

.filters select {
  width: auto;
  min-width: 132px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scheme-name {
  font-weight: 600;
  color: #f8fafc;
}

.amc-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.pill-cams {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.pill-kfintech {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
}

.pill-sip {
  margin-left: 6px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}

.gain-pos {
  color: #34d399;
  font-weight: 600;
}

.gain-neg {
  color: #f87171;
  font-weight: 600;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hidden {
  display: none !important;
}

.btn-sell {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-sell:hover {
  background: #dc2626;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.receipt-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.receipt-title {
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
}

.receipt-meta {
  font-size: 0.85rem;
  color: #a7f3d0;
  margin-top: 2px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.modal-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.icon-close-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.holding-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.holding-stats-strip span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.holding-stats-strip strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.redeem-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.radio-pill:has(input:checked) {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.16);
  color: #fff;
}

.radio-pill input {
  accent-color: var(--primary);
}

.preview-strip {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.preview-strip strong {
  color: #f8fafc;
}

input[type="number"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

input[type="number"]:focus {
  border-color: var(--primary);
}

#sellOtpInput,
#buyOtpInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-weight: 700;
}

.main-nav {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nav-pill {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-pill:hover {
  color: #fff;
}

.nav-pill.active {
  background: var(--primary);
  color: #fff;
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.catalog-toolbar {
  margin-bottom: 20px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.fund-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.fund-card:hover {
  border-color: rgba(59, 130, 246, 0.65);
  transform: translateY(-2px);
}

.fund-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.risk-low {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.fund-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
}

.fund-amc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.fund-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.fund-metrics span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.fund-metrics strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.fund-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fund-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.preset-btn {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn:hover {
  border-color: var(--primary);
}

.two-col-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.session-pill-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.84rem;
}

.modal-card-wide {
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .two-col-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .filters input[type="search"] {
    width: 100%;
  }
  .stepper {
    font-size: 0.8rem;
    padding: 12px;
  }
}
