@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  --app-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #142033;
  --muted: #6b7586;
  --border: #e4e9f2;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

[data-bs-theme="dark"] {
  --app-bg: #10141f;
  --surface: #171d2a;
  --surface-soft: #202738;
  --text: #eef3ff;
  --muted: #9aa7bd;
  --border: #2d3547;
  --brand: #60a5fa;
  --brand-strong: #3b82f6;
  --nav-bg: rgba(23, 29, 42, 0.93);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* {
  letter-spacing: 0;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
}

.app-header {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  z-index: 1030;
}

.navbar {
  min-height: 70px;
}

.navbar-brand {
  color: var(--text);
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.navbar-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
  padding-inline: 0.8rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: var(--surface-soft);
  color: var(--text);
}

.dropdown-menu {
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-hover-bg: var(--surface-soft);
  --bs-dropdown-link-active-bg: rgba(37, 99, 235, 0.12);
  --bs-dropdown-link-active-color: var(--brand);
  margin-top: 0.55rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  font-weight: 600;
}

.nested-dropdown > .dropdown-menu {
  margin-top: 0;
  margin-left: 0.25rem;
}

.btn-icon {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.btn-icon:hover,
.profile-button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--brand);
}

.notification-dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #ef4444;
}

.notification-menu {
  width: min(92vw, 380px);
  padding: 0;
  overflow: hidden;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.notification-header strong,
.notification-header span {
  display: block;
}

.notification-header strong {
  color: var(--text);
  font-size: 0.98rem;
}

.notification-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

.notification-list {
  display: grid;
  max-height: 350px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.notification-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.notification-item.unread {
  background: rgba(37, 99, 235, 0.06);
}

.notification-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  font-size: 1.05rem;
}

.notification-item strong,
.notification-item small {
  display: block;
}

.notification-item strong {
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.notification-item small {
  color: var(--muted);
  line-height: 1.35;
}

.notification-footer {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 800;
  text-align: center;
}

.notification-footer:hover {
  color: var(--brand-strong);
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.level-two-wrap {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.level-two-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
}

.level-two-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.level-two-nav .nav-item {
  min-width: max-content;
}

.level-two-nav .nav-link {
  min-height: 38px;
  padding-inline: 0.75rem;
}

.level-two-wrap .dropdown-menu {
  margin-top: 0.35rem;
}

.submenu-collapse-toggle {
  flex: 0 0 40px;
}

.level-two-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
  scrollbar-width: thin;
}

.level-two-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: max-content;
  min-height: 38px;
  padding: 0 0.9rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.level-two-link:hover,
.level-two-link.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand);
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.35rem);
  font-weight: 850;
}

.action-button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 700;
}

.metric-card,
.panel,
.auth-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 124px;
  padding: 1rem;
}

.metric-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 8px;
  font-size: 1.35rem;
}

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

.metric-card strong {
  display: block;
  margin: 0.1rem 0;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1.15;
}

.panel {
  padding: 1.1rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel h2 {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.panel p {
  margin-bottom: 0;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: 0.75rem;
  min-height: 260px;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-soft);
}

.chart-bars span {
  min-height: 42px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #22c55e, var(--brand));
}

.activity-list {
  display: grid;
  gap: 1rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 0.45rem;
  border-radius: 50%;
}

.activity-item strong,
.activity-item small {
  display: block;
}

.table-search {
  max-width: 280px;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
}

.table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.dt-container {
  color: var(--text);
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  min-height: 38px;
  border-color: var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
}

.dt-container .dt-search label,
.dt-container .dt-length label,
.dt-container .dt-info {
  color: var(--muted);
  font-weight: 650;
}

.dt-container .page-link {
  border-color: var(--border);
  color: var(--brand);
}

.dt-container .active > .page-link,
.dt-container .page-link.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.dt-container .page-link:hover {
  background: var(--surface-soft);
  color: var(--brand-strong);
}

.account-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: thin;
}

.account-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: max-content;
  min-height: 38px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.account-tab:hover,
.account-tab.active {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand);
}

.profile-summary {
  position: relative;
  overflow: hidden;
  padding-top: 0;
  text-align: center;
}

.profile-cover {
  height: 120px;
  margin: -1.1rem -1.1rem 0;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(20, 184, 166, 0.9)),
    url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.profile-avatar {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin: -46px auto 1rem;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 850;
}

