:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-soft: #0b0f15;
  --sidebar: rgba(8, 11, 16, 0.94);
  --panel: rgba(15, 20, 28, 0.82);
  --panel-solid: #10151d;
  --panel-hover: rgba(22, 29, 39, 0.92);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f7fa;
  --text-soft: #aab4c1;
  --text-muted: #687483;
  --gold: #d8b56f;
  --gold-bright: #f1d497;
  --green: #4dd8a4;
  --green-soft: rgba(77, 216, 164, 0.12);
  --cyan: #63c9dc;
  --red: #ff7b7b;
  --amber: #eeb86a;
  --blue: #7b9cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-small: 11px;
  --sidebar-width: 264px;
  --topbar-height: 72px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.ambient--one {
  top: -300px;
  left: 20%;
  width: 720px;
  height: 620px;
  background: radial-gradient(circle, rgba(66, 114, 121, 0.13), transparent 68%);
}

.ambient--two {
  right: -260px;
  bottom: -300px;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(131, 102, 52, 0.1), transparent 70%);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 18px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(216, 181, 111, 0.46);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(216, 181, 111, 0.2), rgba(216, 181, 111, 0.04));
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 22px;
}

.brand div:last-child {
  display: grid;
  gap: 2px;
}

.brand strong {
  letter-spacing: 0.2em;
  font-size: 13px;
}

.brand span {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-switcher {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.workspace-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.workspace-switcher div {
  display: grid;
  gap: 2px;
}

.workspace-switcher small {
  color: var(--text-muted);
  font-size: 10px;
}

.workspace-switcher strong {
  font-size: 12px;
  font-weight: 650;
}

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

.primary-nav {
  margin-top: 22px;
}

.nav-label {
  margin: 18px 10px 8px;
  color: #53606f;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #7e8997;
  text-align: left;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item--active {
  background:
    linear-gradient(90deg, rgba(216, 181, 111, 0.13), rgba(216, 181, 111, 0.03));
  color: var(--gold-bright);
}

.nav-item--active::before {
  position: absolute;
  left: -18px;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: var(--gold);
  content: "";
}

.nav-index {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  color: #4f5b69;
  font-size: 9px;
}

.nav-item--active .nav-index {
  color: var(--gold);
}

.nav-item > span:nth-child(2) {
  font-size: 12px;
  font-weight: 570;
}

.nav-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 9px;
  text-align: center;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(238, 184, 106, 0.6);
}

.system-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(77, 216, 164, 0.13);
  border-radius: 13px;
  background:
    linear-gradient(150deg, rgba(77, 216, 164, 0.07), rgba(255, 255, 255, 0.018));
}

.system-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
}

.live-indicator::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  content: "";
}

.system-card strong {
  display: block;
  margin-top: 10px;
  font-size: 12px;
}

