:root {
  --bw-primary: #0f6cbd;
  --bw-primary-deep: #0b5ca3;
  --bw-secondary: #1e293b;
  --bw-accent: #14b8a6;
  --bw-bg: #f8fafc;
  --bw-surface: rgba(255, 255, 255, 0.92);
  --bw-surface-strong: #ffffff;
  --bw-text: #0f172a;
  --bw-muted: #64748b;
  --bw-success: #22c55e;
  --bw-warning: #f59e0b;
  --bw-error: #ef4444;
  --bw-border: rgba(15, 23, 42, 0.1);
  --bw-shadow: 0 12px 32px rgba(15, 23, 42, 0.09);
  --bw-shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.06);
  --bw-radius-lg: 16px;
  --bw-radius-md: 16px;
  --bw-radius-sm: 12px;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  overflow-x: clip;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.app-body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--bw-text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  background:
    radial-gradient(circle at top left, rgba(15, 108, 189, 0.16), transparent 34%),
    radial-gradient(circle at right 12%, rgba(20, 184, 166, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #eef4fa 100%);
}

h1,
h2,
h3,
h4,
h5,
.display-4,
.display-5,
.display-6,
.navbar-brand {
  font-family: "Inter", "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
  color: var(--bw-text);
}

p,
span,
label,
input,
select,
textarea,
button,
a,
table {
  font-family: "Inter", "Segoe UI", sans-serif;
}

.display-4 {
  font-size: clamp(2.6rem, 4vw, 3.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.15;
}

h3,
h4,
h5 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.25;
}

.small,
small,
.text-muted.small {
  font-size: 14px !important;
}

a {
  color: var(--bw-primary);
  text-decoration: none;
}

tr th,
tr td {
  border: 1px solid #e6e6e6;
}

tr th {
  background-color: #f5f5f5;
}

a:hover {
  color: var(--bw-primary-deep);
}

.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.app-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.7;
}

.app-glow-one {
  width: 420px;
  height: 420px;
  background: rgba(15, 108, 189, 0.18);
  top: -120px;
  left: -90px;
}

.app-glow-two {
  width: 320px;
  height: 320px;
  background: rgba(20, 184, 166, 0.14);
  top: 180px;
  right: -70px;
}

.app-header,
.app-main-shell,
.app-footer {
  position: relative;
  z-index: 1;
}

.app-auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.75rem;
  min-height: 100vh;
  padding: 1.25rem;
}

.app-content-shell {
  min-width: 0;
}

.app-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  min-height: calc(100vh - 2rem);
  padding: 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--bw-radius-lg);
  box-shadow: var(--bw-shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-sidebar-toggler {
  display: none;
}

.app-sidebar-close {
  display: none;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(1px);
  transition: opacity 180ms ease;
}

.app-mobile-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.2rem 0 0.35rem;
  padding: 0.45rem 0.2rem;
}

.app-mobile-brand {
  color: var(--bw-text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-mobile-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(15, 108, 189, 0.22));
}

.app-mobile-menu-toggle {
  min-height: 44px;
  min-width: 44px;
}

.app-sidebar-nav-wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 7rem);
}

.app-nav-group + .app-nav-group {
  margin-top: 1.5rem;
}

.app-sidebar-account {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.app-nav-label {
  margin: 0 0 0.75rem 0.85rem;
  color: var(--bw-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-sidebar-nav {
  gap: 0.2rem;
}

.app-sidebar-nav .nav-link {
  display: block;
  border-radius: 12px;
  padding: 0.75rem 0.9rem !important;
}

.app-sidebar-nav .nav-link:hover,
.app-sidebar-nav .nav-link:focus {
  transform: none;
}

.app-sidebar-nav .nav-link.active {
  font-weight: 700;
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.12), rgba(20, 184, 166, 0.1));
  box-shadow: inset 0 0 0 1px rgba(15, 108, 189, 0.16);
}

.app-user-card {
  margin: 0 0.85rem 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: rgba(15, 108, 189, 0.06);
  border: 1px solid rgba(15, 108, 189, 0.12);
}

.app-header {
  position: static;
  z-index: 1025;
  padding: 0.4rem 0 0;
}

.app-nav-shell {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  box-shadow: var(--bw-shadow-soft);
  padding: 0.3rem 0.75rem;
}

.app-navbar .navbar-nav {
  gap: 0.15rem;
}

.app-nav-shell .btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bw-text) !important;
  font-size: 1rem;
}

