:root {
  --color-bg: #111827;
  --color-surface: #111827;
  --color-surface-raised: #1a2236;
  --color-border: #1e2d45;
  --color-border-hover: #2e4066;
  --color-confirmed: #22c55e;
  --color-high: #f59e0b;
  --color-medium: #818cf8;
  --color-low: #64748b;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #4b5563;
  --color-accent: #f59e0b;
  --color-link: #38bdf8;
  --color-error: #ef4444;
  --color-source-sam: #60a5fa;
  --color-source-sam-bg: rgba(29, 78, 216, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

body {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.06), transparent 24rem),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.08), transparent 26rem),
    var(--color-bg);
}

body.is-guest {
  background: #111827;
}

body.is-help-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

a:hover {
  text-decoration: underline;
}

.auth-shell {
  position: fixed;
  inset: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #111827;
}

.login-brand {
  margin-bottom: 18px;
  text-align: center;
}

.login-logo {
  display: inline-block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

.login-copy h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.login-copy p {
  margin: 8px 0 0;
  color: var(--color-text-secondary);
}

.login-form {
  margin-top: 20px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.field-label + .login-input {
  margin-bottom: 14px;
}

.login-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 120ms ease;
}

.login-input:focus {
  border-color: var(--color-border-hover);
}

.login-button {
  width: 100%;
  margin-top: 4px;
}

.auth-error {
  min-height: 22px;
}

.login-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  background: rgba(10, 15, 30, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-dialog {
  width: 100%;
  max-width: 880px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.help-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.help-header p {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.help-card {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
}

.help-step {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
}

.help-card h3 {
  margin: 12px 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.help-card p {
  margin: 0;
  color: var(--color-text-secondary);
}

.help-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.app-shell[hidden],
.auth-shell[hidden],
.help-overlay[hidden],
.apply-modal[hidden] {
  display: none;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 256px;
  height: 100vh;
  padding: 18px 14px 0;
  background: #111827;
  border-right: 1px solid var(--color-border);
}

.sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 18px;
}

.sidebar-brand-main {
  flex: 1;
  min-width: 0;
}

.logo-image {
  display: block;
  width: 100%;
  max-width: 164px;
  height: auto;
}

.sidebar-tenant-block {
  margin-top: 14px;
  padding: 11px 12px 12px;
  border: 1px solid rgba(46, 64, 102, 0.7);
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.sidebar-tenant-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-utility-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(46, 64, 102, 0.55);
}

.nav-link {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(46, 64, 102, 0.9);
}

.nav-link.is-active {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: var(--color-text-primary);
  box-shadow: inset 2px 0 0 var(--color-accent), 0 0 0 1px rgba(245, 158, 11, 0.04);
}

.nav-link-management {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.14);
}

.nav-link-management:hover,
.nav-link-management.is-active {
  border-color: rgba(245, 158, 11, 0.26);
}

.sidebar-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.sidebar-button:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(46, 64, 102, 0.9);
}

.sidebar-button-signout {
  color: #cbd5e1;
}

.inventory-status {
  display: none;
  padding: 0 12px;
}

.inventory-status.is-visible {
  display: block;
}

.inventory-filename {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-date {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.status-panel {
  padding: 14px 12px 18px;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
}

#status-sources {
  display: flex;
  flex-direction: column;
}

.status-line + .status-line {
  margin-top: 10px;
}

.status-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.status-value {
  color: var(--color-text-primary);
}

.status-source-line {
  display: block;
}

.status-meta {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
}

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

.status-value.is-confirmed {
  color: var(--color-confirmed);
}

.status-value.is-high {
  color: var(--color-high);
}

.status-value.is-medium {
  color: var(--color-medium);
}

.main-content {
  margin-left: 256px;
  min-height: 100vh;
  padding: 40px;
}

.workspace-shell {
  width: 100%;
  max-width: 1200px;
  margin-bottom: 28px;
  padding: 24px 26px 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(26, 34, 54, 0.92) 0%, rgba(17, 24, 39, 0.9) 100%);
  box-shadow: 0 20px 50px rgba(3, 7, 18, 0.18);
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.workspace-copy {
  min-width: 0;
}

.workspace-eyebrow {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.workspace-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.workspace-description {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(46, 64, 102, 0.55);
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.workspace-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(46, 64, 102, 0.9);
  border-radius: 6px;
  background: rgba(10, 15, 30, 0.35);
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.workspace-tab:hover {
  color: var(--color-text-primary);
  border-color: rgba(245, 158, 11, 0.22);
}

.workspace-tab.is-active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f8d38b;
}

.view[data-workspace-view] > .view-header:first-child,
.view[data-workspace-view] > .cs-hero:first-child {
  display: none;
}

.view {
  display: none;
  width: 100%;
  max-width: 960px;
}

#view-start-here {
  max-width: 1200px;
}

#view-coming-soon {
  max-width: 1200px;
}

#view-watchlists {
  max-width: 1200px;
}

#view-pipeline {
  max-width: 1200px;
}

#view-dashboard {
  max-width: 1200px;
}

#view-rfqinbox {
  max-width: 1200px;
}

#view-admin {
  max-width: 1200px;
}

#view-coming-soon .cs-hero {
  margin-bottom: 20px;
  padding-bottom: 20px;
}

#view-coming-soon .cs-eyebrow {
  margin-bottom: 8px;
}

#view-coming-soon .cs-grid {
  gap: 12px;
}

#view-coming-soon .cs-card {
  padding: 16px;
  overflow: visible;
}

