:root {
  --brand-blue: #306a78;
  --brand-blue-hover: #3c7f8f;
  --brand-red: #842036;
  --brand-lime: #97b83a;
  --brand-white: #ffffff;

  --bg: #eef1f4;
  --bg-2: #e4e8ed;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef1f4;
  --border: rgba(15, 30, 40, 0.1);
  --border-strong: rgba(15, 30, 40, 0.16);

  --text: #0f1e24;
  --text-soft: #2c3d45;
  --text-muted: #5c6e78;

  --primary: var(--brand-blue);
  --primary-hover: var(--brand-blue-hover);
  --danger: var(--brand-red);
  --success: #6f9d2f;
  --warning: #b7903a;

  --shadow-sm: 0 2px 6px rgba(15, 30, 40, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 30, 40, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 30, 40, 0.1);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 160ms ease;
  --max-width: 1540px;
}

html[data-theme="dark"] {
  --bg: #0e1317;
  --bg-2: #11171d;
  --surface: #161d24;
  --surface-2: #1b242d;
  --surface-3: #202b35;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f3f6f8;
  --text-soft: #c7d1d8;
  --text-muted: #8e9aa5;

  --primary: var(--brand-blue);
  --primary-hover: var(--brand-blue-hover);
  --danger: var(--brand-red);
  --success: #6f9d2f;
  --warning: #b7903a;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.3);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-fast: 160ms ease;
  --max-width: 1540px;
}