.app-brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--bw-primary-deep), var(--bw-primary));
  box-shadow: 0 10px 24px rgba(15, 108, 189, 0.3);
}

.nav-link {
  color: var(--bw-muted) !important;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  padding: 0.4rem 0.7rem !important;
  transition: background-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--bw-text) !important;
  background: rgba(15, 108, 189, 0.09);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--bw-text) !important;
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.14), rgba(20, 184, 166, 0.12));
  box-shadow: inset 0 0 0 1px rgba(15, 108, 189, 0.16);
}

.container {
  max-width: 1240px;
}

.app-main-shell {
  padding-top: 2.35rem;
  padding-bottom: 3.5rem;
}

.app-auth-shell .app-main-shell {
  padding-top: 0.5rem;
}

.footer {
  margin-top: 2rem;
}

.app-footer {
  padding: 1.35rem 0 2rem;
  color: var(--bw-muted) !important;
}

.card,
.table-responsive,
.alert,
.dropdown-menu {
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-md);
  box-shadow: var(--bw-shadow-soft);
}

.card {
  background: var(--bw-surface-strong);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.card-body,
.card-header {
  padding: 1.35rem 1.45rem;
}

.card-header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid var(--bw-border);
  font-weight: 700;
}

.card-title,
.text-muted.small,
.small {
  letter-spacing: -0.01em;
}

.display-6,
.display-5,
.display-4 {
  color: var(--bw-ink);
}

.btn {
  border-radius: var(--bw-radius-sm);
  font-weight: 700;
  min-height: 44px;
  padding: 0.72rem 1.1rem;
  border-width: 1px;
  transition: transform 240ms ease, box-shadow 240ms ease, background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}