#view-coming-soon .cs-card-top {
  margin-bottom: 12px;
}

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

.view-header {
  margin-bottom: 32px;
}

.view-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.view-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 6;
}

.tooltip-button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  position: relative;
}

.tooltip-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 100;
}

.tooltip-button:hover::after,
.tooltip-button:focus-visible::after {
  opacity: 1;
}

.view-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search-form input {
  width: 100%;
  max-width: 600px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 120ms ease;
}

.search-form input::placeholder {
  color: var(--color-text-muted);
}

.search-form input:focus {
  border-color: var(--color-border-hover);
}

.primary-button {
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--color-accent);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.inline-error {
  margin-top: 12px;
  color: var(--color-error);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inline-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.search-results {
  margin-top: 28px;
}

.results-group {
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(6px);
  animation: fade-in-up 150ms ease forwards;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.results-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.count-badge.is-confirmed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-confirmed);
}

.count-badge.is-high {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-high);
}

.count-badge.is-medium {
  background: rgba(129, 140, 248, 0.15);
  color: var(--color-medium);
}

.count-badge.is-low {
  background: rgba(100, 116, 139, 0.15);
  color: var(--color-low);
}

.match-card {
  position: relative;
  margin-bottom: 12px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
  overflow: hidden;
  transition: border-color 120ms ease;
}

.match-card:hover {
  border-color: var(--color-border-hover);
}

.match-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.match-card[data-tier="confirmed"]::before {
  background: var(--color-confirmed);
}

.match-card[data-tier="high"]::before {
  background: var(--color-high);
}

.match-card[data-tier="medium"]::before {
  background: var(--color-medium);
}

.match-card[data-tier="low"]::before {
  background: var(--color-low);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.match-badge {
  display: inline-block;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.match-badge.is-confirmed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-confirmed);
}

.match-badge.is-high {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-high);
}

.match-badge.is-medium {
  background: rgba(129, 140, 248, 0.15);
  color: var(--color-medium);
}

.match-badge.is-low {
  background: rgba(100, 116, 139, 0.15);
  color: var(--color-low);
}

.source-badge {
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 2px 8px;
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.source-badge.is-sam {
  border-color: transparent;
  background: var(--color-source-sam-bg);
  color: var(--color-source-sam);
}

.buyer-pn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.card-headline {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.card-context {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.card-pill {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 3px 10px;
  background: var(--color-surface);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.matched-keywords {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.matched-keywords-label {
  color: var(--color-text-muted);
}

.downgrade-reason {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  color: var(--color-high);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.deal-action-block {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.deal-create-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #f59e0b;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 120ms ease, opacity 120ms ease;
}

.deal-create-button:hover {
  filter: brightness(1.06);
}

.deal-create-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.deal-action-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--color-error);
}

.scraped-at {
  font-size: 12px;
  color: var(--color-text-muted);
}

.card-link {
  font-size: 13px;
}

.empty-state {
  margin-top: 40px;
  text-align: center;
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateY(6px);
  animation: fade-in-up 150ms ease forwards;
}

.drop-zone {
  width: 100%;
  max-width: 600px;
  height: 160px;
  padding: 24px;
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.drop-zone.is-dragover {
  border-color: var(--color-accent);
}

.drop-zone-icon {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
}

.drop-zone-icon svg {
  width: 100%;
  height: 100%;
}

.drop-zone-title {
  margin-top: 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.drop-zone-subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.batch-filename {
  color: var(--color-text-secondary);
}

.batch-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--color-text-secondary);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 700ms ease infinite;
}

.batch-results {
  margin-top: 28px;
}

.batch-card-list {
  margin-top: 16px;
}

.batch-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-top: 18px;
}

.batch-mobile-tabs {
  display: none;
}

.tab-button {
  padding: 10px 20px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.tab-button.is-active {
  border-bottom-color: var(--color-accent);
  color: var(--color-text-primary);
}

.outline-button {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.outline-button:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
}

.results-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
}

.results-table thead th {
  padding: 10px 12px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.results-table tbody tr:nth-child(odd) {
  background: var(--color-surface-raised);
}

.results-table tbody tr:nth-child(even) {
  background: var(--color-surface);
}

.results-table tbody td {
  height: 44px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--color-text-primary);
}

.results-table .source-cell {
  white-space: nowrap;
}

.results-table .listing-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table .link-cell a {
  white-space: nowrap;
}

.no-results-table {
  margin-top: 16px;
  color: var(--color-text-muted);
}

.unmatched-disclosure {
  margin-top: 20px;
  color: var(--color-text-muted);
}

.unmatched-disclosure summary {
  cursor: pointer;
  font-size: 13px;
}

.unmatched-list {
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  columns: 1;
  column-gap: 24px;
}

.unmatched-list.two-columns {
  columns: 2;
}

.unmatched-list div {
  break-inside: avoid;
  margin-bottom: 6px;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.filter-pill.is-active {
  border-color: var(--color-accent);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
}

.recent-item {
  border-bottom: 1px solid var(--color-border);
}

.recent-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px 0 0;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.recent-row:hover {
  background: var(--color-surface-raised);
}

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 12px;
  flex: 0 0 auto;
}

.recent-dot.is-confirmed {
  background: var(--color-confirmed);
}

.recent-dot.is-high {
  background: var(--color-high);
}

.recent-dot.is-medium {
  background: var(--color-medium);
}

.recent-dot.is-low {
  background: var(--color-low);
}

.recent-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recent-headline {
  font-size: 14px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-buyer {
  font-size: 12px;
  color: var(--color-text-muted);
}

.recent-time {
  min-width: 110px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
}

.recent-arrow {
  padding-right: 4px;
  font-size: 18px;
  line-height: 1;
}

.recent-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 180ms ease, opacity 180ms ease;
}

.recent-item.is-open .recent-details {
  max-height: 500px;
  opacity: 1;
}

.recent-details-inner {
  padding: 0 0 12px;
}

.recent-pagination {
  margin-top: 20px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.pagination-indicator {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.cs-hero {
  position: relative;
  margin-bottom: 44px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.cs-hero::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 480px;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.07), transparent 68%);
  pointer-events: none;
}

.cs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.cs-eyebrow-line {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.cs-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.25;
}

.cs-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cs-card {
  position: relative;
  padding: 22px 22px 22px 22px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 8px;
  background: var(--color-surface-raised);
  overflow: hidden;
  transition: box-shadow 240ms ease, transform 240ms ease, border-color 240ms ease;
  opacity: 0;
  animation: fade-in-up 280ms ease forwards;
}

.cs-card:nth-child(1) { animation-delay: 40ms; }
.cs-card:nth-child(2) { animation-delay: 100ms; }
.cs-card:nth-child(3) { animation-delay: 160ms; }
.cs-card:nth-child(4) { animation-delay: 220ms; }
.cs-card:nth-child(5) { animation-delay: 280ms; }
.cs-card:nth-child(6) { animation-delay: 340ms; }
.cs-card:nth-child(7) { animation-delay: 400ms; }

.cs-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.045) 0%, transparent 55%);
  pointer-events: none;
}

