/* ── Design tokens ───────────────────────────────────── */
:root {
  --ip-blue:       #1a6ef5;
  --ip-blue-light: rgba(26, 110, 245, 0.12);
  --ip-blue-dark:  #155bd4;
  --ip-green:      #22c55e;
  --ip-red:        #ef4444;
  --ip-amber:      #f59e0b;
  --ip-sidebar-w:  220px;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
body {
  font-feature-settings: 'cv01' 1, 'cv02' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar layout ──────────────────────────────────── */
.navbar-vertical.navbar-expand-lg { width: var(--ip-sidebar-w) !important; }

@media (min-width: 992px) {
  .page-wrapper { margin-left: var(--ip-sidebar-w) !important; }
  .hamburger-btn { display: none !important; }
}

@media (max-width: 991px) {
  .navbar-vertical {
    position: fixed !important;
    top: 0; left: 0; height: 100dvh; z-index: 1050;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
  }
  .navbar-vertical.sidebar-open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.18);
  }
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.42); z-index: 1049;
  backdrop-filter: blur(2px);
  animation: backdropIn 0.22s ease;
}
.sidebar-backdrop.visible { display: block; }
@keyframes backdropIn { from { opacity: 0 } to { opacity: 1 } }

/* ── Hamburger button ────────────────────────────────── */
.hamburger-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--tblr-border-color);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--tblr-body-color);
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--tblr-bg-surface-secondary); }

/* ── Nav links ───────────────────────────────────────── */
.navbar-vertical .nav-link {
  border-radius: 8px;
  margin: 1px 8px;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-weight: 500;
  justify-content: flex-start !important;
  text-align: left;
}
.navbar-vertical .nav-link-icon { margin-right: 10px; }
.navbar-vertical .nav-link.active {
  background: var(--ip-blue-light) !important;
  color: var(--ip-blue) !important;
}
.navbar-vertical .nav-link.active .nav-link-icon { color: var(--ip-blue) !important; }

.sidebar-section-label {
  font-size: 0.685rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.38;
  padding: 12px 18px 4px;
}

/* ── Brand logo ──────────────────────────────────────── */
.brand-logo { display: block; padding: 10px 16px 6px; text-decoration: none !important; }
.brand-logo img { display: block; width: 148px; height: auto; border-radius: 10px; }
[data-bs-theme="dark"] .brand-logo img { filter: invert(1) hue-rotate(180deg); }