.btn.btn-sm {
  min-height: 38px;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #0b5ca3 0%, #0f6cbd 60%, #2c88d4 100%);
  border-color: rgba(15, 108, 189, 0.44);
  box-shadow: 0 10px 24px rgba(15, 108, 189, 0.26);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background: linear-gradient(135deg, #0a518f 0%, #0d5ea8 58%, #2179c6 100%);
  box-shadow: 0 14px 28px rgba(15, 108, 189, 0.3);
}

.btn-outline-primary,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger {
  background: rgba(255, 255, 255, 0.85);
}

.btn-outline-primary {
  color: var(--bw-primary);
  border-color: rgba(15, 108, 189, 0.28);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(15, 108, 189, 0.1);
  color: var(--bw-primary-deep);
  border-color: rgba(15, 108, 189, 0.38);
}

.form-control,
.form-select,
.form-check-input,
.input-group-text {
  min-height: 44px;
}

.table-responsive {
  background: rgba(255, 255, 255, 0.78);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  border-bottom-width: 1px;
  color: var(--bw-muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table > :not(caption) > * > * {
  padding: 1rem 1.1rem;
  background: transparent;
  border-color: rgba(23, 49, 59, 0.06);
}

.table tbody tr:hover {
  background: rgba(15, 108, 189, 0.045);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 1rem;
}

.form-control,
.form-select,
.form-check-input,
.dropdown-menu {
  border-color: rgba(23, 49, 59, 0.11);
}

.form-control,
.form-select {
  min-height: 3rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
  border-color: rgba(15, 108, 189, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(15, 108, 189, 0.16);
}

.badge {
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
}

.progress {
  border-radius: 999px;
  background: rgba(23, 49, 59, 0.08);
}

.progress-bar {
  border-radius: 999px;
  font-weight: 700;
}

.alert {
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-hero {
  background: linear-gradient(135deg, rgba(12, 63, 116, 0.97), rgba(15, 108, 189, 0.93));
  color: #fff;
  border-radius: var(--bw-radius-lg);
  padding: 2.2rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.dashboard-hero .lead,
.dashboard-hero .text-muted,
.dashboard-hero .hero-meta,
.dashboard-hero .hero-stat-label {
  color: rgba(255, 255, 255, 0.78) !important;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hero-stat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--bw-radius-md);
  padding: 1rem;
}

.hero-stat-value {
  display: block;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.9rem;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-section-title h2,
.dashboard-section-title h3 {
  margin: 0;
}

.dashboard-grid .card {
  height: 100%;
}

.metric-card {
  position: relative;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 1.35rem 0.9rem 1.35rem;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 108, 189, 0.2), rgba(20, 184, 166, 0.7));
}

.metric-label {
  color: var(--bw-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 800;
}

.metric-value {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 700;
  margin: 0.45rem 0 0.2rem;
}

.metric-subtext {
  color: var(--bw-muted);
  font-size: 0.92rem;
}

.section-panel {
  padding: 1.4rem;
}

.surface-note {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-radius: 1.25rem;
}

.list-group-item {
  border-color: rgba(23, 49, 59, 0.06);
  background: transparent;
}

.dropdown-menu {
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.92);
}

.dropdown-item {
  border-radius: 0.8rem;
  font-weight: 600;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(15, 108, 189, 0.09);
}

.text-muted {
  color: var(--bw-muted) !important;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bw-muted);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

@media (max-width: 991.98px) {
  .app-auth-shell {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0.7rem;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    width: min(84vw, 340px);
    min-height: 100vh;
    border-radius: 0 1.3rem 1.3rem 0;
    transform: translateX(-105%);
    transition: transform 210ms ease;
    z-index: 1035;
    overflow-y: auto;
  }

  .app-sidebar-head {
    margin-bottom: 0.8rem;
  }

  .app-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
  }

  .app-sidebar-nav-wrap {
    min-height: auto;
    padding-top: 1rem;
  }

  .app-mobile-toolbar {
    display: flex;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .app-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-sidebar-account {
    margin-top: 1rem;
  }

  .app-main-shell {
    padding-top: 0.35rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .app-main-shell {
    padding-top: 0.6rem;
  }

  .app-auth-shell .app-main-shell {
    padding-top: 0.25rem;
  }

  .app-auth-shell {
    padding: 0.55rem;
  }

  .container,
  .container-fluid {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .dashboard-hero {
    padding: 1.4rem;
  }

  .metric-value {
    font-size: 1.7rem;
  }
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--bw-radius-lg);
  padding: 1.8rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 230, 0.86));
  border: 1px solid rgba(23, 49, 59, 0.08);
  box-shadow: var(--bw-shadow);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 140, 130, 0.16), transparent 62%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-kicker {
  color: var(--bw-primary-deep);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.assistant-layout,
.workspace-layout {
  display: grid;
  gap: 1.5rem;
}

.assistant-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr);
}

.workspace-split {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.chat-shell {
  min-height: 720px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.chat-body {
  height: 540px;
  overflow-y: auto;
  padding: 1.15rem;
  background:
    linear-gradient(180deg, rgba(246, 251, 250, 0.8), rgba(255, 255, 255, 0.95)),
    radial-gradient(circle at top right, rgba(15, 140, 130, 0.08), transparent 32%);
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(85%, 760px);
  border-radius: 1.35rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 14px 32px rgba(22, 55, 67, 0.08);
  animation: float-in 320ms ease both;
}

.message-bubble.user {
  background: linear-gradient(135deg, var(--bw-primary-deep), var(--bw-primary));
  color: #fff;
  border-bottom-right-radius: 0.45rem;
}

.message-bubble.assistant {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(23, 49, 59, 0.08);
  border-bottom-left-radius: 0.45rem;
}

.message-meta {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--bw-muted);
}

.message-bubble.user .message-meta {
  color: rgba(255, 255, 255, 0.78);
}

.message-section {
  margin-top: 0.75rem;
}

.message-section:first-child {
  margin-top: 0;
}

.message-answer {
  white-space: pre-line;
}

.message-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--bw-ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.source-list {
  display: grid;
  gap: 0.65rem;
}

.source-list.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.citation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.citation-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 2.2rem;
  justify-content: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bw-primary-deep);
  background: rgba(15, 140, 130, 0.1);
  border: 1px solid rgba(15, 140, 130, 0.2);
}

.source-drawer {
  border: 1px solid rgba(23, 49, 59, 0.1);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.42rem 0.62rem;
}

.source-drawer > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bw-ink-soft);
}