.profile-summary h2 {
  margin-bottom: 0.25rem;
  font-size: 1.35rem;
  font-weight: 850;
}

.profile-summary p {
  color: var(--muted);
}

.profile-meta {
  display: grid;
  gap: 0.65rem;
  margin: 1.25rem 0;
  text-align: left;
}

.profile-meta span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-meta i {
  color: var(--brand);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.profile-stats div {
  min-height: 78px;
  padding: 0.8rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-stats strong,
.profile-stats span {
  display: block;
}

.profile-stats strong {
  color: var(--text);
  font-size: 1.25rem;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.account-activity {
  display: grid;
  gap: 1rem;
}

.account-activity-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.75rem;
}

.account-activity-item strong,
.account-activity-item small {
  display: block;
}

.account-activity-item small {
  color: var(--muted);
}

.preference-group,
.security-list {
  display: grid;
  gap: 0.85rem;
}

.preference-item,
.preference-switch,
.security-item {
  display: grid;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.preference-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.preference-switch {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: pointer;
}

.preference-item strong,
.preference-item small,
.preference-switch strong,
.preference-switch small,
.security-item strong,
.security-item small {
  display: block;
}

.preference-item small,
.preference-switch small,
.security-item small {
  color: var(--muted);
}

.preference-control {
  width: min(220px, 36vw);
}

.preference-theme-control .btn {
  min-height: 38px;
  font-weight: 750;
}

.security-item {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.security-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  font-size: 1.1rem;
}

.auth-section {
  min-height: calc(100vh - 70px);
}

.auth-page {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  min-height: calc(100vh - 70px);
}

.auth-page .auth-shell {
  min-height: 100vh;
}

.auth-visual {
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.86), rgba(20, 184, 166, 0.86)),
    url("https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.register-visual {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.86), rgba(37, 99, 235, 0.86)),
    url("https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.forgot-visual {
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.86), rgba(14, 165, 233, 0.86)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.auth-stat {
  display: grid;
  max-width: 520px;
  gap: 0.75rem;
  color: #fff;
}

.auth-stat i {
  font-size: 3rem;
}

.auth-stat strong {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1;
}

.auth-stat span {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
}

.auth-card {
  align-self: center;
  width: min(100% - 2rem, 460px);
  margin: 2rem auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-heading {
  margin-bottom: 1.5rem;
}

.auth-heading .brand-mark {
  margin-bottom: 1rem;
}

.auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.auth-logo-image {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.auth-heading h2 {
  margin-bottom: 0.35rem;
  font-size: 1.65rem;
  font-weight: 850;
}

.auth-heading h1 {
  margin-bottom: 0.35rem;
  font-size: 1.65rem;
  font-weight: 850;
}

.auth-heading p,
.auth-switch {
  color: var(--muted);
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.form-control,
.form-select,
.input-group-text {
  min-height: 44px;
  border-color: var(--border);
  border-radius: 8px;
}

.input-group > .form-control {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.input-group > .input-group-text {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.password-toggle {
  min-width: 46px;
  border-color: var(--border);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  background: var(--surface);
  color: var(--muted);
}

.password-toggle:hover,
.password-toggle:focus {
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--surface-soft);
  color: var(--brand);
}

.auth-submit {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 800;
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
}

@media (min-width: 992px) {
  .nested-dropdown:hover > .dropdown-menu {
    display: block;
    position: absolute;
    top: 0;
    left: 100%;
  }
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    padding: 1rem 0;
  }

  .navbar-nav .nav-link {
    width: 100%;
  }

  .level-two-nav .nav-link {
    width: auto;
  }

  .nav-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 0.5rem;
  }

  .dropdown-menu {
    box-shadow: none;
  }

  .nested-dropdown > .dropdown-menu {
    margin-left: 1rem;
  }

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

  .auth-visual {
    min-height: 260px;
    place-items: end start;
  }
}

@media (max-width: 575.98px) {
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .table-search {
    max-width: none;
  }

  .preference-item,
  .preference-switch,
  .security-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .preference-control {
    width: 100%;
  }

  .preference-theme-control {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 110px;
  }

  .chart-bars {
    gap: 0.45rem;
    min-height: 210px;
    padding: 0.75rem;
  }

  .auth-card {
    width: calc(100% - 1rem);
    margin: 1rem auto;
  }
}