.cs-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.07), transparent);
  pointer-events: none;
  animation: cs-shimmer 7s ease-in-out infinite;
}

.cs-card:nth-child(2)::after { animation-delay: 1.2s; }
.cs-card:nth-child(3)::after { animation-delay: 2.4s; }
.cs-card:nth-child(4)::after { animation-delay: 3.6s; }
.cs-card:nth-child(5)::after { animation-delay: 4.8s; }
.cs-card:nth-child(6)::after { animation-delay: 6s; }
.cs-card:nth-child(7)::after { animation-delay: 0.6s; }

.cs-card:hover {
  transform: translateY(-3px);
  border-left-color: var(--color-accent);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.09), 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.cs-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.cs-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cs-icon svg {
  width: 20px;
  height: 20px;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  animation: cs-pulse 2.2s ease-in-out infinite;
}

.cs-card-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.cs-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.cs-workbench {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.cs-workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cs-workbench-eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.cs-workbench-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.cs-workbench-head p {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
}

.cs-workbench-note {
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
}

.cs-workbench-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pilot-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 32%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.08), transparent 34%),
    var(--color-surface-raised);
  overflow: hidden;
}

.pilot-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 45%);
  pointer-events: none;
}

.pilot-copy-block,
.pilot-status {
  position: relative;
  z-index: 1;
}

.pilot-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.pilot-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-accent);
}

.pilot-title {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.pilot-copy {
  margin: 0;
  max-width: 64ch;
  font-size: 17px;
  color: var(--color-text-secondary);
}

.pilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pilot-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: rgba(10, 15, 30, 0.5);
}

.pilot-status-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.pilot-status-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pilot-status-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.pilot-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pilot-metric {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.pilot-metric-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pilot-metric-value {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pilot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pilot-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
}

.pilot-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pilot-list {
  margin: 0;
  padding-left: 18px;
  color: var(--color-text-secondary);
}

.pilot-list li + li {
  margin-top: 8px;
}

.cs-tool-panel {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
}

.cs-tool-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.cs-tool-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.cs-tool-header span {
  font-size: 11px;
  color: var(--color-text-muted);
}

.cs-field {
  display: block;
  margin-bottom: 12px;
}

.cs-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.cs-field input,
.cs-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  padding: 10px 12px;
  outline: none;
}

.cs-field textarea {
  resize: vertical;
  min-height: 88px;
}

.cs-field input:focus,
.cs-field textarea:focus {
  border-color: var(--color-border-hover);
}

.cs-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 12px;
}

.cs-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.cs-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.cs-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cs-tool-actions.is-stack {
  flex-direction: column;
  align-items: stretch;
}

.cs-tool-status,
.cs-tool-copy,
.cs-watchlist-empty {
  font-size: 12px;
  color: var(--color-text-muted);
}

.cs-tool-copy-muted {
  margin-top: 12px;
}

.cs-watchlist-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.watchlist-item {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
}

.watchlist-name {
  font-weight: 600;
  color: var(--color-text-primary);
}

.watchlist-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.watchlist-parts {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  word-break: break-word;
}