.source-detail-list {
  margin: 0.55rem 0 0;
  padding-left: 1.12rem;
  display: grid;
  gap: 0.45rem;
}

.source-detail-list li {
  display: grid;
  gap: 0.15rem;
}

.source-detail-meta {
  font-size: 0.78rem;
  color: var(--bw-muted);
}

.source-detail-meta a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.source-chip {
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
  background: rgba(15, 140, 130, 0.06);
  border: 1px solid rgba(15, 140, 130, 0.1);
}

.source-chip.compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  max-width: 100%;
}

.source-main {
  font-weight: 700;
  color: var(--bw-primary-deep);
}

.source-fragment {
  font-size: 0.75rem;
  color: var(--bw-muted);
  background: rgba(23, 49, 59, 0.05);
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
}

.source-fragment a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--bw-primary-deep);
  background: rgba(15, 140, 130, 0.12);
  border: 1px solid rgba(15, 140, 130, 0.22);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.conversation-nav .list-group-item,
.activity-stack .list-group-item {
  border: 0;
  border-bottom: 1px solid rgba(23, 49, 59, 0.06);
  padding: 1rem 1.15rem;
}

.conversation-nav .list-group-item.active {
  color: var(--bw-ink);
  background: rgba(15, 140, 130, 0.11);
}

.sidebar-section {
  animation: rise-in 300ms ease both;
}

.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.workspace-metric-card {
  padding: 1.15rem;
}

.project-highlight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(23, 49, 59, 0.06);
}

.project-highlight:last-child,
.activity-row:last-child {
  border-bottom: 0;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(23, 49, 59, 0.06);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.timeline-list {
  display: grid;
  gap: 0.85rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bw-primary-deep), var(--bw-accent));
  box-shadow: 0 0 0 6px rgba(15, 140, 130, 0.08);
}

.fade-stagger > * {
  animation: rise-in 360ms ease both;
}

.fade-stagger > *:nth-child(2) { animation-delay: 60ms; }
.fade-stagger > *:nth-child(3) { animation-delay: 120ms; }
.fade-stagger > *:nth-child(4) { animation-delay: 180ms; }
.fade-stagger > *:nth-child(5) { animation-delay: 240ms; }
.fade-stagger > *:nth-child(6) { animation-delay: 300ms; }

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1199.98px) {
  .workspace-metrics,
  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .assistant-layout,
  .workspace-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .workspace-metrics,
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .chat-shell {
    min-height: auto;
  }

  .chat-body {
    height: 460px;
    padding: 1rem;
  }

  .page-hero {
    padding: 1.35rem;
  }

  .message-bubble {
    max-width: 100%;
  }

  .table-stack-mobile thead {
    display: none;
  }

  .table-stack-mobile,
  .table-stack-mobile tbody,
  .table-stack-mobile tr,
  .table-stack-mobile td {
    display: block;
    width: 100%;
  }

  .table-stack-mobile tr {
    border: 1px solid rgba(23, 49, 59, 0.12);
    border-radius: 0.9rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.3rem 0;
  }

  .table-stack-mobile td {
    border: 0;
    padding: 0.4rem 0.8rem;
  }

  .table-stack-mobile td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bw-muted);
    font-weight: 700;
    margin-bottom: 0.2rem;
  }

  .table-stack-mobile td.text-end {
    text-align: left !important;
  }

  .table-stack-mobile td .btn + .btn {
    margin-left: 0.45rem;
  }
}

main > h1,
main > .h1,
main > .h2,
main > h2 {
  margin-bottom: 1.25rem;
}

main > hr {
  display: none;
}

main > form,
main > dl.row,
main > .table-responsive,
main > .alert,
main > .row > .col-md-8 > .card,
main > .row > .col-lg-8 > .card,
main > .row > .col-md-12 > .card,
main > .row > .col-md-6 > .card,
main > .row > .col-lg-6 > .card {
  box-shadow: var(--bw-shadow);
}

