:root {
  --pundex-navy: #102b5c;
  --pundex-navy-dark: #0b2149;
  --pundex-blue: #2563eb;
  --pundex-blue-dark: #1d4ed8;
  --app-background: #f5f7fb;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --blue-soft: #eff6ff;
  --sidebar-width: 268px;
  --sidebar-collapsed-width: 80px;
  --topbar-height: 72px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --shadow-subtle: 0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--app-background);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
}

a {
  color: var(--pundex-blue);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--pundex-blue-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
}

p,
label,
.alert,
.dropdown-item,
td,
th {
  overflow-wrap: break-word;
  word-break: normal;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  z-index: 1040;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  background: var(--pundex-navy);
  color: #ffffff;
  transition: width 180ms ease, transform 180ms ease;
}

.sidebar-brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
}

.brand-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.brand-link:hover {
  color: #ffffff;
}

.brand-mark,
.brand-logo-image {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: var(--pundex-navy);
  font-size: 1.35rem;
  font-weight: 800;
}

.brand-logo-image {
  object-fit: contain;
  padding: 5px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 3px;
  color: #bfdbfe;
  font-size: 0.72rem;
}

.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #dbeafe;
}

.sidebar-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-section-label {
  margin: 0 12px 7px;
  color: #93c5fd;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link,
.sidebar-collapse {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  background: transparent;
  color: #dbeafe;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.nav-link.is-active {
  background: #ffffff;
  color: var(--pundex-navy);
  box-shadow: 0 5px 16px rgba(3, 15, 39, 0.16);
}

.nav-link.is-active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
  content: "";
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
}

.sidebar-collapse {
  color: #bfdbfe;
}

.app-main {
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 180ms ease;
}

.app-topbar {
  position: sticky;
  z-index: 1020;
  top: 0;
  display: flex;
  min-width: 0;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  padding: 10px 28px;
}

.topbar-leading {
  display: flex;
  flex: 0 0 165px;
  min-width: 150px;
  align-items: center;
  gap: 12px;
}

.topbar-page {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.topbar-eyebrow {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-button {
  display: none;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: #475569;
  text-decoration: none;
}

.icon-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--text-primary);
}

.global-search {
  position: relative;
  width: min(420px, 38vw);
  margin-right: auto;
}

.global-search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  color: #94a3b8;
  pointer-events: none;
  transform: translateY(-50%);
}

.global-search-icon svg {
  width: 18px;
  height: 18px;
}

.global-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f8fafc;
  color: var(--text-primary);
  padding: 0 14px 0 41px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.global-search input::placeholder {
  color: #94a3b8;
}

.global-search input:focus {
  border-color: #93c5fd;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.company-switcher .form-select {
  width: 190px;
  height: 42px;
  border-color: var(--border);
  border-radius: 11px;
  background-color: #f8fafc;
  font-size: 0.82rem;
}

.active-company {
  display: block;
  max-width: 180px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  padding: 8px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  padding: 0 4px;
  font-size: 0.62rem;
  font-weight: 800;
}

.profile-button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-primary);
  padding: 4px;
  text-align: left;
}

.profile-button:hover {
  background: #f8fafc;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--pundex-navy);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.user-avatar--small {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 9px;
  font-size: 0.66rem;
}

.profile-copy {
  display: flex;
  max-width: 115px;
  flex-direction: column;
  line-height: 1.2;
}

.profile-copy strong,
.profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 0.8rem;
}

.profile-copy small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.profile-chevron {
  color: #94a3b8;
}

.profile-chevron svg {
  width: 15px;
  height: 15px;
}

.profile-menu {
  min-width: 220px;
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-subtle);
  padding: 8px;
}

.profile-menu-header {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
}

.profile-menu-header span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.profile-menu-header strong {
  margin-top: 2px;
  font-size: 0.86rem;
}

.profile-company-switcher {
  padding: 7px 10px;
}

.profile-company-switcher label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.profile-company-switcher .form-select {
  border-color: var(--border);
  font-size: 0.75rem;
}

.profile-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  color: var(--danger);
  font-weight: 650;
}