.watchlist-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.pipeline-shell {
  position: relative;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-stat-card,
.dashboard-table-panel {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
}

.dashboard-stat-card {
  padding: 16px;
}

.dashboard-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.dashboard-stat-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.dashboard-stat-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dashboard-table-panel {
  overflow: hidden;
}

.dashboard-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-table-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

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

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table thead th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dashboard-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-row {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.dashboard-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-empty-cell {
  padding: 22px 16px;
  color: var(--color-text-muted);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
}

.pipeline-column {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.pipeline-column-header.is-won {
  background: rgba(34, 197, 94, 0.12);
}

.pipeline-column-header.is-lost {
  background: rgba(100, 116, 139, 0.16);
}

.pipeline-column-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.pipeline-column-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.pipeline-column-body {
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding: 12px;
}

.pipeline-column-empty {
  padding: 14px 8px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.pipeline-empty-state {
  padding: 18px 12px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.pipeline-empty-arrow {
  font-size: 26px;
  line-height: 1;
  color: var(--color-accent);
}

.pipeline-empty-title {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pipeline-empty-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.pipeline-card {
  position: relative;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.pipeline-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-1px);
}

.pipeline-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.pipeline-card[data-tone="confirmed"]::before {
  background: var(--color-confirmed);
}

.pipeline-card[data-tone="high"]::before {
  background: var(--color-high);
}

.pipeline-card[data-tone="medium"]::before {
  background: var(--color-medium);
}

.pipeline-card[data-tone="low"]::before {
  background: var(--color-low);
}

.pipeline-card[data-tone="aog"]::before {
  background: #ef4444;
}

.pipeline-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pipeline-card-part {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  word-break: break-word;
}

.pipeline-status-select,
.deal-detail-select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--color-text-primary);
  cursor: pointer;
  outline: none;
}

.pipeline-status-select {
  min-width: 118px;
  max-width: 118px;
  font-size: 12px;
}

.pipeline-status-select:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pipeline-card-description {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pipeline-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pipeline-source-badge {
  background: rgba(148, 163, 184, 0.14);
  color: var(--color-text-secondary);
}

.deal-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.deal-status-badge.is-new {
  background: rgba(148, 163, 184, 0.14);
  color: var(--color-text-secondary);
}

.deal-status-badge.is-in-progress {
  background: rgba(245, 158, 11, 0.14);
  color: var(--color-high);
}

.deal-status-badge.is-quoted {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
}

.deal-status-badge.is-won {
  background: rgba(34, 197, 94, 0.14);
  color: var(--color-confirmed);
}

.deal-status-badge.is-lost {
  background: rgba(100, 116, 139, 0.18);
  color: #cbd5e1;
}

.pipeline-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.pipeline-card-customer {
  color: var(--color-text-muted);
}

.pipeline-card-created {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.pipeline-card-feedback {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-error);
}

.deal-detail-panel {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.98);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.32);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.deal-detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

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

.deal-detail-close {
  flex-shrink: 0;
}

.deal-detail-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

.deal-export-menu {
  position: relative;
}

.deal-export-trigger {
  list-style: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.deal-export-trigger::-webkit-details-marker,
.deal-export-trigger::marker {
  display: none;
}

.deal-export-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  z-index: 2;
}

.deal-export-option {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
}

.deal-export-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.deal-detail-part {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.deal-detail-description {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
}

.deal-detail-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.deal-detail-readonly {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
}

.deal-detail-readonly-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.deal-detail-readonly-value {
  color: var(--color-text-primary);
}

.deal-detail-fields {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deal-detail-panel-feedback {
  margin-top: 14px;
  font-size: 12px;
}

.deal-detail-panel-feedback[data-state="error"] {
  color: var(--color-error);
}

.deal-detail-panel-feedback[data-state="success"] {
  color: var(--color-confirmed);
}

.deal-detail-field {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-raised);
}

.deal-detail-field-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.deal-detail-field-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.deal-detail-field-feedback {
  min-height: 16px;
  font-size: 12px;
}

.deal-detail-field-feedback[data-state="success"] {
  color: var(--color-confirmed);
}

.deal-detail-field-feedback[data-state="error"] {
  color: var(--color-error);
}

.deal-detail-display {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.deal-detail-display.is-empty {
  color: var(--color-text-muted);
}

.deal-detail-display.is-multiline {
  white-space: pre-wrap;
  line-height: 1.55;
}

.deal-detail-editor[hidden] {
  display: none;
}

.deal-detail-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deal-detail-input-wrap.has-prefix {
  padding-left: 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
}

.deal-detail-input-prefix {
  color: var(--color-text-secondary);
}

.deal-detail-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  padding: 10px 12px;
  outline: none;
}

.deal-detail-input-wrap.has-prefix .deal-detail-input {
  border: 0;
  background: transparent;
  padding-left: 0;
}

.deal-detail-input:focus,
.deal-detail-select:focus,
.pipeline-status-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.deal-detail-input[type="number"]::-webkit-outer-spin-button,
.deal-detail-input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
}

.deal-detail-input[type="number"] {
  -moz-appearance: textfield;
}

.deal-detail-delete {
  margin-top: 18px;
  color: #fca5a5;
}

@keyframes cs-shimmer {
  0%   { left: -120%; }
  40%  { left: 160%; }
  100% { left: 160%; }
}

@keyframes cs-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.28; transform: scale(0.75); }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── Recent filter bar (sticky) ─────────────────────────────────────────── */

.recent-filter-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-bg);
  padding: 16px 0 4px;
  margin-top: -8px;
}

.mobile-filter-grid {
  display: none;
}

.ata-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ata-filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.ata-select {
  -webkit-appearance: none;
  appearance: none;
  height: 34px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: #111827;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  max-width: 340px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.ata-select:hover {
  border-color: var(--color-border-hover);
}

.ata-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.ata-select option {
  background: #111827;
  color: var(--color-text-primary);
}

.recent-details-close {
  display: none;
}

/* ── Copy PN button ──────────────────────────────────────────────────────── */

.pn-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 120ms ease, color 120ms ease;
}

.pn-copy-btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-secondary);
}