html[data-theme="light"] {
  --bg: #eef1f4;
  --bg-2: #e4e8ed;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef1f4;
  --border: rgba(15, 30, 40, 0.1);
  --border-strong: rgba(15, 30, 40, 0.16);

  --text: #0f1e24;
  --text-soft: #2c3d45;
  --text-muted: #5c6e78;

  --shadow-sm: 0 2px 6px rgba(15, 30, 40, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 30, 40, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 30, 40, 0.1);
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(48, 106, 120, 0.06), transparent 18%),
    linear-gradient(180deg, #0d1216 0%, #11171d 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="light"] body,
html[data-theme="light"] {
  background:
    linear-gradient(180deg, rgba(48, 106, 120, 0.08), transparent 22%),
    linear-gradient(180deg, #f0f3f6 0%, #e8ecf0 100%);
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 24px 0;
  background: transparent;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(22, 29, 36, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .nav-inner {
  background: rgba(255, 255, 255, 0.92);
}

.nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-soft);
  padding: 8px 12px;
  border-radius: 10px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav a:hover {
  background: rgba(48, 106, 120, 0.18);
  color: var(--brand-white);
}

main {
  padding: 24px;
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  background: rgba(22, 29, 36, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .searchbar,
html[data-theme="light"] .hero-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .queue-card,
html[data-theme="light"] .opportunity-row,
html[data-theme="light"] .card {
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

html[data-theme="light"] .logo-wrap {
  background: var(--surface-2);
}

.brand-logo {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.brand-copy h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #5dbb7b;
  box-shadow: 0 0 0 4px rgba(93, 187, 123, 0.12);
}

.status-dot.warning {
  background: #d5a85c;
  box-shadow: 0 0 0 4px rgba(213, 168, 92, 0.12);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(22, 29, 36, 0.96);
  box-shadow: var(--shadow-sm);
}

.search-icon {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  max-width: 24rem;
  border: 1px solid var(--border);
  outline: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 10px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  color-scheme: dark;
}

html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: var(--surface-2);
  color-scheme: light;
}

select option,
select optgroup {
  background: var(--surface-2);
  color: var(--text);
}

.searchbar input {
  max-width: none;
  border: 0;
  background: transparent;
  padding: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(48, 106, 120, 0.65);
  box-shadow: 0 0 0 3px rgba(48, 106, 120, 0.18);
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-soft);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn,
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn:hover,
.mini-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-primary,
.mini-btn.primary {
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--brand-white);
}

.btn-primary:hover,
.mini-btn.primary:hover {
  background: linear-gradient(180deg, #4b92a3, var(--primary-hover));
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.summary-row {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 18px;
}

.hero-card,
.metric-card,
.panel,
.queue-card,
.opportunity-row,
.card {
  border: 1px solid var(--border);
  background: rgba(22, 29, 36, 0.96);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 146px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 106, 120, 0.16), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 700;
}

.hero-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 62ch;
}

.hero-banner {
  margin-top: 14px;
  width: fit-content;
}

.metric-card {
  padding: 18px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.metric-value {
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1;
  margin: 12px 0 10px;
}

.metric-foot {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.metric-foot.good {
  color: #8cbf5d;
}

.metric-foot.attn {
  color: #d5a85c;
}

.content-grid {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 18px;
  align-items: start;
}

.left-column,
.center-column,
.right-column {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

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

.panel-header h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
}

.panel-subtext {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
  line-height: 1.45;
}

.linkish {
  color: #a8bdc6;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

html[data-theme="light"] .linkish {
  color: var(--primary);
}

.queue-list,
.task-list,
.source-list,
.insight-list,
.section-block {
  display: grid;
  gap: 12px;
}

.queue-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

html[data-theme="light"] .queue-card,
html[data-theme="light"] .opportunity-row {
  background: var(--surface-2);
}

.queue-card:hover,
.opportunity-row:hover,
.card:hover,
.source-item:hover,
.task-item:hover,
.insight-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.queue-title {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.35;
}

.priority-badge,
.stage-badge,
.badge,
.badge-status,
.tag,
.score,
.small-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 9px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.priority-badge.high {
  background: rgba(132, 32, 54, 0.18);
  color: #e2a8b5;
  border-color: rgba(132, 32, 54, 0.28);
}

.priority-badge.medium {
  background: rgba(183, 144, 58, 0.18);
  color: #e4c382;
  border-color: rgba(183, 144, 58, 0.28);
}

.priority-badge.good {
  background: rgba(111, 157, 47, 0.18);
  color: #c0dc89;
  border-color: rgba(111, 157, 47, 0.28);
}

.badge {
  background: rgba(132, 32, 54, 0.18);
  color: #f0b7c4;
  border-color: rgba(132, 32, 54, 0.28);
}

.badge-status,
.stage-badge.review {
  background: rgba(48, 106, 120, 0.16);
  color: #b4d3da;
  border-color: rgba(48, 106, 120, 0.28);
  text-transform: capitalize;
}

.stage-badge.drafting {
  background: rgba(183, 144, 58, 0.16);
  color: #e4c382;
  border-color: rgba(183, 144, 58, 0.28);
}

.stage-badge.submitted {
  background: rgba(111, 157, 47, 0.16);
  color: #c0dc89;
  border-color: rgba(111, 157, 47, 0.28);
}

.queue-meta,
.contract-meta,
.opp-sub,
.empty-message,
.footer-note {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.queue-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-controls {
  align-items: end;
}

.filter-control span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-control select {
  max-width: 11rem;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.chip:hover,
.chip.active {
  background: rgba(48, 106, 120, 0.18);
  border-color: rgba(48, 106, 120, 0.3);
  color: var(--brand-white);
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.checkbox-chip input,
.checkbox-group input {
  width: auto;
  max-width: none;
}

.opportunity-table {
  display: grid;
  gap: 10px;
}

.opportunity-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) 120px 120px 120px 90px 110px 130px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.opportunity-link {
  text-decoration: none;
}

.opportunity-head {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 12px;
  padding-bottom: 12px;
}

.sort-header {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.sort-header:hover,
.sort-header:focus-visible {
  color: var(--ink);
}

.sort-header:focus-visible {
  outline: 2px solid rgba(64, 145, 163, 0.45);
  outline-offset: 4px;
  border-radius: 8px;
}

.sort-indicator {
  color: var(--accent);
  font-size: 0.82rem;
  line-height: 1;
}

.opp-main {
  min-width: 0;
}

.opp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.opp-title {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.35;
}

.fit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.fit-badge.potential {
  background: rgba(183, 144, 58, 0.16);
  color: #e4c382;
  border-color: rgba(183, 144, 58, 0.28);
}

.fit-badge.strong {
  background: rgba(111, 157, 47, 0.18);
  color: #cce69d;
  border-color: rgba(111, 157, 47, 0.3);
}

.opp-sub {
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.opp-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag {
  background: rgba(151, 184, 58, 0.14);
  color: #d8e9a9;
  border-color: rgba(151, 184, 58, 0.28);
}

.opp-cell {
  font-size: 0.87rem;
  color: var(--text-soft);
}

.score {
  min-width: 58px;
  background: rgba(48, 106, 120, 0.16);
  color: #b4d3da;
  border-color: rgba(48, 106, 120, 0.28);
}

.card {
  padding: 1rem 1.1rem;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.contract-summary {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-item,
.source-item,
.insight-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

html[data-theme="light"] .task-item,
html[data-theme="light"] .source-item,
html[data-theme="light"] .insight-item {
  background: var(--surface-2);
}

.clickable-panel {
  cursor: pointer;
}

.active-quick-filter {
  border-color: rgba(48, 106, 120, 0.4);
  background: rgba(48, 106, 120, 0.14);
  box-shadow: var(--shadow-sm);
}

.task-item strong,
.source-item strong,
.insight-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.task-item span,
.source-item span,
.insight-item span {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.small-box {
  min-width: 58px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
}

.access-card {
  display: grid;
  gap: 14px;
}

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

.access-summary > div {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(48, 106, 120, 0.08);
}

html[data-theme="light"] .access-summary > div {
  background: rgba(48, 106, 120, 0.06);
}

.access-summary strong,
.access-summary span {
  display: block;
}

.access-summary strong {
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.1;
}

.access-summary span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 5px;
  text-transform: uppercase;
}

.check {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  margin-top: 2px;
}

.task-flex {
  display: flex;
  gap: 10px;
}

.trend-up {
  color: #b7d977;
  font-weight: 700;
  font-size: 1rem;
}

.trend-down {
  color: #d593a1;
  font-weight: 700;
  font-size: 1rem;
}

.new-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(132, 32, 54, 0.12);
  border: 1px solid rgba(132, 32, 54, 0.28);
  border-radius: 999px;
  color: #f0b7c4;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.badge-pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.pager {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
}

.detail-section {
  margin-bottom: 1.25rem;
}

.detail-section h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0;
}

.detail-section p,
.detail-section div {
  margin: 0;
  font-size: 0.95rem;
}

.settings-form {
  max-width: 32rem;
}

.settings-subheading {
  margin: 0 0 0.35rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 1400px) {
  .summary-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .hero-card {
    grid-column: span 3;
  }

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

@media (max-width: 1100px) {
  .opportunity-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .opportunity-head {
    display: none;
  }
}

@media (max-width: 860px) {
  main,
  .nav {
    padding: 14px;
  }

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

  .summary-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand {
    width: 100%;
  }
}
/* =========================================================
   Responsive layout repair - dashboard squeeze / overflow
   Test patch added 2026-04-25
   ========================================================= */

html,
body {
  overflow-x: hidden;
}

main {
  width: 100%;
  min-width: 0;
  padding: clamp(14px, 2vw, 24px);
}

.app-shell {
  width: 100%;
  max-width: var(--max-width);
  min-width: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
  align-items: start;
}

.left-column,
.center-column,
.right-column,
.panel,
.opportunity-table {
  min-width: 0;
}

.panel:has(.opportunity-table) {
  overflow: visible;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.topbar {
  flex-wrap: wrap;
}

.brand {
  flex: 1 1 420px;
}

.topbar-actions {
  flex: 0 1 auto;
}

@media (max-width: 1350px) {
  .content-grid {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }

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

  .opportunity-table {
    overflow-x: auto;
  }

  .opportunity-row {
    min-width: 980px;
  }
}

@media (max-width: 1250px) {
  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1050px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .left-column,
  .right-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 760px) {
  .topbar-actions {
    width: 100%;
  }

  .status-pill {
    flex: 1 1 auto;
  }

  .opportunity-head {
    display: none;
  }

  .opportunity-row {
    min-width: 0;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .summary-row {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-column: auto;
  }
}

/* =========================================================
   Dashboard facelift
   ========================================================= */

html[data-theme="light"] {
  --bg: #f4f7fa;
  --bg-2: #edf2f6;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: #f8fafc;
  --surface-3: #eef4f8;
  --border: rgba(30, 55, 68, 0.08);
  --border-strong: rgba(30, 55, 68, 0.16);
  --text: #14242d;
  --text-soft: #394f5b;
  --text-muted: #71828c;
  --shadow-sm: 0 8px 22px rgba(23, 45, 58, 0.06);
  --shadow-md: 0 18px 42px rgba(23, 45, 58, 0.1);
  --shadow-lg: 0 24px 58px rgba(23, 45, 58, 0.14);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(48, 106, 120, 0.16), transparent 26rem),
    radial-gradient(circle at 86% 18%, rgba(151, 184, 58, 0.12), transparent 24rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.nav {
  padding: 14px 24px 0;
}

.nav-inner,
.topbar,
.hero-card,
.metric-card,
.panel,
.queue-card,
.opportunity-row,
.task-item,
.source-item,
.insight-item {
  backdrop-filter: blur(16px);
}

.nav-inner {
  border-radius: 18px;
}

.topbar {
  padding: 16px 18px;
  background: rgba(22, 29, 36, 0.82);
}

html:not([data-theme="dark"]) .topbar,
html:not([data-theme="dark"]) .nav-inner,
html[data-theme="light"] .topbar,
html[data-theme="light"] .nav-inner {
  background: rgba(255, 255, 255, 0.86);
}

.brand-copy h1 {
  font-size: clamp(1.18rem, 1.1vw + 0.8rem, 1.55rem);
}

.topbar-actions {
  justify-content: flex-end;
}

.topbar-search {
  width: min(32vw, 420px);
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

html:not([data-theme="dark"]) .topbar-search,
html[data-theme="light"] .topbar-search {
  background: #f9fbfc;
}

.topbar-search input {
  max-width: none;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-search input:focus {
  box-shadow: none;
}

html:not([data-theme="dark"]) input[type="text"],
html:not([data-theme="dark"]) input[type="email"],
html:not([data-theme="dark"]) input[type="tel"],
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) select {
  background: var(--surface-2);
  color-scheme: light;
}

.dashboard-section-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-row {
  grid-template-columns: minmax(320px, 1.8fr) repeat(4, minmax(155px, 1fr));
  gap: 16px;
}

.hero-card {
  min-height: 218px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 22px;
  background:
    linear-gradient(105deg, rgba(22, 29, 36, 0.96), rgba(26, 39, 48, 0.88)),
    radial-gradient(circle at 80% 18%, rgba(151, 184, 58, 0.18), transparent 20rem);
}

html:not([data-theme="dark"]) .hero-card,
html[data-theme="light"] .hero-card {
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 252, 0.9)),
    radial-gradient(circle at 80% 16%, rgba(48, 106, 120, 0.14), transparent 20rem);
}

.hero-card::before {
  content: "";
  position: absolute;
  right: -7%;
  top: 8%;
  width: 56%;
  height: 78%;
  opacity: 0.28;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 13px, rgba(48, 106, 120, 0.55) 14px 15px);
  transform: rotate(-8deg);
  pointer-events: none;
}

.hero-card::after {
  right: -80px;
  top: -70px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(151, 184, 58, 0.18), transparent 68%);
}

.hero-ambient {
  position: absolute;
  inset: auto -10% -30% 45%;
  height: 70%;
  background: radial-gradient(circle, rgba(48, 106, 120, 0.2), transparent 65%);
  pointer-events: none;
}

.hero-card > *:not(.hero-ambient) {
  position: relative;
  z-index: 1;
}

.hero-card h2 {
  max-width: 18ch;
  font-size: clamp(1.8rem, 2.2vw, 2.7rem);
  letter-spacing: -0.045em;
}

.hero-card p {
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-banner {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(151, 184, 58, 0.3);
  background: rgba(151, 184, 58, 0.14);
  color: #d9e8ad;
  font-weight: 800;
  font-size: 0.84rem;
}

html:not([data-theme="dark"]) .hero-banner,
html[data-theme="light"] .hero-banner {
  color: #50680d;
}

.metric-card {
  min-height: 156px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(22, 29, 36, 0.82);
}

html:not([data-theme="dark"]) .metric-card,
html:not([data-theme="dark"]) .panel,
html:not([data-theme="dark"]) .queue-card,
html:not([data-theme="dark"]) .opportunity-row,
html:not([data-theme="dark"]) .task-item,
html:not([data-theme="dark"]) .source-item,
html:not([data-theme="dark"]) .insight-item,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .queue-card,
html[data-theme="light"] .opportunity-row,
html[data-theme="light"] .task-item,
html[data-theme="light"] .source-item,
html[data-theme="light"] .insight-item {
  background: rgba(255, 255, 255, 0.88);
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.metric-icon.blue {
  background: rgba(48, 106, 120, 0.16);
  color: #a9d2dc;
}

.metric-icon.green {
  background: rgba(69, 166, 114, 0.16);
  color: #9bddba;
}

.metric-icon.purple {
  background: rgba(129, 97, 184, 0.16);
  color: #c7b7ef;
}

.metric-icon.amber {
  background: rgba(213, 168, 92, 0.16);
  color: #efd095;
}

html:not([data-theme="dark"]) .metric-icon.blue,
html[data-theme="light"] .metric-icon.blue {
  color: var(--brand-blue);
}

html:not([data-theme="dark"]) .metric-icon.green,
html[data-theme="light"] .metric-icon.green {
  color: #297a52;
}

html:not([data-theme="dark"]) .metric-icon.purple,
html[data-theme="light"] .metric-icon.purple {
  color: #6550a4;
}

html:not([data-theme="dark"]) .metric-icon.amber,
html[data-theme="light"] .metric-icon.amber {
  color: #94681d;
}

.metric-value {
  font-size: clamp(2rem, 2.6vw, 2.75rem);
  letter-spacing: -0.045em;
}

.content-grid {
  grid-template-columns: minmax(250px, 305px) minmax(0, 1fr) minmax(280px, 340px);
}

.panel {
  border-radius: 18px;
}

.panel-header.compact {
  margin-bottom: 10px;
}

.filters {
  align-items: flex-end;
}

.filter-controls {
  width: 100%;
}

.filter-control {
  flex: 1 1 9.5rem;
}

.filter-control select {
  max-width: none;
}

.chip,
.checkbox-chip,
.btn,
.mini-btn {
  min-height: 38px;
}

.opportunity-row {
  border-radius: 15px;
}

.source-health-card {
  display: grid;
  gap: 14px;
}

.health-summary {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 18px;
  align-items: center;
}

.health-ring {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
}

.health-ring > div {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: var(--surface);
  line-height: 1.05;
}

.health-ring strong {
  display: block;
  font-size: 1.35rem;
}

.health-ring span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.health-legend {
  display: grid;
  gap: 9px;
}

.health-legend div,
.source-risk-head,
.source-risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.health-legend strong,
.source-risk-head strong {
  flex: 1;
  font-size: 0.86rem;
}

.health-legend span:last-child,
.source-risk-item strong {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.good {
  background: #45a672;
}

.legend-dot.warn {
  background: #d5a85c;
}

.legend-dot.bad {
  background: #cf526b;
}

.source-risk-list {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.source-risk-head {
  color: var(--text-muted);
}

.source-risk-item {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.88rem;
}

@media (max-width: 1450px) {
  .summary-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-search {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px;
  }

  .topbar-search {
    min-width: 0;
  }

  .summary-row,
  .right-column {
    grid-template-columns: 1fr;
  }

  .health-summary {
    grid-template-columns: 1fr;
  }

  .health-ring {
    margin: 0 auto;
  }

  .toolbar-actions .btn {
    width: 100%;
  }
}

/* =========================================================
   Dashboard polish pass - navigation, contrast, controls
   ========================================================= */

:root {
  --ink: #14242d;
  --ink-2: #243c49;
  --ink-3: #4f6570;
  --positive-strong: #276b43;
  --warning-strong: #8b5c14;
  --danger-strong: #a33a50;
  --focus-ring: 0 0 0 4px rgba(48, 106, 120, 0.16);
}

html[data-theme="dark"] {
  --ink: #f3f6f8;
  --ink-2: #d8e2e7;
  --ink-3: #a8b6be;
  --positive-strong: #a9d780;
  --warning-strong: #e5bf75;
  --danger-strong: #ef9caf;
  --focus-ring: 0 0 0 4px rgba(93, 187, 123, 0.16);
}

.site-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}

.side-rail {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px 16px;
  border-right: 1px solid rgba(30, 55, 68, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 10px 0 30px rgba(30, 55, 68, 0.045);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .side-rail {
  border-right-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 22, 28, 0.9);
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.22);
}

.side-brand {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.side-brand img {
  width: 126px;
  height: auto;
  display: block;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.side-nav a span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(48, 106, 120, 0.09);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.side-nav a:hover,
.side-nav a.active {
  background: rgba(48, 106, 120, 0.11);
  color: var(--ink);
  transform: translateX(2px);
}

.side-nav a.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.side-insight {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(48, 106, 120, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(48, 106, 120, 0.08), rgba(255, 255, 255, 0.6));
}

html[data-theme="dark"] .side-insight {
  background: linear-gradient(180deg, rgba(48, 106, 120, 0.16), rgba(255, 255, 255, 0.04));
}

.side-insight strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.side-insight span {
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.45;
}

.site-frame > main {
  min-width: 0;
  padding: clamp(18px, 2vw, 28px);
}

.app-shell {
  max-width: 1680px;
}

.topbar {
  box-shadow: 0 12px 32px rgba(30, 55, 68, 0.06);
}

.topbar .logo-wrap {
  display: none;
}

.brand-copy h1,
.hero-card h2,
.panel-header h3,
.metric-value,
.queue-title,
.opp-title,
.task-item strong,
.source-item strong,
.insight-item strong {
  color: var(--ink);
}

.brand-copy p,
.panel-subtext,
.metric-label,
.queue-meta,
.opp-sub,
.empty-message,
.footer-note,
.task-item span,
.source-item span,
.insight-item span,
.source-risk-head,
.source-risk-item {
  color: var(--ink-3);
}

.metric-label,
.filter-control span,
.dashboard-section-label,
.opportunity-head {
  font-weight: 850;
}

.metric-foot.good,
.trend-up {
  color: var(--positive-strong);
  font-weight: 800;
}

.metric-foot.attn,
.trend-down {
  color: var(--warning-strong);
  font-weight: 800;
}

.priority-badge.high {
  color: var(--danger-strong);
  background: rgba(132, 32, 54, 0.1);
}

.priority-badge.medium {
  color: var(--warning-strong);
  background: rgba(183, 144, 58, 0.12);
}

.topbar-search {
  position: relative;
  min-height: 44px;
  border-color: rgba(30, 55, 68, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.topbar-search:focus-within {
  border-color: rgba(48, 106, 120, 0.45);
  background: #ffffff;
  box-shadow: var(--focus-ring), 0 10px 24px rgba(30, 55, 68, 0.08);
  transform: translateY(-1px);
}

html[data-theme="dark"] .topbar-search:focus-within {
  background: rgba(255, 255, 255, 0.055);
}

.topbar-search input {
  color: var(--ink);
  caret-color: var(--primary);
  font-weight: 650;
}

.topbar-search input::placeholder {
  color: #6b7e89;
  opacity: 1;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.topbar-search input:focus::placeholder {
  color: transparent;
  opacity: 0;
}

.search-icon {
  color: var(--ink-3);
}

.topbar-search:focus-within .search-icon {
  color: var(--primary);
}

.search-clear {
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(48, 106, 120, 0.1);
  color: var(--primary);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
}

.btn,
.mini-btn,
.chip,
.checkbox-chip,
.focus-action,
.workflow-row {
  outline: none;
}

.btn:focus-visible,
.mini-btn:focus-visible,
.chip:focus-visible,
.checkbox-chip:focus-within,
.focus-action:focus-visible,
.workflow-row:focus-visible,
.side-nav a:focus-visible,
input:focus-visible,
select:focus-visible {
  box-shadow: var(--focus-ring);
}

.content-grid {
  grid-template-columns: minmax(252px, 300px) minmax(0, 1.35fr) minmax(285px, 340px);
}

.focus-panel {
  padding: 16px;
}

.focus-actions {
  display: grid;
  gap: 10px;
}

.focus-action {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "token title"
    "token detail";
  column-gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.84);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

html[data-theme="dark"] .focus-action {
  background: rgba(255, 255, 255, 0.035);
}

.focus-action:hover {
  transform: translateY(-1px);
  border-color: rgba(48, 106, 120, 0.26);
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

html[data-theme="dark"] .focus-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.focus-token {
  grid-area: token;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(48, 106, 120, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 900;
}

.focus-token.accent,
.focus-token.strong {
  color: var(--positive-strong);
  background: rgba(39, 107, 67, 0.11);
}

.focus-token.warn {
  color: var(--warning-strong);
  background: rgba(139, 92, 20, 0.11);
}

.focus-action strong {
  grid-area: title;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
}

.focus-action small {
  grid-area: detail;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 700;
}

.pipeline-card {
  display: grid;
  gap: 14px;
}

.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pipeline-stats div {
  min-width: 0;
  padding: 11px 9px;
  border-radius: 14px;
  background: rgba(48, 106, 120, 0.08);
}

.pipeline-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.pipeline-stats span {
  display: block;
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.workflow-bars {
  display: grid;
  gap: 10px;
}

.workflow-row {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workflow-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workflow-row strong {
  color: var(--ink-2);
  font-size: 0.84rem;
}

.workflow-row span {
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 750;
}

.workflow-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(48, 106, 120, 0.09);
}

.workflow-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #68a9b6);
}

.opportunity-table {
  gap: 8px;
}

.opportunity-row {
  box-shadow: none;
}

.opportunity-link:hover {
  background: #ffffff;
}

html[data-theme="dark"] .opportunity-link:hover {
  background: rgba(255, 255, 255, 0.055);
}

.opp-cell,
.score,
.small-box,
.stage-badge,
.fit-badge,
.tag {
  font-weight: 800;
}

.tag {
  color: #385614;
  background: rgba(151, 184, 58, 0.2);
}

.score,
.stage-badge.review {
  color: #235d6b;
  background: rgba(48, 106, 120, 0.12);
}

@media (max-width: 1280px) {
  .site-frame {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .side-rail {
    padding: 14px 10px;
    align-items: center;
  }

  .side-brand img {
    width: 42px;
  }

  .side-nav a {
    width: 48px;
    justify-content: center;
    padding: 10px;
    font-size: 0;
  }

  .side-nav a span {
    margin: 0;
  }

  .side-nav .nav-tag {
    display: none;
  }

  .side-insight {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-frame {
    display: block;
  }

  .side-rail {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .side-brand {
    min-height: 0;
    flex: 0 0 auto;
  }

  .side-nav {
    display: flex;
    min-width: max-content;
  }

  .side-nav a {
    width: auto;
    font-size: 0.82rem;
  }

  .side-insight {
    display: none;
  }

  .site-frame > main {
    padding: 14px;
  }

  .topbar .brand {
    flex-basis: 100%;
  }

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

/* =========================================================
   Opportunity register badge and spacing refinements
   ========================================================= */

.nav-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(48, 106, 120, 0.16);
  background: rgba(48, 106, 120, 0.09);
  color: #235d6b;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-insight .nav-tag {
  margin-left: 6px;
  background: rgba(129, 97, 184, 0.11);
  color: #5c4793;
}

html[data-theme="dark"] .nav-tag {
  border-color: rgba(104, 169, 182, 0.32);
  background: rgba(104, 169, 182, 0.16);
  color: #c6ecf2;
}

html[data-theme="dark"] .side-insight .nav-tag {
  background: rgba(179, 158, 231, 0.18);
  color: #e0d5ff;
}

.center-column > .panel:has(.opportunity-table) {
  min-width: min(100%, 720px);
}

.opportunity-table {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(48, 106, 120, 0.34) transparent;
}

.opportunity-row {
  grid-template-columns:
    minmax(320px, 1.65fr)
    minmax(136px, 0.72fr)
    minmax(116px, 0.56fr)
    minmax(116px, 0.56fr)
    minmax(82px, 0.42fr)
    minmax(88px, 0.44fr)
    minmax(104px, 0.48fr);
  gap: 16px;
  min-width: 1040px;
  padding: 16px 18px;
}

.opportunity-head {
  position: sticky;
  left: 0;
  z-index: 1;
}

.opp-title-row {
  align-items: flex-start;
}

.opp-title {
  overflow-wrap: anywhere;
}

.opp-tags {
  gap: 8px;
  align-items: flex-start;
}

.tag,
.fit-badge {
  min-height: 28px;
  line-height: 1.15;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.tag {
  max-width: 100%;
  justify-content: flex-start;
  padding: 7px 11px;
  border-color: rgba(77, 106, 20, 0.24);
  background: #e7f2cc;
  color: #365111;
  white-space: normal;
  overflow-wrap: anywhere;
}

.fit-badge.potential {
  border-color: rgba(139, 92, 20, 0.24);
  background: #f8ecd5;
  color: #70490f;
}

.fit-badge.strong {
  border-color: rgba(39, 107, 67, 0.24);
  background: #dff0e7;
  color: #205a39;
}

html[data-theme="dark"] .tag {
  border-color: rgba(196, 230, 139, 0.34);
  background: rgba(196, 230, 139, 0.18);
  color: #e5f6c3;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .fit-badge.potential {
  border-color: rgba(244, 204, 137, 0.36);
  background: rgba(183, 144, 58, 0.22);
  color: #ffe2a8;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .fit-badge.strong {
  border-color: rgba(171, 225, 148, 0.38);
  background: rgba(111, 157, 47, 0.24);
  color: #daf4b5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1500px) {
  .content-grid {
    grid-template-columns: minmax(240px, 285px) minmax(0, 1fr);
  }

  .center-column {
    grid-column: 1 / -1;
    order: -1;
  }

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

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

  .center-column > .panel:has(.opportunity-table) {
    min-width: 0;
  }
}

@media (max-width: 1120px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .center-column {
    order: -1;
  }

  .left-column,
  .right-column {
    grid-template-columns: 1fr;
  }

  .opportunity-row {
    min-width: 980px;
  }
}

@media (max-width: 720px) {
  .opportunity-table {
    overflow: visible;
  }

  .opportunity-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 15px;
  }

  .opp-tags {
    gap: 6px;
  }

  .tag {
    width: 100%;
  }
}

/* Final register layout authority: avoid legacy overflow/min-width clipping. */
.opportunity-register-panel {
  overflow: visible;
}

.opportunity-register-panel .opportunity-table {
  width: 100%;
  overflow: visible;
  padding-bottom: 0;
}

.opportunity-register-panel .opportunity-row {
  width: 100%;
  min-width: 0;
  grid-template-columns:
    minmax(250px, 2.25fr)
    minmax(112px, 0.86fr)
    minmax(82px, 0.55fr)
    minmax(82px, 0.55fr)
    minmax(74px, 0.45fr)
    minmax(60px, 0.35fr)
    minmax(64px, 0.38fr);
  gap: 12px;
  overflow: hidden;
}

.opportunity-register-panel .opportunity-row > *,
.opportunity-register-panel .opp-main,
.opportunity-register-panel .opp-cell {
  min-width: 0;
}

.opportunity-register-panel .opportunity-head .sort-header {
  all: unset;
  box-sizing: border-box;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  font: inherit;
  letter-spacing: inherit;
  line-height: 1.1;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.opportunity-register-panel .opportunity-head {
  align-items: center;
}

.opportunity-register-panel .opportunity-head > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-register-panel .opportunity-head .sort-header span:first-child {
  white-space: normal;
  overflow-wrap: normal;
  line-height: 1.05;
}

.opportunity-register-panel .opportunity-head .sort-header:hover,
.opportunity-register-panel .opportunity-head .sort-header:focus-visible {
  color: var(--ink);
}

.opportunity-register-panel .opportunity-head .sort-header:focus-visible {
  border-radius: 7px;
  box-shadow: var(--focus-ring);
}

.opportunity-register-panel .opportunity-head .sort-indicator {
  color: var(--primary);
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  min-width: 0.7em;
}

.opportunity-register-panel .opportunity-row > div:nth-child(5),
.opportunity-register-panel .opportunity-row > div:nth-child(6),
.opportunity-register-panel .opportunity-row > div:nth-child(7),
.opportunity-register-panel .opportunity-head > :nth-child(5),
.opportunity-register-panel .opportunity-head > :nth-child(6),
.opportunity-register-panel .opportunity-head > :nth-child(7) {
  justify-self: center;
  text-align: center;
}

.opportunity-register-panel .score,
.opportunity-register-panel .stage-badge,
.opportunity-register-panel .fit-badge {
  max-width: 100%;
}

.opportunity-register-panel .score {
  justify-content: center;
  min-width: 48px;
  padding-inline: 7px;
  white-space: nowrap;
}

.opportunity-register-panel .stage-badge {
  justify-content: center;
  min-width: 48px;
  padding-inline: 8px;
  white-space: nowrap;
}

@media (max-width: 1680px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .center-column {
    grid-column: 1 / -1;
    order: -1;
  }

  .left-column,
  .right-column {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .left-column,
  .right-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .opportunity-register-panel .opportunity-table {
    display: grid;
    gap: 12px;
  }

  .opportunity-register-panel .opportunity-head {
    display: none;
  }

  .opportunity-register-panel .opportunity-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .opportunity-register-panel .opp-cell,
  .opportunity-register-panel .opportunity-row > div:not(.opp-main) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(2)::before {
    content: "Source";
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(3)::before {
    content: "Posted";
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(4)::before {
    content: "Due";
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(5)::before {
    content: "Match";
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(6)::before {
    content: "Assignee";
  }

  .opportunity-register-panel .opportunity-row > div:nth-child(7)::before {
    content: "Stage";
  }

  .opportunity-register-panel .opportunity-row > div::before {
    color: var(--ink-3);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}