.profile-logout span svg {
  width: 17px;
  height: 17px;
}

.app-content {
  width: 100%;
  max-width: 1664px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.app-content > *,
.dashboard-grid > *,
.primary-metrics > *,
.secondary-metrics > *,
.row > *,
.topbar-leading,
.topbar-actions,
.global-search {
  min-width: 0;
}

.app-alert {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
}

.sidebar-overlay {
  display: none;
}

.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-inline: 12px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-section-label {
  display: none;
}

.sidebar-collapsed .nav-section + .nav-section {
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.sidebar-collapsed .nav-link,
.sidebar-collapsed .sidebar-collapse {
  justify-content: center;
  padding-inline: 10px;
}

.sidebar-collapsed .nav-link.is-active::before {
  left: -12px;
}

.dashboard-page,
.content-page {
  min-width: 0;
}

.dashboard-header,
.content-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.dashboard-heading,
.content-header > div {
  min-width: 0;
}

.page-kicker {
  margin: 0 0 5px;
  color: var(--pundex-blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-heading h1,
.content-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.dashboard-heading > p:last-child,
.content-header > div > p:last-child {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.dashboard-actions {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.date-range-form .form-select {
  width: 156px;
  height: 42px;
  border-color: var(--border);
  border-radius: 10px;
  background-color: var(--surface);
  color: #334155;
  font-size: 0.82rem;
  font-weight: 650;
}

.action-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding-inline: 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.action-button span svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  border-color: var(--pundex-blue);
  background: var(--pundex-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--pundex-blue-dark);
  background: var(--pundex-blue-dark);
}

.btn-outline-primary {
  border-color: #93c5fd;
  color: var(--pundex-blue);
}

.btn-outline-primary:hover {
  border-color: var(--pundex-blue);
  background: var(--pundex-blue);
}

.primary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  min-width: 0;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px 19px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-color);
  content: "";
}

.metric-card--success {
  --metric-color: var(--success);
  --metric-soft: var(--success-soft);
}

.metric-card--warning {
  --metric-color: var(--warning);
  --metric-soft: var(--warning-soft);
}

.metric-card--primary {
  --metric-color: var(--pundex-blue);
  --metric-soft: var(--blue-soft);
}

.metric-card--danger {
  --metric-color: var(--danger);
  --metric-soft: var(--danger-soft);
}

.metric-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--metric-soft);
  color: var(--metric-color);
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-label {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-value {
  overflow: hidden;
  margin: 15px 0 11px;
  color: var(--text-primary);
  font-size: clamp(1.35rem, 1.6vw, 2rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-comparison {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.metric-comparison.is-positive {
  color: #15803d;
}

.metric-comparison.is-negative {
  color: #b91c1c;
}

.comparison-icon {
  flex: 0 0 14px;
}

.comparison-icon svg {
  width: 14px;
  height: 14px;
}

.secondary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.compact-metric {
  display: grid;
  min-width: 0;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 15px;
}

.compact-metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #f1f5f9;
  color: #475569;
}

.compact-metric-icon svg {
  width: 17px;
  height: 17px;
}

.compact-metric > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.compact-metric > div span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.compact-metric > div strong {
  color: var(--text-primary);
  font-size: 1.12rem;
}

.compact-metric small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  min-width: 0;
  gap: 16px;
  margin-top: 16px;
}

.dashboard-grid--charts {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
}

.dashboard-grid--rankings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid--activity {
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.85fr);
}

.dashboard-section,
.content-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.035);
}

.access-restricted-card {
  max-width: 720px;
}

.access-restricted-card .empty-state {
  min-height: 220px;
}

.section-header,
.content-card-header {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 17px 19px 14px;
}

.section-header h2,
.content-card-header h2,
.onboarding-card h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section-header p,
.content-card-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.section-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  color: var(--pundex-blue);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
}

.section-action span svg {
  width: 14px;
  height: 14px;
}

.section-body {
  min-width: 0;
  padding: 16px 19px 18px;
}

.chart-container {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 292px;
}