.pn-copy-btn svg {
  width: 12px;
  height: 12px;
}

.pn-copy-btn.is-copied {
  border-color: var(--color-confirmed);
  color: var(--color-confirmed);
}

.pn-copy-tooltip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0 2px;
}

/* ── Batch run info bar ──────────────────────────────────────────────────── */

.batch-run-info {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── AOG Critical tier ──────────────────────────────────────────────────── */

.match-card[data-tier="aog"]::before {
  background: #ef4444;
}

.match-badge.is-aog {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.aog-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: aog-pulse 1.6s ease-in-out infinite;
}

.aog-reason-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.recent-dot.is-aog {
  background: #ef4444;
  animation: aog-pulse 1.6s ease-in-out infinite;
}

.count-badge.is-aog {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.tab-button.is-critical-tab.is-active {
  border-bottom-color: #ef4444;
  color: #ef4444;
}

.filter-pill.is-critical {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.filter-pill.is-critical.is-active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-value.is-aog {
  color: #ef4444;
  font-weight: 600;
}

/* ── ATA chapter tags ────────────────────────────────────────────────────── */

.ata-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.ata-tag.is-upgraded {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-high);
}

.ata-tag.is-mismatch {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

@keyframes aog-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.7); }
}

/* ── Mobile header & hamburger ───────────────────────────────────────────── */

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  padding: 0 16px;
  background: #1a2236;
  border-bottom: 1px solid var(--color-border);
  z-index: 20;
}

.mobile-logo {
  height: 32px;
  width: auto;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-text-primary);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
  transform-origin: center;
}