main > form {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-md);
  padding: 1.5rem;
}

main > dl.row {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius-md);
  padding: 1.4rem;
}

main > dl.row dt {
  color: var(--bw-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main > dl.row dd {
  font-weight: 600;
}

main > .alert,
.surface-alert {
  border-width: 1px;
  border-radius: 1.15rem;
  padding: 1rem 1.1rem;
}

.crud-toolbar,
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.crud-stack {
  display: grid;
  gap: 1rem;
}

.page-shell {
  display: grid;
  gap: 1.5rem;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at top left, rgba(15, 108, 189, 0.2), transparent 34%),
    radial-gradient(circle at right center, rgba(20, 184, 166, 0.12), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef4fa 100%);
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--bw-radius-lg);
  box-shadow: var(--bw-shadow);
  padding: 2rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.auth-brand-mark {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--bw-primary-deep), var(--bw-primary));
}

.marketing-hero {
  border-radius: 0 0 20px 20px;
  background: linear-gradient(130deg, #0b4e8f 0%, #0f6cbd 55%, #1a7cc7 100%);
}

.marketing-hero {
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
}

.marketing-hero::before,
.marketing-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.marketing-hero::before {
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(125, 201, 255, 0.26), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(49, 195, 182, 0.22), transparent 30%),
    linear-gradient(105deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 48%);
}

.marketing-hero::after {
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 36%, transparent 86%);
}

.marketing-hero > .container {
  position: relative;
  z-index: 1;
}

.marketing-hero .display-4 {
  font-size: clamp(2.6rem, 4.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.marketing-hero .lead {
  max-width: 64ch;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.66;
  font-size: 1.125rem;
}

.marketing-hero .page-kicker {
  color: rgba(205, 253, 248, 0.98);
  letter-spacing: 0.15em;
}

.marketing-panel {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--bw-radius-md);
  box-shadow: var(--bw-shadow-soft);
}

.marketing-panel {
  border-radius: var(--bw-radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.94));
  backdrop-filter: blur(14px);
  box-shadow: var(--bw-shadow-soft);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.marketing-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 108, 189, 0.22);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.marketing-panel .card-body {
  padding: 1.5rem;
}

#solutions,
#challenges,
#features,
#value,
#pricing,
#enquiry {
  position: relative;
}

#solutions,
#value {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

#challenges::before,
#features::before,
#pricing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 14% 0%, rgba(15, 108, 189, 0.08), transparent 34%);
}

#solutions .page-kicker,
#enquiry .page-kicker {
  letter-spacing: 0.13em;
}

#solutions h2,
#challenges h2,
#features h2,
#value h2,
#pricing h2,
#enquiry h2 {
  letter-spacing: -0.028em;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

#challenges .card-title,
#features .card-title,
#solutions .card-title,
#value .card-title,
#pricing .card-title {
  font-weight: 700;
  margin-bottom: 0.7rem;
  color: var(--bw-secondary);
}

#challenges .card-text,
#features .card-text,
#solutions .card-text,
#value li,
#pricing li,
#pricing p,
#enquiry p {
  color: #334155;
  line-height: 1.62;
}

#value ul,
#pricing ul {
  padding-left: 1.15rem;
}

#value li,
#pricing li {
  margin-bottom: 0.5rem;
}

#pricing .card-header {
  border-bottom: 1px solid rgba(22, 57, 68, 0.08);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#pricing .card-header h5 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

#pricing .col-md-4:nth-child(2) .marketing-panel {
  border-color: rgba(15, 108, 189, 0.3);
  box-shadow: 0 16px 34px rgba(15, 108, 189, 0.18);
}

#pricing .col-md-4:nth-child(2) .card-header {
  background: linear-gradient(135deg, #0b5ca3, #0f6cbd) !important;
}

#pricing .text-primary {
  color: var(--bw-primary) !important;
}

#enquiry .marketing-panel {
  border-color: rgba(15, 108, 189, 0.18);
}