.chart-container--donut {
  width: min(220px, 100%);
  height: 220px;
  margin: 0 auto;
}

.chart-container canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.chart-loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.chart-loading.chart-error {
  color: var(--danger);
  text-align: center;
}

.pipeline-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(120px, 0.65fr);
  align-items: center;
  gap: 12px;
}

.pipeline-legend {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 0.72rem;
}

.pipeline-legend li strong {
  color: var(--text-primary);
}

.pipeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #64748b;
}

.pipeline-dot--draft {
  background: #94a3b8;
}

.pipeline-dot--sent {
  background: var(--pundex-blue);
}

.pipeline-dot--follow_up {
  background: var(--warning);
}

.pipeline-dot--won {
  background: var(--success);
}

.pipeline-dot--lost {
  background: var(--danger);
}

.ranking-list {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 11px;
}

.ranking-number {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.67rem;
  font-weight: 800;
}

.ranking-content {
  min-width: 0;
  flex: 1;
}

.ranking-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ranking-heading strong,
.ranking-heading a {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-heading span {
  flex: 0 0 auto;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 750;
}

.ranking-bar {
  height: 5px;
  overflow: hidden;
  margin-top: 6px;
  border-radius: 999px;
  background: #e2e8f0;
}

.ranking-bar span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--pundex-blue);
}

.ranking-bar--customer span {
  background: var(--success);
}

.ranking-content small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.dashboard-table-wrap {
  margin: -5px 0 -8px;
}

.dashboard-table {
  min-width: 620px;
  margin-bottom: 0;
  color: #334155;
  font-size: 0.74rem;
}

.dashboard-table > :not(caption) > * > * {
  border-bottom-color: #edf2f7;
  padding: 10px 9px;
  vertical-align: middle;
}

.dashboard-table thead th {
  border-bottom-width: 1px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-primary-link {
  color: var(--pundex-blue);
  font-weight: 750;
  text-decoration: none;
}

.status-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  font-size: 0.64rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.status-badge--sent {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.status-badge--follow_up {
  background: var(--warning-soft);
  color: #b45309;
}

.status-badge--won {
  background: var(--success-soft);
  color: #15803d;
}

.status-badge--lost {
  background: var(--danger-soft);
  color: #b91c1c;
}

.table-row-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #64748b;
  text-decoration: none;
}

.table-row-action:hover {
  background: #f1f5f9;
  color: var(--pundex-blue);
}

.table-row-action svg {
  width: 15px;
  height: 15px;
}

.followup-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.followup-list li {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 0;
}

.followup-list li:first-child {
  padding-top: 0;
}

.followup-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.followup-date {
  display: flex;
  width: 52px;
  height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--warning-soft);
  color: #b45309;
  line-height: 1;
}

.followup-date.is-overdue {
  background: var(--danger-soft);
  color: #b91c1c;
}

.followup-date small {
  font-size: 0.57rem;
  font-weight: 750;
  text-transform: uppercase;
}

.followup-date strong {
  margin-top: 4px;
  font-size: 0.92rem;
}

.followup-list li > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.followup-list li > div a {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-list li > div span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: flex;
  min-height: 140px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 18px;
  text-align: left;
}

.empty-state-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 11px;
  background: #f1f5f9;
  color: #64748b;
}

.empty-state-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state > div {
  max-width: 320px;
}

.empty-state h3 {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 750;
}

.empty-state p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.empty-state .btn {
  flex: 0 0 auto;
  border-radius: 9px;
  font-weight: 700;
}

.onboarding-card {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.onboarding-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  padding: 24px;
}

.onboarding-intro > div:first-child > p:last-child {
  max-width: 570px;
  margin: 6px 0 0;
  color: var(--text-muted);
}

.onboarding-progress {
  width: min(220px, 100%);
  flex: 0 0 220px;
}

.onboarding-progress strong {
  color: var(--text-primary);
  font-size: 1.15rem;
}

.onboarding-progress > span {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.onboarding-progress .progress {
  height: 7px;
  margin-top: 8px;
  background: #e2e8f0;
}

.onboarding-progress .progress-bar {
  background: var(--success);
}

.onboarding-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 12px 24px 20px;
  list-style: none;
}