.hamburger-btn.is-open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.is-open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 24;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.is-nav-open {
  overflow: hidden;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 920px) {
  .auth-shell {
    padding: 16px;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 292px;
    height: 100%;
    padding: 16px 14px 0;
    z-index: 25;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar-nav {
    gap: 8px;
  }

  .nav-link {
    min-width: 0;
    min-height: 46px;
  }

  .nav-link.is-active {
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-brand {
    padding-bottom: 16px;
  }

  .sidebar-button {
    min-height: 46px;
  }

  .workspace-shell {
    padding: 22px 22px 16px;
  }

  .workspace-header {
    flex-direction: column;
  }

  .workspace-title {
    font-size: 24px;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 20px 40px;
  }

  .view-header-top {
    flex-direction: column;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }


  .deal-detail-panel {
    top: 72px;
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100vw - 24px));
  }

  .recent-filter-bar {
    top: 56px;
  }

  .status-panel {
    margin-top: auto;
  }

  .card-topline,
  .card-footer,
  .batch-results-header,
  .pagination-controls,
  .recent-row {
    align-items: flex-start;
  }

  .card-topline,
  .card-footer,
  .batch-results-header,
  .pagination-controls {
    flex-direction: column;
  }

  .recent-row {
    flex-wrap: wrap;
    padding: 12px 12px 12px 0;
  }

  .recent-time {
    min-width: 0;
    text-align: left;
  }

  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-workbench-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-workbench-head {
    flex-direction: column;
  }

  .cs-workbench-note {
    max-width: none;
  }

  .batch-mobile-tabs {
    display: block;
    margin-top: 12px;
    padding: 12px 16px 0;
  }

  .batch-mobile-tabs .mobile-select-wrap {
    display: block;
  }

  .batch-mobile-tabs .mobile-filter-select {
    width: 100%;
  }

  .tabs {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-card,
  .help-dialog {
    padding: 18px;
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .main-content {
    padding: 68px 14px 32px;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form input,
  .primary-button {
    max-width: none;
    width: 100%;
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tab-button {
    white-space: nowrap;
  }

  .results-table thead th,
  .results-table tbody td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .tooltip-button::after {
    left: 0;
    transform: none;
    width: 200px;
  }

  .cs-grid {
    grid-template-columns: 1fr;
  }

  .cs-title {
    font-size: 22px;
  }

  .cs-workbench {
    margin-top: 20px;
    padding-top: 20px;
  }

  .cs-workbench-grid {
    gap: 12px;
  }

  .cs-tool-panel {
    padding: 16px;
  }

  .pilot-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .pilot-title {
    font-size: 27px;
  }

  .pilot-metrics {
    grid-template-columns: 1fr;
  }

  .pilot-grid {
    grid-template-columns: 1fr;
  }

  .cs-rule-grid {
    grid-template-columns: 1fr;
  }

  .who-for-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .apply-dialog {
    padding: 18px;
  }

  .view-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-value {
    font-size: 24px;
  }

  .filter-pill {
    min-height: 44px;
    padding: 10px 14px;
  }

  .ata-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ata-select {
    max-width: none;
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .pipeline-column-body {
    max-height: none;
  }

  .deal-detail-panel {
    top: 64px;
    right: 0;
    bottom: 0;
    width: 100vw;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
  }

  .deal-detail-readonly-grid {
    grid-template-columns: 1fr;
  }

  .deal-detail-actions {
    width: 100%;
    justify-content: space-between;
  }

  .deal-export-list {
    left: 0;
    right: auto;
  }

  .header-title-row {
    position: relative;
    z-index: 6;
  }

  .tooltip-button {
    position: static;
    flex: 0 0 auto;
  }

  .tooltip-button::after {
    left: 0;
    right: auto;
    top: calc(100% + 10px);
    transform: none;
    width: min(220px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    z-index: 12;
  }

  .help-dialog {
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .help-header {
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
    padding-bottom: 12px;
    background: var(--color-surface);
    min-width: 0;
  }

  .help-header > div,
  .help-body,
  .header-title-row,
  .card-topline,
  .card-badges,
  .buyer-pn,
  .card-footer,
  .batch-actions,
  .batch-results-header,
  .pagination-controls,
  .recent-row,
  .recent-copy,
  .recent-meta,
  .mobile-filter-grid,
  .sidebar-button,
  .status-panel,
  .status-summary {
    min-width: 0;
  }

  .help-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0;
    padding-right: 2px;
  }

  .help-actions {
    margin-top: 16px;
  }

  .icon-button,
  .mobile-filter-select,
  .nav-link,
  .sidebar-button,
  .workspace-tab,
  .recent-details-close,
  .view-actions .outline-button,
  .cs-tool-actions .outline-button {
    min-height: 44px;
  }

  .sidebar {
    padding-top: 14px;
  }

  .nav-link {
    min-height: 44px;
    padding: 10px 14px;
  }

  .sidebar-brand {
    padding: 2px 4px 14px;
  }

  .logo-image {
    max-width: 150px;
  }

  .sidebar-tenant-block {
    margin-top: 12px;
    padding: 10px 11px;
  }

  .sidebar-bottom {
    gap: 12px;
  }

  .sidebar-utility-list {
    padding-top: 12px;
  }

  .workspace-shell {
    margin-bottom: 22px;
    padding: 18px 16px 14px;
    border-radius: 8px;
  }

  .workspace-description {
    font-size: 13px;
  }

  .workspace-tabs {
    margin-top: 16px;
    padding-top: 14px;
  }

  .workspace-tab {
    min-height: 38px;
    padding: 0 12px;
  }

  .inventory-status {
    padding: 0 14px;
  }

  .status-panel {
    padding: 10px 14px 14px;
  }

  .filter-strip,
  .ata-filter-row {
    display: none;
  }

  .mobile-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
  }

  .mobile-select-wrap {
    position: relative;
    min-width: 0;
  }

  .mobile-select-wrap::after {
    content: "▾";
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--color-text-secondary);
    pointer-events: none;
    font-size: 14px;
    line-height: 1;
  }

  .mobile-filter-select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #111827;
    color: var(--color-text-primary);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
  }

  .mobile-filter-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
  }

  .mobile-filter-select option {
    background: #111827;
    color: var(--color-text-primary);
  }

  .buyer-pn,
  .buyer-pn span,
  .card-headline,
  .recent-headline,
  .recent-meta > span:first-child,
  .batch-filename,
  .drop-zone-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .buyer-pn {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .buyer-pn span,
  .card-headline,
  .recent-headline,
  .recent-meta > span:first-child {
    min-width: 0;
  }

  .recent-meta {
    width: 100%;
  }

  .recent-time {
    min-width: 0;
  }

  .recent-item.is-open .recent-details {
    max-height: 1200px;
  }

  .recent-details-inner {
    position: relative;
    padding: 0 0 12px;
  }

  .recent-details-inner .match-card {
    margin-bottom: 0;
    padding-top: 52px;
  }

  .recent-details-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
}

.stale-warning {
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 4px 0 0;
}

/* ── Apply for Access modal ─────────────────────────────────────────────── */

.apply-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  background: rgba(10, 15, 30, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
}

.apply-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.apply-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.apply-dialog-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.apply-dialog-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.apply-select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--color-text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.apply-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.apply-select option {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.apply-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.apply-success {
  padding: 18px;
  border: 1px solid var(--color-confirmed);
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.08);
}

.apply-success p {
  margin: 0;
  color: var(--color-confirmed);
  font-size: 14px;
}

.login-apply-button {
  width: 100%;
  margin-top: 10px;
  height: 44px;
}

/* ── Who This Is For section ────────────────────────────────────────────── */

.who-for-section {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
}

.who-for-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.who-for-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.who-for-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.who-for-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.who-for-yes .who-for-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-confirmed);
}

.who-for-no .who-for-icon {
  background: rgba(100, 116, 139, 0.15);
  color: var(--color-text-secondary);
}

.who-for-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.who-for-list li {
  position: relative;
  padding: 8px 0 8px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.who-for-list li:last-child {
  border-bottom: 0;
}

.who-for-yes .who-for-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-confirmed);
}

.who-for-no .who-for-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

/* ── Pricing section ────────────────────────────────────────────────────── */

.pricing-section {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-raised);
}

.pricing-heading {
  margin: 8px 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.pricing-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.pricing-card.is-featured {
  border-color: rgba(245, 158, 11, 0.3);
  border-left: 3px solid var(--color-accent);
}

.pricing-tier {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.pricing-price {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.pricing-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.pricing-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── CS card animation delays for 9th card ──────────────────────────────── */

.cs-card:nth-child(8) { animation-delay: 460ms; }
.cs-card:nth-child(9) { animation-delay: 520ms; }
.cs-card:nth-child(8)::after { animation-delay: 1.8s; }
.cs-card:nth-child(9)::after { animation-delay: 3s; }

/* ── Start Here — bottom row (three equal cards) ────────────────────────── */

.pilot-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pilot-who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.pilot-who-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pilot-who-yes {
  color: var(--color-confirmed);
}

.pilot-who-no {
  color: var(--color-text-muted);
}

.pilot-who-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pilot-who-list li {
  padding: 5px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  line-height: 1.4;
}

.pilot-who-list li:last-child {
  border-bottom: 0;
}

.pilot-avail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.pilot-avail-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.pilot-avail-live {
  color: var(--color-confirmed);
}

.pilot-tiers {
  margin-top: 10px;
}

.pilot-tier-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--color-border);
}

.pilot-tier-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pilot-tier-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
}