/* ── Upgrade banner ──────────────────────────────────── */
.upgrade-banner {
  position: relative;
  background: linear-gradient(150deg, #78350f 0%, #422006 55%, #1c1209 100%);
  border-radius: 14px;
  padding: 14px;
  color: #fef3c7;
  margin: 0 12px 16px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.upgrade-banner::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px; width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.32) 0%, rgba(251, 191, 36, 0) 70%);
  pointer-events: none;
}
.upgrade-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  margin-bottom: 10px;
}
.upgrade-bullets { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.upgrade-bullets li { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: #fef3c7; line-height: 1.2; }
.upgrade-bullet-tick {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(251, 191, 36, 0.22);
  color: #fbbf24;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.upgrade-banner-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 9px 12px; border-radius: 9px;
  border: none; background: #fbbf24; color: #422006;
  font-size: 0.8rem; font-weight: 800;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.upgrade-banner-btn:hover {
  background: #fcd34d; color: #422006; transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.45);
}

/* ── Top navbar ──────────────────────────────────────── */
.navbar-top-custom {
  height: 64px;
  border-bottom: 1px solid var(--tblr-border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
  background: var(--tblr-bg-surface);
}

/* ── Market badge ────────────────────────────────────── */
.market-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 0.8125rem; font-weight: 600;
  background: rgba(34, 197, 94, 0.12); color: #16a34a;
}
[data-bs-theme="dark"] .market-badge { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.market-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.75); } }

/* ── Theme toggle ────────────────────────────────────── */
.theme-switch {
  position: relative;
  display: inline-flex; align-items: center;
  width: 64px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface-secondary, #f1f3f5);
  cursor: pointer; padding: 0 6px;
  transition: background 0.18s, border-color 0.18s;
  flex-shrink: 0;
}
[data-bs-theme="dark"] .theme-switch { background: rgba(255, 255, 255, 0.06); }
.theme-switch-icon {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
  transition: color 0.18s;
}
.theme-switch-icon.left  { margin-right: auto; }
.theme-switch-icon.right { margin-left: auto; }
[data-bs-theme="light"] .theme-switch-icon.left  { color: #f59e0b; }
[data-bs-theme="dark"]  .theme-switch-icon.right { color: #6ea8ff; }
.theme-switch-thumb {
  position: absolute; top: 50%; left: 3px;
  transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s;
}
[data-bs-theme="dark"] .theme-switch-thumb {
  left: calc(100% - 27px);
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* ── User avatar ─────────────────────────────────────── */
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(26,110,245,0.12);
  color: var(--ip-blue);
  font-size: 0.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── KPI Cards ───────────────────────────────────────── */
.kpi-card { border-radius: 12px; animation: fadeInUp 0.45s ease both; }
.kpi-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-card:nth-child(2) { animation-delay: 0.08s; }
.kpi-card:nth-child(3) { animation-delay: 0.12s; }
.kpi-card:nth-child(4) { animation-delay: 0.16s; }
.kpi-label {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  opacity: 0.5; margin-bottom: 10px;
}
.kpi-value {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.1;
  margin-bottom: 10px;
}

/* ── Trend chips ─────────────────────────────────────── */
.trend-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.775rem; font-weight: 700;
}
.trend-chip.up   { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.trend-chip.down { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
[data-bs-theme="dark"] .trend-chip.up   { background: rgba(34,197,94,0.16); color: #4ade80; }
[data-bs-theme="dark"] .trend-chip.down { background: rgba(239,68,68,0.16); color: #f87171; }

/* ── Section helpers ─────────────────────────────────── */
.section-title { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.section-link  { font-size: 0.8125rem; color: var(--ip-blue); text-decoration: none; font-weight: 600; }
.section-link:hover { text-decoration: underline; }

.card { border-radius: 12px; }

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Chart placeholder ───────────────────────────────── */
.ip-chart-placeholder {
  min-height: 240px;
  border-radius: 12px;
  background: var(--ip-blue-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--ip-blue);
  font-weight: 600; font-size: 0.875rem;
}

/* ── Mobile fixes ────────────────────────────────────── */
@media (max-width: 575px) {
  .navbar-subtitle { display: none; }
  .navbar-greeting { font-size: 0.9375rem !important; }
}

/* ════════════════════════════════════════════════════════
   LOGIN / AUTH split-screen
════════════════════════════════════════════════════════ */
body.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--tblr-bg-surface);
}

.login-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
  position: sticky; top: 0; z-index: 1020;
}
@media (max-width: 575px) { .login-topbar { padding: 14px 18px; } }

.brand-link { display: flex; align-items: center; text-decoration: none !important; }
.brand-link img { width: 130px; height: auto; display: block; }
[data-bs-theme="dark"] .brand-link img { filter: invert(1) hue-rotate(180deg); }

.login-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}
@media (max-width: 991px) { .login-main { grid-template-columns: 1fr; } }

.login-left {
  padding: 56px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 32px;
  background: linear-gradient(165deg, var(--tblr-bg-surface) 0%, rgba(26, 110, 245, 0.04) 100%);
  position: relative; overflow: hidden;
}
[data-bs-theme="dark"] .login-left {
  background: linear-gradient(165deg, var(--tblr-bg-surface) 0%, rgba(26, 110, 245, 0.08) 100%);
}
.login-left::before {
  content: ""; position: absolute;
  top: -120px; right: -120px; width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 110, 245, 0.10) 0%, rgba(26, 110, 245, 0) 70%);
  pointer-events: none;
}
@media (max-width: 991px) { .login-left { display: none; } }

.login-h1 {
  font-size: 2.1rem; font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.15;
  margin: 0 0 10px; position: relative;
}
.login-h1 em {
  font-style: normal; color: var(--ip-blue);
  background: linear-gradient(135deg, #1a6ef5, #4a89ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-bs-theme="dark"] .login-h1 em {
  background: linear-gradient(135deg, #6ea8ff, #93b6ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub { font-size: 0.95rem; opacity: 0.7; line-height: 1.6; margin: 0 0 24px; max-width: 460px; }

.login-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.login-bullets li { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; font-weight: 600; }
.login-bullet-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(26, 110, 245, 0.12);
  color: var(--ip-blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-bs-theme="dark"] .login-bullet-icon { background: rgba(110, 168, 255, 0.16); color: #6ea8ff; }

.login-illus { margin-top: 24px; width: 100%; max-width: 480px; align-self: center; }
.login-illus svg { width: 100%; height: auto; display: block; }

.login-right { padding: 56px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 991px) { .login-right { padding: 32px 20px; } }
@media (max-width: 575px) { .login-right { padding: 24px 16px; } }

.mobile-hero { display: none; text-align: center; max-width: 420px; margin: 0 auto 18px; padding: 8px 8px 0; }
@media (max-width: 991px) { .mobile-hero { display: block; } }
.mobile-hero-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin: 0 0 6px; }
.mobile-hero-title em { font-style: normal; color: var(--ip-blue); }
[data-bs-theme="dark"] .mobile-hero-title em { color: #6ea8ff; }
.mobile-hero-sub { font-size: 0.875rem; opacity: 0.65; line-height: 1.55; margin: 0; }

.login-card {
  width: 100%; max-width: 440px;
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: 16px;
  padding: 32px 30px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.05);
}
[data-bs-theme="dark"] .login-card { box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32); }
@media (max-width: 575px) { .login-card { padding: 24px 20px; border-radius: 14px; } }

.login-card-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em; margin: 0 0 4px; }
.login-card-sub   { font-size: 0.875rem; opacity: 0.6; margin: 0 0 22px; }

.field-group { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.01em; margin-bottom: 6px;
  color: var(--tblr-body-color);
}
.field-input-wrap { position: relative; }
.field-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
  font-size: 0.9rem; font-weight: 500;
  color: var(--tblr-body-color);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input::placeholder { color: var(--tblr-body-color); opacity: 0.4; }
.field-input:focus {
  outline: none; border-color: var(--ip-blue);
  box-shadow: 0 0 0 3px rgba(26, 110, 245, 0.15);
}
.field-input.has-toggle { padding-right: 42px; }
.field-toggle-btn {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--tblr-body-color); opacity: 0.55;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.field-toggle-btn:hover { opacity: 1; background: var(--tblr-bg-surface-secondary, rgba(0,0,0,0.04)); }

.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.forgot-link { font-size: 0.825rem; font-weight: 600; color: var(--ip-blue); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; color: var(--ip-blue-dark); }
[data-bs-theme="dark"] .forgot-link { color: #6ea8ff; }

.check-row {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 0.825rem; font-weight: 600;
}
.check-box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.check-box svg { opacity: 0; transition: opacity 0.15s; color: #fff; }
.check-row.checked .check-box { background: var(--ip-blue); border-color: var(--ip-blue); }
.check-row.checked .check-box svg { opacity: 1; }

.mobile-illus { display: none; width: 100%; max-width: 320px; margin: 18px auto 8px; }
@media (max-width: 991px) { .mobile-illus { display: block; } }
.mobile-illus svg { width: 100%; height: auto; display: block; }

.btn-primary-blue {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: none; background: var(--ip-blue); color: #fff;
  font-size: 0.925rem; font-weight: 700; cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.btn-primary-blue:hover {
  background: var(--ip-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 110, 245, 0.32);
  color: #fff;
}

.login-card-footer {
  text-align: center; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--tblr-border-color);
  font-size: 0.85rem; opacity: 0.85;
}
.login-card-footer a { color: var(--ip-blue); font-weight: 700; text-decoration: none; }
.login-card-footer a:hover { text-decoration: underline; }
[data-bs-theme="dark"] .login-card-footer a { color: #6ea8ff; }

.login-footer { text-align: center; padding: 20px 16px 24px; font-size: 0.72rem; opacity: 0.45; font-weight: 500; }
.login-footer span + span { margin-left: 6px; }
.login-footer span + span::before { content: "·"; margin-right: 6px; opacity: 0.5; }

/* ── Auth messages ───────────────────────────────────── */
.auth-msg {
  padding: 10px 12px; border-radius: 10px;
  font-size: 0.825rem; font-weight: 600;
  margin-bottom: 14px;
}
.auth-msg.error  { background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239, 68, 68, 0.30); color: #b91c1c; }
.auth-msg.notice { background: rgba(34, 197, 94, 0.10); border: 1px solid rgba(34, 197, 94, 0.30); color: #15803d; }
[data-bs-theme="dark"] .auth-msg.error  { color: #fca5a5; }
[data-bs-theme="dark"] .auth-msg.notice { color: #86efac; }