.system-card p {
  margin: 5px 0 10px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.system-meter {
  height: 3px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.system-meter span {
  display: block;
  width: 92%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 5px 0;
  border-top: 1px solid var(--border);
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #293545, #161d27);
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 750;
}

.sidebar-user > div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.sidebar-user strong {
  font-size: 10px;
}

.sidebar-user span {
  color: var(--text-muted);
  font-size: 9px;
}

.sidebar-user button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.sidebar-backdrop {
  display: none;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  height: var(--topbar-height);
  grid-template-columns: minmax(230px, 1fr) minmax(260px, 430px) auto;
  align-items: center;
  gap: 24px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: blur(24px);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.breadcrumbs span,
.breadcrumbs b {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.breadcrumbs strong {
  font-size: 11px;
  font-weight: 650;
}

.global-search {
  display: grid;
  height: 38px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.global-search:focus-within {
  border-color: rgba(216, 181, 111, 0.42);
  background: rgba(255, 255, 255, 0.04);
}

.global-search > span {
  color: var(--text-muted);
  font-size: 18px;
}

.global-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.global-search input::placeholder {
  color: #566170;
}

kbd {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 8px;
}

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

.market-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.market-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(77, 216, 164, 0.7);
}

.market-status div {
  display: grid;
  gap: 1px;
}

.market-status small {
  color: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
}

.market-status strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.icon-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

.notification-button i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.mobile-menu {
  display: none;
}

.dashboard {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 32px 30px 50px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.eyebrow,
.panel-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(216, 181, 111, 0.7);
}

.page-heading h1 {
  margin: 9px 0 8px;
  font-size: clamp(29px, 3.2vw, 44px);
  font-weight: 540;
  letter-spacing: -0.045em;
}

.page-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.data-stamp {
  display: grid;
  margin-right: 8px;
  gap: 2px;
  text-align: right;
}

.data-stamp small {
  color: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
}

.data-stamp strong {
  font-size: 10px;
  font-weight: 600;
}

.button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.02em;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  border-color: rgba(216, 181, 111, 0.55);
  background: linear-gradient(145deg, #e2c17d, #b68a43);
  box-shadow: 0 10px 26px rgba(182, 138, 67, 0.16);
  color: #161109;
}

.button--primary:hover {
  background: linear-gradient(145deg, #efd396, #c89d55);
}

.button--secondary {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
}

.button--secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.button--full {
  width: 100%;
}

.focus-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 1px minmax(130px, 0.7fr) 1px minmax(130px, 0.7fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 13px 16px;
  border: 1px solid rgba(216, 181, 111, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(216, 181, 111, 0.065), rgba(255, 255, 255, 0.018));
}

.focus-strip div {
  display: grid;
  gap: 3px;
}

.focus-strip div span {
  color: var(--text-muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.focus-strip div strong {
  font-size: 11px;
}

.focus-strip__divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.focus-strip button {
  border: 0;
  background: transparent;
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 650;
}

.focus-strip button span {
  display: inline-block;
  margin-left: 6px;
  transition: transform 160ms ease;
}

.focus-strip button:hover span {
  transform: translateX(3px);
}

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

.metric-card,
.panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 44%),
    var(--panel);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px);
}

.metric-card {
  position: relative;
  min-height: 163px;
  padding: 17px 17px 0;
  overflow: hidden;
  border-radius: 15px;
}

.metric-card::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  content: "";
  pointer-events: none;
}

.metric-card--featured {
  border-color: rgba(216, 181, 111, 0.18);
  background:
    linear-gradient(145deg, rgba(216, 181, 111, 0.08), transparent 48%),
    var(--panel);
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--gold);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
}

.metric-value {
  margin-top: 14px;
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 540;
  letter-spacing: -0.045em;
}

.metric-value span {
  margin-left: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.metric-context {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.neutral {
  color: var(--cyan) !important;
}

.sparkline {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(285px, 0.68fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border-radius: var(--radius);
}

.valuation-panel {
  min-height: 442px;
  padding: 19px 20px 15px;
}

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

.panel-header h2 {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 590;
  letter-spacing: -0.02em;
}

.period-controls {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.period-controls button {
  min-width: 38px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
}

.period-controls button:hover {
  color: var(--text);
}

.period-controls button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-bright);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.chart-summary {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.chart-summary > div {
  display: grid;
  gap: 4px;
}

.chart-summary span {
  color: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
}

.chart-summary strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 570;
}

.chart-wrap {
  position: relative;
  height: 250px;
  margin-top: 6px;
}

#valuationChart {
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 104px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -110%);
  transition: opacity 100ms ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip span {
  display: block;
  color: var(--text-muted);
  font-family: inherit;
}

.chart-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 8px;
}

.chart-footer div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-footer > span:last-child {
  margin-left: auto;
}

.legend-mark {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 3px;
}

.legend-mark--primary {
  background: var(--gold);
}

.legend-mark--benchmark {
  background:
    repeating-linear-gradient(
      90deg,
      var(--text-muted) 0 3px,
      transparent 3px 5px
    );
}

.deal-snapshot {
  padding: 19px;
}

.risk-badge {
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.risk-badge--low {
  background: var(--green-soft);
  color: var(--green);
}

.risk-badge--moderate {
  background: rgba(238, 184, 106, 0.12);
  color: var(--amber);
}

.risk-badge--elevated {
  background: rgba(255, 123, 123, 0.12);
  color: var(--red);
}

.snapshot-price {
  display: grid;
  margin: 24px 0 17px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.snapshot-price span {
  color: var(--text-muted);
  font-size: 9px;
}

.snapshot-price strong {
  margin-top: 5px;
  font-size: 30px;
  font-weight: 540;
  letter-spacing: -0.045em;
}

.snapshot-price small {
  margin-top: 4px;
  color: var(--green);
  font-size: 9px;
}

.snapshot-list,
.profile-list {
  margin: 0;
}

.snapshot-list div,
.profile-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 31px;
}

.snapshot-list dt,
.profile-list dt {
  color: var(--text-muted);
  font-size: 9px;
}

.snapshot-list dd,
.profile-list dd {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  font-weight: 620;
}

.diligence-progress {
  margin-top: 17px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.diligence-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
}

.diligence-progress strong {
  color: var(--gold-bright);
}

.progress-track {
  height: 4px;
  margin: 10px 0 7px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 300ms ease;
}

.diligence-progress small {
  color: var(--text-muted);
  font-size: 8px;
}

.next-milestone {
  display: grid;
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(216, 181, 111, 0.07), transparent);
}

.next-milestone span {
  color: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
}

.next-milestone strong {
  margin-top: 5px;
  font-size: 10px;
}

.next-milestone small {
  margin-top: 3px;
  color: var(--gold);
  font-size: 8px;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 14px;
  margin-top: 14px;
}

.candidates-panel,
.pipeline-panel {
  min-height: 365px;
  padding: 19px;
}

.candidates-header {
  align-items: center;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-controls > span {
  color: var(--text-muted);
  font-size: 9px;
}

.table-controls select {
  height: 31px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #111720;
  color: var(--text-soft);
  font-size: 9px;
}

.table-scroll {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  height: 35px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  color: #596575;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

th:first-child,
th:nth-child(2) {
  text-align: left;
}

td {
  height: 51px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 9px;
  text-align: right;
}

td:first-child,
td:nth-child(2) {
  text-align: left;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr.selected {
  box-shadow: inset 2px 0 var(--gold);
}

.clinic-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.clinic-logo {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(145deg, #202b38, #111720);
  color: var(--gold-bright);
  font-size: 9px;
  font-weight: 750;
}

.clinic-cell div {
  display: grid;
  gap: 2px;
}

.clinic-cell strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.clinic-cell span {
  color: var(--text-muted);
  font-size: 8px;
}

.stage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 8px;
  font-weight: 650;
}

.stage::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.stage--diligence {
  background: rgba(99, 201, 220, 0.1);
  color: var(--cyan);
}

.stage--loi {
  background: var(--green-soft);
  color: var(--green);
}

.stage--screening {
  background: rgba(123, 156, 255, 0.1);
  color: var(--blue);
}

.score {
  color: var(--gold-bright);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  display: grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
}

.row-action:hover,
.row-action.active {
  border-color: rgba(216, 181, 111, 0.35);
  background: rgba(216, 181, 111, 0.08);
  color: var(--gold-bright);
}

.empty-state {
  height: 130px;
  color: var(--text-muted);
  text-align: center !important;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 9px;
}

.pipeline-list {
  display: grid;
  gap: 17px;
  margin-top: 23px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.pipeline-row__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 9px;
}

.pipeline-row__label strong {
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
}

.pipeline-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.pipeline-bar span {
  display: block;
  width: var(--pipeline-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pipeline-color), transparent 150%);
}

.pipeline-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.pipeline-footer div {
  display: grid;
  gap: 5px;
}

.pipeline-footer span {
  color: var(--text-muted);
  font-size: 8px;
}

.pipeline-footer strong {
  font-size: 14px;
  font-weight: 580;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #0d1219;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(2, 4, 7, 0.78);
  backdrop-filter: blur(10px);
}

.dialog-shell {
  padding: 24px;
}

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

.dialog-header h2 {
  margin: 6px 0 4px;
  font-size: 25px;
  font-weight: 540;
  letter-spacing: -0.035em;
}

.dialog-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
}

.dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 18px;
}

.dialog-scorecard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 22px;
}

.dialog-scorecard > div {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.dialog-scorecard span,
.scenario-result > span {
  color: var(--text-muted);
  font-size: 8px;
  text-transform: uppercase;
}

.dialog-scorecard strong {
  font-size: 15px;
  font-weight: 570;
}

.dialog-columns {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 28px;
  margin-top: 24px;
}

.investment-thesis {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.75;
}

.dialog-columns h3 {
  margin: 20px 0 10px;
  font-size: 11px;
}

.signal-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  position: relative;
  padding-left: 17px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.signal-list li::before {
  position: absolute;
  top: 5px;
  left: 1px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--green);
  border-radius: 50%;
  content: "";
}

.profile-list {
  margin-top: 12px;
}

.profile-list div {
  min-height: 35px;
  border-bottom: 1px solid var(--border);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.scenario-dialog {
  width: min(680px, calc(100vw - 28px));
}

.scenario-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-top: 25px;
}

.scenario-inputs {
  display: grid;
  gap: 20px;
}

.scenario-inputs label {
  display: grid;
  gap: 10px;
}

.scenario-inputs label > span {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 10px;
}

.scenario-inputs output {
  color: var(--gold-bright);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  appearance: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  accent-color: var(--gold);
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: 2px solid #0d1219;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold);
}

.scenario-result {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(216, 181, 111, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(216, 181, 111, 0.08), transparent),
    rgba(255, 255, 255, 0.02);
}

.scenario-result > strong {
  margin: 8px 0 20px;
  color: var(--gold-bright);
  font-size: 30px;
  font-weight: 540;
}

.scenario-result div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
}

.scenario-result b {
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.toast {
  position: fixed;
  z-index: 100;
  top: 88px;
  right: 22px;
  display: grid;
  min-width: 300px;
  max-width: calc(100vw - 30px);
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(14, 19, 26, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
}

.toast strong {
  font-size: 10px;
}

.toast p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 9px;
}

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

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

  .analysis-grid,
  .operations-grid {
    grid-template-columns: 1fr;
  }

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

  .deal-snapshot .panel-header,
  .deal-snapshot .button {
    grid-column: 1 / -1;
  }

  .next-milestone {
    align-self: end;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(0, 0, 0, 0.58);
  }

  .sidebar-backdrop.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 18px;
  }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .mobile-menu span {
    width: 15px;
    height: 1px;
    background: currentColor;
  }

  .breadcrumbs {
    display: none;
  }

  .global-search {
    width: min(430px, 100%);
  }
}

@media (max-width: 680px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .market-status {
    display: none;
  }

  .global-search kbd {
    display: none;
  }

  .dashboard {
    padding: 24px 14px 36px;
  }

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

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .data-stamp {
    width: 100%;
    margin: 0 0 4px;
    text-align: left;
  }

  .page-actions .button {
    flex: 1;
  }

  .focus-strip {
    grid-template-columns: 1fr 1fr;
  }

  .focus-strip__divider,
  .focus-strip button {
    display: none;
  }

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

  .chart-summary {
    gap: 18px;
    overflow-x: auto;
  }

  .chart-wrap {
    height: 210px;
  }

  .chart-footer > span:last-child {
    display: none;
  }

  .deal-snapshot {
    display: block;
  }

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

  .table-controls {
    width: 100%;
    justify-content: space-between;
  }

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

  .dialog-columns,
  .scenario-layout {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