.btn {
  border-radius: var(--bw-radius-sm);
  padding: 0.76rem 1.2rem;
  transition: transform 260ms ease, box-shadow 260ms ease, background-color 260ms ease, color 260ms ease, border-color 260ms ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px) scale(1.01);
}

.btn-primary {
  background: linear-gradient(135deg, #0b5ca3, #0f6cbd 58%, #2e88d3);
  box-shadow: 0 12px 28px rgba(15, 108, 189, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #0a4f8d, #0d5da6 58%, #2678c0);
  box-shadow: 0 16px 30px rgba(15, 108, 189, 0.3);
}

.btn-outline-light,
.btn-outline-primary,
.btn-outline-secondary {
  border-width: 1px;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.52);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.82);
}

.app-nav-shell {
  transition: background-color 260ms ease, box-shadow 260ms ease, border-color 260ms ease, transform 260ms ease;
}

.app-nav-shell.nav-scrolled {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 340ms ease, transform 340ms ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-on-scroll-delay-1 {
  transition-delay: 70ms;
}

.reveal-on-scroll-delay-2 {
  transition-delay: 140ms;
}

.reveal-on-scroll-delay-3 {
  transition-delay: 210ms;
}

.step-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--bw-border);
  border-radius: 1.6rem;
  box-shadow: var(--bw-shadow);
}

.step-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 108, 189, 0.08);
  color: var(--bw-primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.report-tile {
  padding: 1.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.assistant-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.4);
  transition: opacity 180ms ease;
}

@media (max-width: 991.98px) {
  .assistant-sidebar-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(90vw, 380px);
    transform: translateX(106%);
    transition: transform 210ms ease;
    z-index: 1036;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(248, 250, 252, 0.97);
    border-left: 1px solid rgba(15, 23, 42, 0.12);
  }

  body.assistant-sidebar-open .assistant-sidebar-panel {
    transform: translateX(0);
  }

  body.assistant-sidebar-open .assistant-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 575.98px) {
  .page-hero,
  .dashboard-hero,
  .card,
  .glass-panel {
    border-radius: 1rem;
  }

  .action-cluster {
    width: 100%;
  }

  .action-cluster > * {
    flex: 1 1 100%;
  }

  .marketing-hero {
    border-radius: 0 0 1.35rem 1.35rem;
  }

  .registration-shell {
    margin-top: 1rem !important;
  }
}

@media (max-width: 1199.98px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .crud-toolbar,
  .section-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 1.4rem;
    border-radius: 1.4rem;
  }

  .marketing-hero .display-4 {
    font-size: clamp(1.85rem, 7vw, 2.5rem);
    line-height: 1.15;
  }

  .marketing-hero .lead {
    font-size: 1rem;
  }

  #solutions,
  #challenges,
  #features,
  #value,
  #pricing,
  #enquiry {
    padding-top: 2.6rem !important;
    padding-bottom: 2.6rem !important;
  }

  .marketing-hero .btn,
  #pricing .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .btn.btn-lg {
    font-size: 0.94rem;
    padding: 0.68rem 0.95rem;
  }

  .marketing-hero.py-5 {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
    margin-bottom: 1.5rem !important;
  }

  .marketing-hero.mt-5 {
    margin-top: 2rem !important;
  }

  .marketing-panel .card-body {
    padding: 1rem;
  }

  #solutions .d-flex.justify-content-between > .btn,
  #enquiry .btn.btn-lg,
  #features .btn.btn-lg {
    width: 100%;
  }

  #pricing .card-header,
  #pricing .card-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}

.enhancement-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(23, 49, 59, 0.11) !important;
}

.enhancement-clause-text {
  white-space: pre-wrap;
  margin: 0;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(15, 108, 189, 0.06);
  border: 1px solid rgba(15, 108, 189, 0.16);
  font-size: 0.92rem;
}

/* Compact form-check styling for modals */
.form-check.form-check-compact .form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
}

/* Logo styling */
.app-brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(15, 108, 189, 0.26));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.app-brand-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 10px 22px rgba(15, 108, 189, 0.34));
}

.login-logo {
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(15, 108, 189, 0.28));
}