.onboarding-list li {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding: 14px 4px;
}

.onboarding-list li:nth-child(odd) {
  margin-right: 16px;
}

.onboarding-list li:nth-child(even) {
  margin-left: 16px;
}

.onboarding-list li:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.onboarding-status {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #94a3b8;
}

.onboarding-status svg {
  width: 16px;
  height: 16px;
}

.onboarding-list li.is-complete .onboarding-status {
  border-color: #86efac;
  background: var(--success-soft);
  color: var(--success);
}

.onboarding-list li > div {
  min-width: 0;
}

.onboarding-list li > div strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.78rem;
}

.onboarding-list li > div p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.onboarding-list li > a {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #64748b;
}

.onboarding-list li > a:hover {
  background: var(--blue-soft);
  color: var(--pundex-blue);
}

.onboarding-list li > a svg {
  width: 15px;
  height: 15px;
}

.content-card {
  margin-top: 16px;
}

.content-card-header {
  align-items: center;
}

.content-card .table-responsive {
  padding: 3px 18px 10px;
}

.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.card {
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
}

.card-header {
  border-bottom-color: var(--border);
  background: #ffffff;
}

.form-control,
.form-select {
  max-width: 100%;
  border-color: #cbd5e1;
  border-radius: 9px;
}

.modal-dialog {
  max-width: min(var(--bs-modal-width, 500px), calc(100vw - 32px));
  margin-inline: auto;
}

.toast-container,
.toast {
  max-width: calc(100vw - 32px);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.table-responsive {
  max-width: 100%;
}

.quotation-document {
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 28px;
  box-shadow: var(--shadow-subtle);
}

.quotation-document .company-logo {
  max-width: 150px;
  max-height: 90px;
  object-fit: contain;
}

.signature-box {
  min-height: 80px;
  border-bottom: 1px solid #111827;
}

.ai-suggestion-card {
  border-left: 4px solid var(--pundex-blue);
}

.quotation-item-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  background: var(--app-background);
  overflow-y: auto;
  padding: clamp(16px, 4vh, 40px) 16px;
}

.auth-content {
  width: min(440px, calc(100vw - 32px));
  min-width: 0;
}

.auth-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.auth-card-body {
  min-width: 0;
  padding: 36px;
}

.auth-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.auth-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--pundex-navy);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
}

.auth-brand > div {
  min-width: 0;
}

.auth-brand h1 {
  margin: 0;
  color: var(--pundex-navy);
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.auth-brand p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.auth-intro {
  margin: 30px 0 22px;
}

.auth-intro h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 780;
  letter-spacing: -0.025em;
}

.auth-intro p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.auth-alert {
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #991b1b;
  padding: 11px 13px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.auth-field {
  min-width: 0;
  margin-bottom: 17px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-field .form-control {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-field .form-control {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 56px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pundex-blue);
  font-size: 0.72rem;
  font-weight: 750;
}

.password-toggle:hover {
  background: var(--blue-soft);
}

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 5px;
  border-radius: 10px;
  font-weight: 750;
}

.auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: auth-spin 700ms linear infinite;
}

.auth-spinner.is-visible {
  display: block;
}

.auth-footnote {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
}

.error-card {
  width: min(620px, 100%);
  margin: clamp(24px, 8vh, 80px) auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.error-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--pundex-blue);
}

.error-icon svg {
  width: 23px;
  height: 23px;
}

.error-card h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 780;
}

.error-card > p {
  max-width: 470px;
  margin: 10px auto 0;
  color: var(--text-muted);
}

.error-reference {
  font-size: 0.74rem;
}

.error-reference code {
  overflow-wrap: anywhere;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
}

.error-actions .btn {
  min-height: 44px;
}

.enquiry-original {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1250px) {
  .app-topbar {
    gap: 14px;
    padding-inline: 22px;
  }

  .global-search {
    width: min(340px, 32vw);
  }

  .active-company {
    display: none;
  }

  .primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid--charts,
  .dashboard-grid--activity {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  }
}