.pilot-tier-price small {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.pilot-tier-by-app {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pilot-tier-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 3px 0 6px;
}

.pilot-tier-row--pro .pilot-tier-name {
  color: var(--color-accent);
}

.pilot-tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 6px;
  opacity: 0.85;
}

.pilot-tier-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  font-style: italic;
}

/* ── Coming Soon card — Live Now badge variant ──────────────────────────── */

.cs-badge.is-live {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--color-confirmed);
}

.cs-badge.is-live .cs-pulse {
  background: var(--color-confirmed);
}

/* ── Coming Soon — card hover popout ────────────────────────────────────── */

.cs-card:hover,
.cs-card.is-popout-open {
  z-index: 10;
}

.cs-popout {
  position: absolute;
  top: 0;
  left: calc(100% + 8px);
  width: 260px;
  padding: 14px 16px;
  background: #0d1424;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.cs-card:hover .cs-popout,
.cs-card.is-popout-open .cs-popout {
  opacity: 1;
  pointer-events: auto;
}

.cs-card.opens-left .cs-popout {
  left: auto;
  right: calc(100% + 8px);
}

.cs-card.opens-up .cs-popout {
  top: auto;
  bottom: 0;
}

.cs-popout-heading {
  color: #f59e0b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.cs-popout-text {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.7;
}

/* ── Coming Soon — mobile popout override ────────────────────────────────── */

@media (max-width: 640px) {
  .cs-popout {
    left: 0;
    right: auto;
    top: calc(100% + 6px);
    width: 100%;
  }

  .cs-card.opens-left .cs-popout {
    left: 0;
    right: auto;
  }

  .cs-card.opens-up .cs-popout {
    top: auto;
    bottom: calc(100% + 6px);
  }
}

/* ── RFQ Inbox — trust block ─────────────────────────────────────────────── */

.rfq-trust-block {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rfq-trust-section + .rfq-trust-section {
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.rfq-trust-heading {
  color: #f59e0b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.rfq-trust-copy {
  margin: 0 0 6px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}

.rfq-trust-copy:last-child {
  margin-bottom: 0;
}

/* ── RFQ Inbox — tab bar ─────────────────────────────────────────────────── */

.rfq-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin: 14px 0 0;
}

.rfq-tab-btn {
  padding: 10px 20px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.rfq-tab-btn.is-active {
  border-bottom-color: var(--color-accent);
  color: var(--color-text-primary);
}

.rfq-tab-panel {
  padding-top: 16px;
}

/* ── Email RFQ source badge ─────────────────────────────────────────────── */

.source-badge.is-email-rfq {
  border-color: transparent;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

/* ── RFQ Inbox panel ─────────────────────────────────────────────────────── */

.rfq-inbox-panel {
  margin-top: 0;
}

.rfq-address-field {
  margin-bottom: 0;
}

.rfq-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rfq-input-group input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  outline: none;
}

.rfq-copy-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.rfq-copy-btn svg {
  width: 14px;
  height: 14px;
}

.rfq-instructions {
  margin: 14px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rfq-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.rfq-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.rfq-stats-row {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
}

.rfq-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.rfq-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.rfq-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.rfq-log-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

.rfq-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rfq-log-table th {
  padding: 8px 10px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.rfq-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

.rfq-log-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ── Responsive: Start Here bottom row ──────────────────────────────────── */

@media (max-width: 920px) {
  .pilot-bottom-row {
    grid-template-columns: 1fr;
  }

  .pilot-who-grid,
  .pilot-avail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .pilot-bottom-row {
    grid-template-columns: 1fr;
  }

  .pilot-who-grid,
  .pilot-avail-grid {
    grid-template-columns: 1fr;
  }

  .rfq-stats-row {
    flex-direction: column;
    gap: 10px;
  }

  .rfq-stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ── AI Score block ─────────────────────────────────────────────────────── */

.ai-score-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.ai-score-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.ai-score-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.14);
}

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

.ai-score-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-score-result {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-score-badge.is-high {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1.5px solid rgba(34, 197, 94, 0.35);
}

.ai-score-badge.is-medium {
  background: rgba(245, 158, 11, 0.10);
  color: #f59e0b;
  border: 1.5px solid rgba(245, 158, 11, 0.30);
}

.ai-score-badge.is-low {
  background: rgba(100, 116, 139, 0.10);
  color: #64748b;
  border: 1.5px solid rgba(100, 116, 139, 0.30);
}

.ai-score-reasoning {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.ai-score-unavailable {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

.ai-score-locked {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── Customer 360 ────────────────────────────────────────────────────────── */

.customers-loading,
.customers-empty {
  padding: 24px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.customers-accordion {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customer-item {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.customer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--color-surface);
  transition: background 0.15s;
  user-select: none;
}

.customer-row:hover {
  background: var(--color-surface-raised);
}

.customer-item.is-expanded .customer-row {
  border-bottom: 1px solid var(--color-border);
}

.customer-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-primary);
  min-width: 180px;
  flex-shrink: 0;
}

.customer-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.customer-stat {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.customer-stat--date {
  color: var(--color-text-muted);
  font-size: 12px;
}

.customer-chevron {
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.customer-deals-table {
  padding: 12px 16px;
  background: var(--color-bg);
}

.customer-deals-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.customer-deals-inner th {
  text-align: left;
  padding: 6px 10px;
  color: var(--color-text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}

.customer-deals-inner td {
  padding: 8px 10px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.customer-deal-row {
  cursor: pointer;
}

.customer-deal-row:hover td {
  background: var(--color-surface);
}

.customer-deals-empty {
  padding: 12px 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ── AI Insights (Deal Detail) ───────────────────────────────────────────── */

.deal-ai-insights {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.04);
}

.deal-ai-insights-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.deal-ai-recs-list {
  margin: 10px 0 12px;
  padding-left: 20px;
}

.deal-ai-recs-list li {
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.deal-ai-gen-btn {
  margin-top: 2px;
}

.deal-ai-recs-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-error);
}

.deal-erp-copy-btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* ── Admin panel ─────────────────────────────────────────────────────────── */

.admin-section {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.admin-section-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px 0;
}

.admin-section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-section-copy {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.admin-subsection-heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.admin-billing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-billing-card {
  padding: 14px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.admin-billing-label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-billing-value {
  display: block;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.admin-billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-billing-admin {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.admin-billing-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-field-input,
.admin-field-select {
  height: 36px;
  padding: 0 10px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 13px;
  font-family: inherit;
}

.admin-field-input:focus,
.admin-field-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.admin-field-input {
  min-width: 140px;
  flex: 1 1 140px;
}

.admin-field-select {
  min-width: 100px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead th {
  padding: 8px 12px;
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
}

.admin-table tbody tr:nth-child(odd) { background: var(--color-surface-raised); }
.admin-table tbody tr:nth-child(even) { background: var(--color-surface); }

.admin-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-inline-select {
  height: 28px;
  padding: 0 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.admin-inline-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.admin-delete-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--color-error) !important;
  border-color: var(--color-error) !important;
}

.admin-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}

.admin-muted {
  color: var(--color-text-muted);
}

.sidebar-tenant {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apply-optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.apply-success-icon {
  font-size: 32px;
  color: var(--color-confirmed);
  margin-bottom: 12px;
}

.apply-success-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 8px;
}

.apply-success p:last-child {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.admin-pending-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  vertical-align: middle;
}

.admin-user-notes {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.admin-platform-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 3px;
  vertical-align: middle;
}

@media (max-width: 920px) {
  .admin-billing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-billing-grid {
    grid-template-columns: 1fr;
  }

  .admin-billing-actions,
  .admin-billing-form {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ─── Notification bell ──────────────────────────────────────────────────── */

.notif-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.notif-bell:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.notif-bell.has-unread {
  color: var(--color-accent);
}

.notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  pointer-events: none;
}

/* ─── Notification panel ─────────────────────────────────────────────────── */

.notif-panel {
  position: fixed;
  top: 0;
  left: 240px; /* sidebar width */
  bottom: 0;
  width: 340px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel[hidden] {
  display: none;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
}

.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-read-all-btn {
  background: transparent;
  border: none;
  color: var(--color-link);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.notif-read-all-btn:hover {
  background: rgba(56, 189, 248, 0.1);
}

.notif-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.notif-close-btn:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Notification list ──────────────────────────────────────────────────── */

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.is-read {
  opacity: 0.55;
}

.notif-item.is-read:hover {
  opacity: 0.75;
}

/* ─── Type dot ───────────────────────────────────────────────────────────── */

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  background: var(--color-text-muted);
}

.notif-dot-rfq      { background: var(--color-high); }       /* amber */
.notif-dot-aog      { background: var(--color-error); }      /* red */
.notif-dot-confirmed { background: var(--color-confirmed); } /* green */
.notif-dot-won      { background: var(--color-confirmed); }  /* green */
.notif-dot-lost     { background: var(--color-text-muted); } /* grey */
.notif-dot-system   { background: var(--color-link); }       /* blue */

/* ─── Notification body ──────────────────────────────────────────────────── */

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-type-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.notif-message {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ─── Backdrop ───────────────────────────────────────────────────────────── */

.notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
}

.notif-backdrop[hidden] {
  display: none;
}

/* ─── Mobile header ──────────────────────────────────────────────────────── */

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .notif-panel {
    left: 0;
    top: 52px; /* below mobile header */
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    bottom: auto;
    max-height: calc(100vh - 52px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }

  .notif-list {
    max-height: calc(100vh - 52px - 53px); /* header + panel header */
  }
}

/* ── Signup form — checkbox field ────────────────────────────────────────── */

.cs-field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}

.cs-field-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.cs-field-checkbox span {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ── Admin — pending application cards ───────────────────────────────────── */

.admin-application-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.admin-application-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-application-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-application-company {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.admin-application-date {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.admin-application-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.admin-application-meta-item {
  display: flex;
  gap: 6px;
  font-size: 13px;
}

.admin-application-label {
  color: var(--color-text-muted);
}

.admin-application-value {
  color: var(--color-text);
  font-weight: 500;
}

.admin-application-inv {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 5px;
  display: inline-block;
  align-self: flex-start;
}

.admin-application-inv-yes {
  background: rgba(34, 197, 94, 0.10);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.admin-application-inv-no {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.20);
}

.admin-application-description {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 5px;
  border-left: 2px solid var(--color-border);
}

.admin-application-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.admin-application-approve {
  padding: 7px 18px;
  font-size: 13px;
}

.admin-application-reject {
  padding: 7px 18px;
  font-size: 13px;
}