@media (max-width: 1439.98px) {
  .active-company {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    width: min(288px, 86vw);
    box-shadow: 18px 0 44px rgba(15, 23, 42, 0.24);
    transform: translateX(-105%);
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-open {
    overflow: hidden;
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-collapse {
    display: none;
  }

  .app-main,
  .sidebar-collapsed .app-main {
    margin-left: 0;
  }

  .sidebar-collapsed .app-sidebar {
    width: min(288px, 86vw);
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-section-label {
    display: flex;
  }

  .sidebar-collapsed .nav-section-label {
    display: block;
  }

  .sidebar-collapsed .sidebar-brand,
  .sidebar-collapsed .nav-link {
    justify-content: initial;
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 1030;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .topbar-leading {
    flex-basis: 175px;
    min-width: 175px;
  }

  .profile-copy,
  .profile-chevron {
    display: none;
  }

  .global-search {
    width: min(360px, 42vw);
  }

  .app-content {
    padding-inline: 24px;
  }

  .dashboard-grid--charts,
  .dashboard-grid--rankings,
  .dashboard-grid--activity {
    grid-template-columns: minmax(0, 1fr);
  }

  .pipeline-layout {
    grid-template-columns: minmax(180px, 260px) minmax(130px, 1fr);
    justify-content: center;
  }
}

@media (max-width: 767.98px) {
  :root {
    --topbar-height: 64px;
  }

  .app-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 9px 16px 11px;
  }

  .topbar-leading {
    flex-basis: auto;
    min-width: 0;
  }

  .topbar-eyebrow {
    display: none;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .global-search input {
    height: 40px;
  }

  .company-switcher,
  .active-company {
    display: none;
  }

  .app-content {
    padding: 20px 16px 36px;
  }

  .btn,
  .form-control,
  .form-select,
  .dropdown-item {
    min-height: 44px;
  }

  .dashboard-header,
  .content-header {
    flex-direction: column;
    gap: 16px;
  }

  .dashboard-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .compact-metric {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .onboarding-intro {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .onboarding-progress {
    width: 100%;
    flex-basis: auto;
  }

  .onboarding-list {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 20px;
  }

  .onboarding-list li:nth-child(odd),
  .onboarding-list li:nth-child(even) {
    margin: 0;
  }

  .onboarding-list li:nth-last-child(2) {
    border-bottom: 1px solid #edf2f7;
  }
}

@media (max-width: 575.98px) {
  .topbar-title {
    max-width: 125px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .icon-button,
  .user-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .dashboard-actions > * {
    flex: 1 1 calc(50% - 5px);
  }

  .dashboard-actions .date-range-form {
    flex-basis: 100%;
  }

  .date-range-form .form-select {
    width: 100%;
  }

  .action-button {
    min-width: 0;
    padding-inline: 10px;
  }

  .primary-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: 150px;
  }

  .compact-metric {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .compact-metric small {
    grid-column: 2;
    text-align: left;
  }

  .section-header {
    min-height: auto;
    padding: 15px 16px 13px;
  }

  .section-body {
    padding: 15px 16px 17px;
  }

  .section-action {
    max-width: 110px;
    text-align: right;
  }

  .chart-container {
    height: 245px;
  }

  .pipeline-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-container--donut {
    height: 190px;
  }

  .pipeline-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-table-wrap .dashboard-table {
    width: 100%;
    min-width: 0;
  }

  .dashboard-table-wrap .dashboard-table th:nth-child(n + 3),
  .dashboard-table-wrap .dashboard-table td:nth-child(n + 3) {
    display: none;
  }

  .empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .empty-state .btn {
    margin-left: 55px;
  }

  .onboarding-list {
    padding-inline: 16px;
  }

  .auth-card-body {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .app-sidebar,
  .app-topbar,
  .sidebar-overlay,
  .no-print,
  .dashboard-actions {
    display: none !important;
  }

  .app-main {
    margin: 0 !important;
  }

  .app-content {
    max-width: none;
    padding: 0;
  }

  .quotation-document {
    max-width: none;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
}
