/* ===== legacy fallback styles ===== */
:root {
  --bg: #eef2f7;
  --bg-2: #f7f9fc;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: #ffffff;
  --panel-soft: #f3f6fa;
  --text: #101828;
  --text-2: #213043;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --navy: #0f172a;
  --teal: #0b6b72;
  --teal-2: #10b981;
  --blue: #2962ff;
  --green: #14b86a;
  --danger: #d92d20;
  --danger-soft: #fee4e2;
  --warning: #b54708;
  --warning-soft: #fff3d8;
  --success-soft: #dcfae6;
  --pill: #eef2ff;
  --pill-text: #3730a3;
  --surface: #f5f7fb;
  --max-width: 1600px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(41, 98, 255, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 28%),
    linear-gradient(180deg, #edf1f8 0%, #eef2f7 100%);
  color: var(--text);
}

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

a:hover {
  text-decoration: none;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 10px 0 34px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  box-shadow: 0 10px 24px rgba(11, 107, 114, 0.22);
}

.sidebar-brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.sidebar-brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.sidebar-group {
  display: grid;
  gap: 12px;
}

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

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a,
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  color: var(--text-2);
  font-weight: 600;
  transition: .2s ease;
}

.sidebar-nav a:hover,
.sidebar-logout:hover {
  background: rgba(15, 23, 42, 0.04);
}

.sidebar-nav a.is-active {
  background: linear-gradient(135deg, rgba(11, 107, 114, 0.12), rgba(16, 185, 129, 0.08));
  color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(11, 107, 114, 0.08);
}

.sidebar-tip-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #111827 0%, #172554 100%);
  color: #fff;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.15);
}

.sidebar-tip-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.sidebar-tip-card p {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
}

.sidebar-tip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-meta {
  margin-top: auto;
}

.app-main {
  min-width: 0;
  padding: 24px;
}

.page-stack {
  display: grid;
  gap: 22px;
  width: min(var(--max-width), 100%);
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar-copy {
  max-width: 760px;
}

.topbar-kicker {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.topbar p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 760px;
}

.topbar-actions {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}

.topbar-search input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
}

.topbar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sidebar-toggle {
  display: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, .8);
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.chip-soft {
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-2);
}

.chip-dark {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.pill {
  background: var(--pill);
  color: var(--pill-text);
}

.pill-success {
  background: var(--success-soft);
  color: var(--green);
}

.pill-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.hero-grid,
.panel-grid,
.metrics-grid,
.company-stats-grid,
.company-list-grid,
.compare-grid,
.financial-trend-grid {
  display: grid;
  gap: 22px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .95fr);
}

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

.panel-grid.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-grid.secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.financial-trend-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-list-grid {
  grid-template-columns: 1fr;
}

.panel,
.login-card,
.hero-card,
.metric-card,
.compare-card,
.company-card,
.stat-card,
.surface-card {
  background: var(--panel);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
}

.panel,
.hero-card,
.compare-card,
.company-card,
.login-card,
.surface-card {
  padding: 26px;
}

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

.panel-header h2,
.section-head h2,
.card-head h2,
.hero-head h2,
.panel h3,
.hero-card h3 {
  margin: 0;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -0.03em;
}

.panel-description,
.section-head p,
.card-head p,
.compare-card-note,
.hero-copy p,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.meta-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hero-card.primary {
  background: linear-gradient(180deg, rgba(11, 107, 114, 0.96), rgba(18, 32, 49, 0.95));
  color: #fff;
  overflow: hidden;
  position: relative;
}

.hero-card.primary::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 106, .18), rgba(20, 184, 106, 0));
}

.hero-card.primary .hero-copy p,
.hero-card.primary .meta-label,
.hero-card.primary .muted {
  color: rgba(255, 255, 255, .78);
}

.hero-card.primary .topbar-kicker,
.hero-card.primary .chip-soft {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: none;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 720px;
  margin: 12px 0 0;
}

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

.hero-metric {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .10);
}

.hero-metric-label {
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-metric-value {
  margin-top: 8px;
  font-size: clamp(26px, 2vw, 38px);
  font-weight: 800;
}

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

.hero-foot-stat {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.hero-foot-stat .label {
  font-size: 12px;
  color: rgba(255, 255, 255, .62);
}

.hero-foot-stat .value {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
}

.filter-card,
.insight-card,
.metric-card,
.compare-card,
.company-kpi,
.sync-card,
.timeline-card {
  background: var(--panel-2);
}

.filter-card .panel-description {
  margin-top: 8px;
}

.insight-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: var(--shadow-soft);
}

.insight-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(41, 98, 255, .12), rgba(16, 185, 129, .14));
  color: var(--teal);
}

.insight-label {
  font-size: 13px;
  color: var(--muted);
}

.insight-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
}

.insight-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-filter-grid,
.filters-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.dashboard-filter-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

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

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

.filter-span-2 {
  grid-column: span 2;
}

.filters-actions,
.dashboard-filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  transition: .2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(41, 98, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(41, 98, 255, 0.08);
}

.period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-option {
  position: relative;
}

.chip-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  color: var(--text-2);
  font-weight: 700;
  cursor: pointer;
}

.chip-option.is-active span,
.chip-option input:checked+span {
  background: linear-gradient(135deg, rgba(11, 107, 114, 0.12), rgba(16, 185, 129, 0.14));
  color: var(--teal);
  border-color: rgba(11, 107, 114, 0.18);
}

.date-field.is-muted {
  opacity: .55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  border: none;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #0a7d86);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--text-2);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

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

.section-shell {
  display: grid;
  gap: 16px;
}

.section-head {
  margin-bottom: 2px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin-bottom: 8px;
}

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

.metric-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 98, 255, .08), rgba(41, 98, 255, 0));
}

.metric-card.success::after {
  background: radial-gradient(circle, rgba(20, 184, 106, .12), rgba(20, 184, 106, 0));
}

.metric-card.warning::after {
  background: radial-gradient(circle, rgba(181, 71, 8, .12), rgba(181, 71, 8, 0));
}

.metric-card.danger::after {
  background: radial-gradient(circle, rgba(217, 45, 32, .12), rgba(217, 45, 32, 0));
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-value {
  margin-top: 14px;
  font-size: clamp(28px, 2.5vw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.compare-card {
  display: grid;
  gap: 16px;
}

.compare-item {
  display: grid;
  gap: 8px;
}

.compare-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-size: 14px;
}

.compare-head strong {
  font-size: 13px;
}

.compare-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.compare-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a7d86, #16c79a);
}

.compare-bar.success span {
  background: linear-gradient(90deg, #0b6b72, #14b86a);
}

.compare-bar.info span {
  background: linear-gradient(90deg, #2962ff, #61a5ff);
}

.compare-bar.warning span {
  background: linear-gradient(90deg, #b54708, #f79009);
}

.table-shell,
.table-wrap {
  overflow-x: auto;
  border-radius: 22px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(15, 23, 42, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.data-table-card {
  padding: 0;
}

.table-panel-head {
  padding: 24px 24px 0;
}

.tag-row,
.role-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag,
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-warning,
.role-chip.missing {
  background: var(--warning-soft);
  color: var(--warning);
}

.tag-success,
.role-chip.ok {
  background: var(--success-soft);
  color: var(--green);
}

.tag-neutral {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-2);
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-item,
.timeline-item,
.activity-row,
.risk-item,
.company-row-card,
.company-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

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

.risk-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.risk-score {
  min-width: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  height: 44px;
}

.company-kpi {
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.company-kpi-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.company-kpi-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.account-hero {
  display: grid;
  gap: 22px;
}

.account-header-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
}

.account-identity {
  display: grid;
  gap: 18px;
}

.account-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.account-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-avatar {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  box-shadow: 0 16px 32px rgba(11, 107, 114, 0.18);
}

.owner-avatar.has-photo,
.owner-avatar-mini.has-photo,
.vf-chip-avatar.has-photo,
.user-avatar.has-photo {
  overflow: hidden;
  color: transparent;
  padding: 0;
  background: #fff !important;
}

.owner-avatar.has-photo img,
.owner-avatar-mini.has-photo img,
.vf-chip-avatar.has-photo img,
.user-avatar.has-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.account-title h2 {
  margin: 0;
  font-size: clamp(28px, 2.4vw, 38px);
  letter-spacing: -0.04em;
}

.account-subline {
  margin-top: 8px;
  color: var(--muted);
}

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

.account-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-tile {
  padding: 16px 18px;
  background: var(--panel-soft);
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.info-tile-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.info-tile-value {
  margin-top: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.account-side-column {
  display: grid;
  gap: 18px;
}

.snapshot-card {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, #121c31 0%, #0f172a 100%);
  color: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.snapshot-card .muted,
.snapshot-card p {
  color: rgba(255, 255, 255, .72);
}

.snapshot-metrics {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.snapshot-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.snapshot-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.contact-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
}

.contact-role {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}

.contact-card h3 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.contact-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  color: var(--text-2);
  line-height: 1.55;
}

.financial-trend-card {
  padding: 22px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 210px;
  margin-top: 18px;
}

.trend-bar-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.trend-bars.double .trend-bar-stack {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 160px;
}

.trend-bar-stack {
  display: grid;
  gap: 6px;
  align-items: end;
  height: 160px;
}

.trend-bar {
  width: 16px;
  min-height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.trend-bar.alt {
  background: var(--good);
}

.trend-bar.ghost {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.08));
}

.trend-year {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.trend-value {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
}

.legend-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.teal {
  background: var(--teal);
}

.legend-dot.blue {
  background: var(--blue);
}

.legend-dot.ghost {
  background: rgba(15, 23, 42, 0.18);
}

.kv-list {
  display: grid;
  gap: 10px;
}

.kv-list>div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.kv-list>div:last-child {
  border-bottom: none;
}

.json-box {
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: #09111f;
  color: #d8e3f4;
  max-height: 440px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.7;
}

details.details-card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

details.details-card summary {
  list-style: none;
  padding: 18px 22px;
  font-weight: 800;
  cursor: pointer;
}

details.details-card[open] summary {
  border-bottom: 1px solid var(--line);
}

details.details-card summary::-webkit-details-marker {
  display: none;
}

.details-content {
  padding: 20px 22px 22px;
}

.status-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-success {
  background: var(--success-soft);
  color: var(--green);
}

.status-failed,
.status-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-running {
  background: var(--warning-soft);
  color: var(--warning);
}

.sync-result {
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.sync-result.success {
  background: rgba(20, 184, 106, 0.08);
  border-color: rgba(20, 184, 106, 0.12);
}

.sync-result.error {
  background: rgba(217, 45, 32, 0.08);
  border-color: rgba(217, 45, 32, 0.12);
}

.sync-result h3 {
  margin: 0 0 12px;
}

.company-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, .8fr) minmax(220px, .8fr) auto;
  gap: 18px;
  align-items: center;
}

.company-row-main h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.company-row-main .subline {
  margin-top: 8px;
  color: var(--muted);
}

.company-row-meta,
.company-row-health {
  display: grid;
  gap: 8px;
}

.company-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

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

.summary-tile {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
}

.summary-tile .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.summary-tile .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.page-link {
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--text-2);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
}

.page-link.active {
  background: linear-gradient(135deg, var(--teal), #0a7d86);
  color: #fff;
  border: none;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(560px, 100%);
  padding: 34px;
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 1400px) {
  .company-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contacts-grid,
  .financial-trend-grid,
  .panel-grid.three-cols,
  .metrics-grid.four,
  .metrics-grid.secondary,
  .compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-110%);
    transition: transform .25s ease;
  }

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

  .sidebar-toggle {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-items: stretch;
  }

  .hero-grid,
  .panel-grid.two-cols,
  .account-header-card,
  .dashboard-filter-grid,
  .company-row-card {
    grid-template-columns: 1fr;
  }

  .company-row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-main {
    padding: 16px;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .hero-metrics,
  .hero-foot-grid,
  .summary-strip,
  .contacts-grid,
  .company-stats-grid,
  .metrics-grid.four,
  .metrics-grid.secondary,
  .compare-grid,
  .filters-grid,
  .panel-grid.three-cols,
  .financial-trend-grid {
    grid-template-columns: 1fr;
  }

  .filter-span-2 {
    grid-column: span 1;
  }

  .account-meta-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 14px 10px;
  }
}



@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif:ital@0;1&display=swap');

html,
body {
  min-height: 100%;
}

body.app-body {
  background: var(--bg);
  color: var(--ink);
}

.app-shell,
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar,
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-main,
.main {
  min-width: 0;
  max-width: none;
}

.page-stack {
  display: block;
}

.topbar-subtitle {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.55;
  max-width: 680px;
}

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

.sidebar-nav a {
  text-decoration: none;
}

.sidebar-nav a.is-active {
  background: var(--ink);
  color: var(--bg);
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cockpit-page {
  display: block;
}

.cockpit-two-up {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px;
}

.cockpit-two-up.narrow {
  grid-template-columns: 1.4fr 1fr;
}

.filter-pill-field select,
.filter-pill-field input {
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
  outline: none;
}

.filter-pill-field select {
  appearance: none;
  padding-right: 8px;
  cursor: pointer;
}

.filter-pill-field input {
  min-width: 118px;
}

.filter-pill-field {
  gap: 8px;
}

.page-index .page-stack {
  padding-bottom: 40px;
}

.page-index .topbar {
  margin-bottom: 20px;
}

.page-index .sidebar-toggle {
  display: none;
}

.empty-state {
  text-align: center;
  color: var(--ink-4);
  padding: 22px;
}

.small {
  color: var(--ink-4);
  font-size: 11.5px;
  margin-top: 4px;
  font-family: var(--mono);
}

.status-bar {
  display: flex;
  gap: 8px;
}

.table-wrap table a {
  color: inherit;
  text-decoration: none;
}

.table-wrap table a:hover {
  text-decoration: underline;
}

.topbar-actions a.icon-btn {
  text-decoration: none;
}

.page-index .search-box,
.page-companies .search-box,
.page-company .search-box,
.page-sync .search-box,
.page-sync_financial .search-box {
  width: 320px;
}

@media (max-width: 1400px) {

  .cockpit-two-up,
  .cockpit-two-up.narrow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {

  .app-shell,
  .shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar,
  .sidebar {
    display: none;
  }

  .app-main,
  .main {
    padding: 20px;
  }

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

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

  .topbar .search-box {
    width: 100%;
  }
}


/* ============================================================
   DESIGN TOKENS — 2026 Sales Cockpit
   Choice rationale:
   - Paper / ink base: warm cream (oklch) vs near-black for editorial calm
   - One electric accent (indigo-violet) drives focus. Semantic colors share chroma.
   - Instrument Serif (italic) for display numerals — makes numbers feel considered.
   - Geist for UI, Geist Mono for numerics where alignment matters.
   ============================================================ */
:root {
  /* PAPER THEME (default) */
  --bg: oklch(97.5% 0.008 80);
  --bg-grain: oklch(96.5% 0.010 80);
  --surface: oklch(99.2% 0.004 80);
  --surface-2: oklch(98% 0.006 80);
  --surface-sunk: oklch(95.5% 0.010 80);
  --ink: oklch(18% 0.015 270);
  --ink-2: oklch(32% 0.012 270);
  --ink-3: oklch(48% 0.010 270);
  --ink-4: oklch(62% 0.008 270);
  --ink-5: oklch(78% 0.006 270);
  --hairline: oklch(88% 0.008 270 / 0.7);
  --hairline-2: oklch(82% 0.010 270 / 0.5);

  /* Deep inverse surface */
  --deep: oklch(19% 0.020 270);
  --deep-2: oklch(23% 0.022 270);
  --deep-ink: oklch(96% 0.008 80);
  --deep-ink-2: oklch(78% 0.012 270);
  --deep-line: oklch(36% 0.020 270 / 0.5);

  /* Accent — electric indigo */
  --accent-h: 268;
  --accent: oklch(58% 0.22 var(--accent-h));
  --accent-2: oklch(68% 0.18 var(--accent-h));
  --accent-soft: oklch(94% 0.04 var(--accent-h));
  --accent-ink: oklch(42% 0.20 var(--accent-h));

  /* Semantic — shared chroma 0.16, varied hue */
  --good: oklch(62% 0.16 155);
  --good-soft: oklch(94% 0.05 155);
  --good-ink: oklch(38% 0.14 155);
  --warn: oklch(68% 0.16 72);
  --warn-soft: oklch(95% 0.06 72);
  --warn-ink: oklch(44% 0.14 72);
  --bad: oklch(60% 0.18 25);
  --bad-soft: oklch(94% 0.06 25);
  --bad-ink: oklch(42% 0.17 25);
  --info: oklch(62% 0.14 230);
  --info-soft: oklch(94% 0.04 230);

  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(20, 20, 32, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 20, 32, 0.04), 0 1px 2px rgba(20, 20, 32, 0.03);
  --shadow-md: 0 8px 24px -8px rgba(20, 20, 32, 0.10), 0 2px 4px rgba(20, 20, 32, 0.03);

  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --unit: 1;
  --sidebar-w: 248px;
}

/* GRAPHITE THEME */
[data-theme="graphite"] {
  --bg: oklch(94% 0.004 270);
  --bg-grain: oklch(92% 0.006 270);
  --surface: oklch(98% 0.003 270);
  --surface-2: oklch(96% 0.004 270);
  --surface-sunk: oklch(91% 0.006 270);
  --hairline: oklch(84% 0.008 270 / 0.7);
}

/* MIDNIGHT THEME */
[data-theme="midnight"] {
  --bg: oklch(15% 0.015 270);
  --bg-grain: oklch(17% 0.018 270);
  --surface: oklch(20% 0.018 270);
  --surface-2: oklch(23% 0.020 270);
  --surface-sunk: oklch(17% 0.016 270);
  --ink: oklch(96% 0.008 80);
  --ink-2: oklch(84% 0.012 270);
  --ink-3: oklch(70% 0.015 270);
  --ink-4: oklch(58% 0.014 270);
  --ink-5: oklch(40% 0.012 270);
  --hairline: oklch(32% 0.020 270 / 0.7);
  --hairline-2: oklch(38% 0.022 270 / 0.5);
  --deep: oklch(12% 0.020 270);
  --deep-2: oklch(16% 0.022 270);
  --accent-soft: oklch(32% 0.10 var(--accent-h));
  --accent-ink: oklch(78% 0.18 var(--accent-h));
  --good-soft: oklch(28% 0.08 155);
  --warn-soft: oklch(30% 0.09 72);
  --bad-soft: oklch(30% 0.10 25);
  --info-soft: oklch(28% 0.08 230);
}

/* DENSITY */
[data-density="compact"] {
  --unit: 0.82;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  background-image:
    radial-gradient(ellipse 1200px 800px at 0% 0%, oklch(from var(--accent) l c h / 0.025), transparent 60%),
    radial-gradient(ellipse 900px 600px at 100% 0%, oklch(from var(--good) l c h / 0.02), transparent 50%);
}

/* TYPE UTILS */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-feature-settings: "lnum";
}

.display-i {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.mono {
  font-family: var(--mono);
  font-feature-settings: "tnum", "zero";
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

/* SHELL */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: calc(22px * var(--unit)) calc(18px * var(--unit));
  border-right: 1px solid var(--hairline);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: calc(24px * var(--unit));
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, oklch(from var(--accent) l c h / 0.5), transparent 70%);
}

.brand-mark span {
  position: relative;
  z-index: 1;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

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

.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-5);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

.nav-item.active {
  background: var(--ink);
  color: var(--bg);
}

.nav-item.active .nav-count {
  background: oklch(from var(--bg) l c h / 0.18);
  color: var(--bg);
}

.nav-item i[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex-shrink: 0;
}

.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-3);
}

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

.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-sunk);
  border-radius: 10px;
  border: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-3);
}

.sync-pill .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 oklch(from var(--good) l c h / 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 oklch(from var(--good) l c h / 0.5);
  }

  70% {
    box-shadow: 0 0 0 8px oklch(from var(--good) l c h / 0);
  }

  100% {
    box-shadow: 0 0 0 0 oklch(from var(--good) l c h / 0);
  }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) l c calc(h + 30)));
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
}

.user-role {
  font-size: 11px;
  color: var(--ink-4);
}

/* MAIN */
.main {
  padding: calc(28px * var(--unit)) calc(36px * var(--unit)) calc(60px * var(--unit));
  min-width: 0;
  max-width: 1640px;
}

/* TOPBAR — merged page head */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}

.topbar-lead {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.crumbs i[data-lucide] {
  width: 10px;
  height: 10px;
  stroke-width: 2;
}

.crumbs .current {
  color: var(--ink-2);
}

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

.topbar-title {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}

.topbar-title em {
  font-style: normal;
  color: var(--accent);
}

.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 2px;
}

.topbar-date i[data-lucide] {
  width: 12px;
  height: 12px;
  stroke-width: 1.75;
}

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

.topbar-sep {
  width: 1px;
  height: 22px;
  background: var(--hairline);
  margin: 0 4px;
}

.btn.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn.btn-sm i[data-lucide] {
  width: 13px;
  height: 13px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  width: 320px;
  font-size: 13px;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
}

.search-box i[data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--ink-4);
  stroke-width: 1.75;
}

.kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  color: var(--ink-4);
  background: var(--surface-2);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
}

.icon-btn:hover {
  background: var(--surface-sunk);
}

.icon-btn i[data-lucide] {
  width: 15px;
  height: 15px;
  stroke-width: 1.75;
}

.icon-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--surface);
}

/* PAGE HEADER */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.page-title {
  font-family: var(--sans);
  font-size: clamp(32px, 3.2vw, 46px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 8px 0 0;
  color: var(--ink);
}

.page-title em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.page-sub {
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 580px;
  margin: 12px 0 0;
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 8px 10px 8px 14px;
  flex-wrap: wrap;
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.6) inset, 0 6px 20px -12px oklch(0% 0 0 / 0.18);
}

.filter-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  padding-right: 4px;
}

.filter-bar-label svg,
.filter-bar-label i[data-lucide] {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.seg {
  display: inline-flex;
  background: var(--surface-sunk);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 7px;
  transition: all .15s ease;
  letter-spacing: 0;
}

.seg button:hover {
  color: var(--ink);
}

.seg button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline), 0 2px 6px -3px oklch(0% 0 0 / 0.15);
}

.filter-div {
  width: 1px;
  height: 22px;
  background: var(--hairline);
  margin: 0 2px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 7px 11px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: var(--surface-sunk);
  border-color: var(--hairline);
  color: var(--ink);
}

.filter-pill i[data-lucide] {
  width: 13px;
  height: 13px;
  color: var(--ink-4);
  stroke-width: 2;
  flex-shrink: 0;
}

.filter-pill .chev {
  width: 12px;
  height: 12px;
  color: var(--ink-4);
  margin-left: 2px;
}

.filter-pill.with-value {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: oklch(from var(--accent) l c h / 0.18);
}

.filter-pill.with-value i[data-lucide] {
  color: var(--accent-ink);
}

.filter-pill.with-value .value-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 1px;
}

.filter-pill .clear-x {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: var(--accent-ink);
  opacity: 0.6;
  margin-left: 2px;
}

.filter-pill .clear-x:hover {
  opacity: 1;
  background: oklch(from var(--accent) l c h / 0.12);
}

/* Responsive: collapse text labels at narrower widths */
@media (max-width: 1280px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .filter-bar-label .label-text {
    display: none;
  }

  .filter-pill .label-text {
    display: none;
  }

  .filter-pill {
    padding: 7px 9px;
    gap: 6px;
  }

  .filter-pill .chev {
    display: none;
  }

  .filter-search {
    min-width: 140px;
  }

  .filter-search kbd {
    display: none;
  }

  .filter-actions-right .filter-pill .label-text {
    display: none;
  }
}

@media (max-width: 980px) {
  .filter-search {
    min-width: 44px;
    padding: 7px 9px;
  }

  .filter-search input {
    display: none;
  }
}

.filter-actions-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  background: var(--surface-sunk);
  border: 1px solid transparent;
  border-radius: 9px;
  min-width: 180px;
  transition: all .15s ease;
}

.filter-search:focus-within {
  background: var(--surface);
  border-color: oklch(from var(--accent) l c h / 0.3);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.08);
}

.filter-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  width: 100%;
}

.filter-search input::placeholder {
  color: var(--ink-4);
}

.filter-search i[data-lucide] {
  width: 13px;
  height: 13px;
  color: var(--ink-4);
}

.filter-search kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--ink-4);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
}

.btn:hover {
  background: var(--surface-sunk);
}

.btn i[data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--ink-2);
}

/* SECTIONS */
.section {
  margin-top: 44px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 4px 0 0;
  color: var(--ink);
}

.section-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 8px 0 0;
  max-width: 540px;
}

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.card-padded {
  padding: 24px;
}

.card-head {
  padding: 20px 24px 16px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}

.card-head h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 4px 0 0;
  color: var(--ink);
}

.card-head p {
  font-size: 13px;
  color: var(--ink-3);
  margin: 6px 0 0;
  line-height: 1.5;
  max-width: 440px;
}


/* ============================================================
   HERO RIBBON — horizontal stat strip, editorial & light
   ============================================================ */
.hero-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 28px;
  align-items: end;
  padding: 8px 4px 20px;
  border-bottom: 1px solid var(--hairline);
}

.hr-narrative {
  min-width: 0;
}

.hr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  margin-bottom: 14px;
}

.hr-eyebrow .live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px oklch(from var(--good) l c h / 0.2);
}

.hr-lede {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.hr-lede-big {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 42px;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-block;
  margin-right: 4px;
  line-height: 1;
}

.hr-lede-muted {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 14.5px;
  display: block;
  margin-top: 8px;
}

.hr-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--hairline);
}

.hr-stat {
  padding: 2px 18px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  transition: background .15s ease;
}

.hr-stat:last-child {
  border-right: none;
}

.hr-stat:hover {
  background: var(--surface-sunk);
}

.hr-stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}

.hr-stat-value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 2px;
}

.hr-stat-value .u {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-3);
  margin-left: 2px;
}

.hr-stat-value .sep {
  color: var(--ink-5);
  margin: 0 3px;
  font-style: normal;
}

.hr-spark {
  width: 100%;
  height: 18px;
  margin-top: 2px;
}

.hr-gauge {
  width: 100%;
  height: 10px;
  margin-top: 6px;
}

.hr-gauge svg {
  width: 100%;
  height: 100%;
}

.hr-stat-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 18px;
  margin-top: 2px;
}

.hr-stat-bars span {
  flex: 1;
  background: oklch(from var(--bad) l c h / 0.35);
  border-radius: 1px;
}

.hr-stat-bars span:last-child {
  background: var(--bad);
}

.hr-stat.critical .hr-stat-value {
  color: var(--bad-ink);
}

.hr-stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
}

.hr-stat-delta i[data-lucide] {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.hr-stat-delta.up {
  color: oklch(58% 0.16 155);
}

.hr-stat-delta.down {
  color: oklch(60% 0.18 25);
}

@media (max-width: 1280px) {
  .hero-ribbon {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hr-stats {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-top: 16px;
  }
}

@media (max-width: 860px) {
  .hr-stats {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
    border-top: 1px solid var(--hairline);
  }

  .hr-stat {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 14px 14px;
  }

  .hr-lede-big {
    font-size: 34px;
  }
}

/* ============================================================
   HERO — Executive snapshot
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
}

.hero-main {
  background: var(--deep);
  color: var(--deep-ink);
  border-radius: var(--r-xl);
  padding: 28px 32px 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-main::before {
  content: "";
  position: absolute;
  inset: -50% -20% auto auto;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, oklch(from var(--accent) l c h / 0.22), transparent 55%);
  pointer-events: none;
}

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--deep-ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow .live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

.period-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--deep-ink);
}

.hero-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 20px 0 6px;
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.hero-headline em {
  font-style: italic;
  color: oklch(from var(--accent-2) calc(l + 10) c h);
}

.hero-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--deep-ink-2);
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.hero-stat {
  padding-right: 20px;
  border-right: 1px solid var(--deep-line);
}

.hero-stat:last-child {
  border-right: none;
  padding-left: 20px;
  padding-right: 0;
}

.hero-stat:not(:first-child) {
  padding-left: 20px;
}

.hero-stat-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--deep-ink-2);
  margin-bottom: 8px;
}

.hero-stat-value {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.hero-stat-delta {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.delta-up {
  color: oklch(75% 0.16 155);
}

.delta-down {
  color: oklch(75% 0.18 25);
}

.hero-spark {
  margin-top: 4px;
  width: 100%;
  height: 28px;
  display: block;
}

.hero-side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 20px 22px;
}

.mini-card-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
}

.mini-card-value {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-top: 10px;
}

.mini-card-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.mini-card-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 8px;
  line-height: 1.5;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.chip-good {
  color: var(--good-ink);
  background: var(--good-soft);
  border-color: transparent;
}

.chip-warn {
  color: var(--warn-ink);
  background: var(--warn-soft);
  border-color: transparent;
}

.chip-bad {
  color: var(--bad-ink);
  background: var(--bad-soft);
  border-color: transparent;
}

.chip-accent {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: transparent;
}

.chip-ghost {
  color: var(--ink-3);
  background: var(--surface-sunk);
  border-color: transparent;
}

.insight-tile {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.insight-tile+.insight-tile {
  margin-top: 12px;
}

.insight-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  flex-shrink: 0;
}

.insight-icon.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.insight-icon.good {
  background: var(--good-soft);
  color: var(--good-ink);
}

.insight-icon.bad {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.insight-icon i[data-lucide] {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.insight-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.insight-value {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-top: 4px;
  color: var(--ink);
}

.insight-meta {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 4px;
  font-family: var(--mono);
}

/* ============================================================
   KPI GRID
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.kpi {
  background: var(--surface);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: background .2s ease;
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity .2s ease;
}

.kpi:hover {
  background: var(--surface-2);
}

.kpi:hover::before {
  opacity: 1;
}

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

.kpi-label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.kpi.kpi-good .kpi-label::before {
  background: var(--good);
}

.kpi.kpi-warn .kpi-label::before {
  background: var(--warn);
}

.kpi.kpi-bad .kpi-label::before {
  background: var(--bad);
}

.kpi.kpi-ghost .kpi-label::before {
  background: var(--ink-4);
}

.kpi-value {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.kpi-value .unit {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
}

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline);
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  line-height: 1.4;
}

.kpi-foot .mono {
  font-size: 11.5px;
}

.kpi-spark {
  width: 90px;
  height: 28px;
  display: block;
}

/* ============================================================
   CHARTS
   ============================================================ */
.forecast-card {
  padding: 24px 28px 20px;
}

.forecast-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.chart-wrap {
  position: relative;
  margin-top: 16px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-wrap-apex {
  margin-top: 12px;
}

.chart-apex {
  width: 100%;
}

.chart-apex-trend {
  min-height: 340px;
}

.chart-apex-pipeline {
  min-height: 300px;
}

.pipeline-apex-wrap {
  min-height: 300px;
}

.pipeline-apex-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(230px, 2fr) 90px 44px;
  gap: 14px;
  align-items: stretch;
}

.pipeline-apex-col {
  display: grid;
  grid-auto-rows: 56px;
}

.pipeline-apex-row {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px dashed var(--hairline);
}

.pipeline-apex-col .pipeline-apex-row:last-child {
  border-bottom: none;
}

.pipeline-apex-col-chart {
  position: relative;
}

.pipeline-stage-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pipeline-stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.pipeline-stage-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.25;
}

.pipeline-stage-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.1;
}

.pipeline-apex-row-value,
.pipeline-apex-row-ratio {
  justify-content: flex-end;
}

.pipeline-apex-row-value {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pipeline-apex-row-ratio {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}

@media (max-width: 1200px) {
  .pipeline-apex-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-apex-col {
    grid-auto-rows: auto;
  }

  .pipeline-apex-row {
    min-height: 44px;
  }
}

.chart-apex .apexcharts-canvas,
.chart-apex .apexcharts-svg {
  background: transparent !important;
}

.chart-apex .apexcharts-gridline,
.chart-apex .apexcharts-xcrosshairs,
.chart-apex .apexcharts-ycrosshairs {
  stroke: var(--hairline-2) !important;
}

.chart-apex .apexcharts-xaxis line,
.chart-apex .apexcharts-yaxis line,
.chart-apex .apexcharts-xaxis-tick,
.chart-apex .apexcharts-yaxis-tick {
  stroke: transparent !important;
}

.chart-apex .apexcharts-yaxis-texts-g text,
.chart-apex .apexcharts-xaxis-texts-g text {
  fill: var(--ink-4) !important;
}

.chart-apex .apexcharts-bar-area:hover,
.chart-apex .apexcharts-line-series path:hover,
.chart-apex .apexcharts-area-series path:hover {
  filter: none !important;
}

.chart-apex .apexcharts-tooltip {
  display: none !important;
}

.cockpit-chart-tooltip {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: color-mix(in oklab, var(--surface) 92%, white 8%);
  box-shadow: 0 18px 40px -20px rgba(15, 23, 42, 0.25);
}

.cockpit-chart-tooltip-title {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.cockpit-chart-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-2);
}

.cockpit-chart-tooltip-row+.cockpit-chart-tooltip-row {
  margin-top: 6px;
}

.cockpit-chart-tooltip-label {
  color: var(--ink-3);
}

.axis-tick {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-4);
}

.axis-line {
  stroke: var(--hairline);
  stroke-width: 1;
}

.grid-line {
  stroke: var(--hairline-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

/* ============================================================
   OWNER SCORECARD
   ============================================================ */
.owner-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}

.owner-grid.owner-grid-two-cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.owner-row {
  display: grid;
  grid-template-columns: 160px 1fr 90px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hairline);
}

.owner-row:last-child {
  border-bottom: none;
}

.owner-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}

.owner-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.bullet-bar {
  position: relative;
  height: 22px;
  background: var(--surface-sunk);
  border-radius: 5px;
  overflow: hidden;
}

.bullet-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--ink-4);
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: white;
  min-width: 4px;
}

.bullet-fill.good {
  background: var(--good);
}

.bullet-fill.warn {
  background: var(--warn);
}

.bullet-fill.bad {
  background: var(--bad);
}

.bullet-fill.info {
  background: var(--accent);
}

.bullet-target {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink);
}

.owner-value {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}

/* SCORECARD TABLE */
.scorecard-card {
  padding: 0;
}

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

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.data thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
  white-space: nowrap;
}

table.data thead th.num,
table.data tbody td.num {
  text-align: right;
  font-family: var(--mono);
}

table.data tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  color: var(--ink-2);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover {
  background: var(--surface-2);
}

table.data tbody td strong {
  color: var(--ink);
  font-weight: 500;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-bar {
  width: 48px;
  height: 6px;
  background: var(--surface-sunk);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.mini-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* ============================================================
   PIPELINE FUNNEL
   ============================================================ */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 4px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 140px 1fr 120px 60px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .15s;
}

.funnel-row:hover {
  background: var(--surface-2);
}

.funnel-stage {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.funnel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.funnel-bar {
  position: relative;
  height: 30px;
  background: linear-gradient(90deg, oklch(from var(--accent) l c h / 0.08), oklch(from var(--accent) l c h / 0.18));
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-ink);
}

.funnel-value {
  font-family: var(--serif);
  font-size: 18px;
  text-align: right;
  letter-spacing: -0.01em;
}

.funnel-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-align: right;
}

/* ============================================================
   VERTICAL FUNNEL (prospect → client)
   ============================================================ */
.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seg-sm {
  padding: 2px;
}

.seg-sm button {
  padding: 6px 10px;
  font-size: 12px;
}

.vf-ownerbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.vf-ownerbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  padding-right: 10px;
  border-right: 1px solid var(--hairline);
}

.vf-ownerbar-label i[data-lucide] {
  width: 12px;
  height: 12px;
  stroke-width: 1.75;
}

.vf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
}

.vf-chip:hover {
  border-color: var(--ink-5);
  color: var(--ink);
}

.vf-chip.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.vf-chip.active .vf-chip-avatar {
  box-shadow: 0 0 0 1.5px var(--surface);
}

.vf-chip-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}

.vf-chip-avatar.all {
  background: var(--ink);
  color: var(--surface);
}

.vf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}

.vf-main {
  position: relative;
  padding: 12px 40px 12px 60px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  min-height: 580px;
}

.vf-scale {
  position: absolute;
  left: 14px;
  top: 20px;
  bottom: 20px;
  width: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-5);
  text-align: right;
}

.vf-scale-axis {
  position: absolute;
  left: 38px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--hairline);
}

.vf-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.vf-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vf-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.vf-summary-row {
  padding: 14px 16px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.vf-summary-row:nth-child(2n) {
  border-right: none;
}

.vf-summary-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.vf-summary-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-4);
  margin-bottom: 6px;
}

.vf-summary-value {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.vf-stages-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.vf-stage-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}

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

.vf-stage-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-5);
}

.vf-stage-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.vf-stage-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}

.vf-stage-conv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
}

.vf-stage-conv.good {
  background: oklch(from var(--good) l c h / 0.15);
  color: oklch(40% 0.12 155);
}

.vf-stage-conv.warn {
  background: oklch(90% 0.08 75);
  color: oklch(42% 0.12 75);
}

.vf-stage-conv.bad {
  background: oklch(from var(--bad) l c h / 0.15);
  color: var(--bad-ink);
}

.vf-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.vf-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* ============================================================
   COVERAGE DONUT + STATS
   ============================================================ */
.coverage-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
}

.donut-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-big {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
}

.donut-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.coverage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coverage-row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.coverage-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.coverage-label {
  font-size: 13px;
  color: var(--ink-2);
}

.coverage-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.coverage-val {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
}

/* ============================================================
   RISK + OPPORTUNITIES
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}

.opp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hairline);
  transition: background .15s;
}

.opp-row:hover {
  background: var(--surface-2);
}

.opp-row:last-child {
  border-bottom: none;
}

.opp-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.opp-meta {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
}

.opp-meta .sep {
  color: var(--ink-5);
}

.opp-val {
  text-align: right;
}

.opp-amount {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.opp-fcst {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
}

.risk-row {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
}

.risk-row:last-child {
  border-bottom: none;
}

.risk-score {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.risk-score.med {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.risk-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.risk-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 4px;
}

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

/* ============================================================
   LOG
   ============================================================ */
.log-head .status-bar {
  display: flex;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-4);
}

.log-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.log-status.won {
  background: var(--good-soft);
  color: var(--good-ink);
}

.log-status.lost {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 100;
  width: 280px;
  backdrop-filter: blur(16px);
}

.tweaks-panel.active {
  display: block;
}

.tweaks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tweaks-title {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.tweaks-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tweaks-row {
  margin-bottom: 12px;
}

.tweaks-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  margin-bottom: 7px;
}

.theme-swatches {
  display: flex;
  gap: 8px;
}

.theme-swatch {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.theme-swatch.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-bottom: 6px;
  display: block;
}

.theme-swatch[data-theme="paper"] .theme-dot {
  background: oklch(97.5% 0.008 80);
  border: 1px solid oklch(88% 0.008 270);
}

.theme-swatch[data-theme="graphite"] .theme-dot {
  background: oklch(94% 0.004 270);
  border: 1px solid oklch(80% 0.008 270);
}

.theme-swatch[data-theme="midnight"] .theme-dot {
  background: oklch(15% 0.015 270);
}

.accent-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accent-preview {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.15);
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.density-toggle {
  display: flex;
  gap: 6px;
}

.density-toggle button {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--sans);
  color: var(--ink-3);
  cursor: pointer;
}

.density-toggle button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Responsive */
@media (max-width: 1400px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .owner-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    display: none;
  }

  .main {
    padding: 20px;
  }

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

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

  .coverage-layout {
    grid-template-columns: 1fr;
  }
}

/* UTILITIES */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gap-sm {
  gap: 6px;
}

.grow {
  flex: 1;
}



/* ===== Added guidance / explainers ===== */
.analysis-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.analysis-note+.analysis-note {
  margin-top: 10px;
}

.analysis-note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analysis-note-item {
  padding: 10px 12px;
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.analysis-note-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin-bottom: 6px;
}

.analysis-note-value {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.section-note {
  margin-bottom: 18px;
}

.timeline-card {
  padding: 24px;
}

.timeline-shell {
  position: relative;
  overflow-x: auto;
  padding-bottom: 8px;
}

.timeline-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.timeline-owner-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans);
  appearance: none;
}

.timeline-owner-chip:hover {
  border-color: var(--ink-5);
  color: var(--ink);
}

.timeline-owner-chip.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.timeline-owner-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.timeline-help {
  font-size: 12px;
  color: var(--ink-3);
}

.timeline-svg {
  width: 100%;
  min-width: 1200px;
  height: 380px;
  display: block;
}

.timeline-axis-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-4);
}

.timeline-axis-line {
  stroke: var(--hairline);
  stroke-width: 1;
}

.timeline-stem {
  stroke-width: 1.5;
  opacity: .72;
}

.timeline-upper-zone {
  fill: oklch(from var(--good) l c h / 0.04);
}

.timeline-lower-zone {
  fill: oklch(from var(--accent) l c h / 0.03);
}

.timeline-band-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--ink-5);
}

.timeline-empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-3);
  background: var(--surface-sunk);
  border-radius: 12px;
  border: 1px dashed var(--hairline);
}

.page-inline-note {
  margin: 18px 0 0;
}

@media (max-width: 1100px) {
  .analysis-note-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .analysis-note-grid {
    grid-template-columns: 1fr;
  }
}


.sales-filter-bar .js-period-button {
  border: none;
  background: transparent;
}

.sales-filter-bar .js-period-button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline), 0 2px 6px -3px oklch(0% 0 0 / 0.15);
}

.sales-filter-bar .btn.btn-sm.btn-primary {
  display: none;
}

#vf-canvas {
  width: 100%;
  min-height: 420px;
}

.vf-main {
  min-height: 520px;
}

.vf-svg-step {
  fill: var(--ink-5);
  font-family: var(--mono);
  font-size: 10px;
}

.vf-svg-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
}

.vf-svg-sub {
  fill: var(--ink-4);
  font-family: var(--mono);
  font-size: 10px;
}

.vf-svg-value {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}

.vf-svg-conv {
  fill: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
}


/* v4 refinements */
.compact-metrics {
  gap: 14px;
}

.companies-layout-top {
  align-items: stretch;
}

.companies-live-filter .filters-actions {
  align-items: end;
}

.company-overview-top {
  align-items: stretch;
}

.vf-main-list {
  padding: 20px 34px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vf-row-card {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1.05fr) minmax(280px, 1.6fr) minmax(84px, 110px) 52px;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hairline);
}

.vf-row-card:last-child {
  border-bottom: none;
}

.vf-row-step {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-5);
}

.vf-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.vf-row-sub {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

.vf-row-track-wrap {
  padding-right: 18px;
}

.vf-row-track {
  position: relative;
  height: 30px;
  border-radius: 9px;
  background: rgba(66, 104, 255, 0.06);
  overflow: hidden;
}

.vf-row-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  min-width: 10px;
  border-left: 3px solid #4168ff;
  border-radius: 0 9px 9px 0;
  background: rgba(66, 104, 255, 0.22);
}

.vf-row-value-col {
  text-align: right;
  padding-right: 12px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  white-space: nowrap;
}

.vf-row-percent-col {
  text-align: right;
  padding-right: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  white-space: nowrap;
}

.vf-row-percent-col.good {
  color: var(--good-ink);
}

.vf-row-percent-col.warn {
  color: var(--warn-ink);
}

.vf-row-percent-col.bad {
  color: var(--bad-ink);
}

.timeline-week-marker {
  stroke: var(--ink);
  stroke-width: 0.8;
  opacity: .14;
}

.timeline-stem {
  stroke-width: 1.8;
  opacity: .85;
}

.timeline-svg {
  width: 100%;
  min-width: 1200px;
  height: 392px;
  display: block;
}

.company-table-card .table-wrap table.data td {
  vertical-align: middle;
}

@media (max-width: 1100px) {
  .vf-main-list {
    padding-right: 22px;
  }

  .vf-row-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .vf-row-track-wrap,
  .vf-row-value-col,
  .vf-row-percent-col {
    grid-column: 2;
  }

  .vf-row-track-wrap {
    padding-right: 0;
    margin-top: 8px;
  }

  .vf-row-value-col,
  .vf-row-percent-col {
    text-align: left;
    padding-right: 0;
  }
}


/* v5 cleanup */
.companies-filters-card {
  padding: 18px 22px;
}

.companies-filters-inline {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(150px, .8fr)) auto;
  gap: 14px;
  align-items: end;
}

.companies-filters-inline .filters-actions {
  display: flex;
  align-items: end;
}

.companies-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.company-hero-compact {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

.contact-card,
.financial-trend-card,
.panel,
.surface-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: none;
}

.panel,
.surface-card {
  padding: 24px;
}

.timeline-owner-chip .owner-avatar-mini {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.timeline-owner-chip.active .owner-avatar-mini {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset;
}

.timeline-svg {
  height: 420px;
}

.timeline-pin-label {
  font-family: var(--mono);
  font-size: 8px;
  fill: #fff;
  font-weight: 700;
  pointer-events: none;
}

.timeline-pin-ring {
  stroke: #fff;
  stroke-width: 1.5;
}

.timeline-pin-stem {
  stroke-width: 1.8;
  opacity: .9;
}

.timeline-pin-stem.up {
  opacity: 1;
}

.timeline-week-marker {
  stroke: var(--ink);
  stroke-width: .7;
  opacity: .12;
}

.timeline-day-marker {
  stroke: var(--hairline);
  stroke-width: .5;
  opacity: .18;
  stroke-dasharray: 2 4;
}

.timeline-lower-zone,
.timeline-upper-zone {
  fill: transparent;
}

.timeline-axis-line {
  stroke: var(--hairline);
  stroke-width: 1;
}

.timeline-band-label {
  fill: var(--ink-5);
}

.timeline-legend {
  margin-bottom: 10px;
}

.timeline-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: none;
}

@media (max-width:1100px) {

  .companies-filters-inline,
  .company-hero-compact,
  .companies-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width:780px) {

  .companies-filters-inline,
  .company-hero-compact,
  .companies-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* v7 page cleanup + timeline filters */
.page-companies .topbar,
.page-company .topbar,
.page-sync .topbar,
.page-sync_financial .topbar,
.page-sync_single .topbar {
  display: none;
}

.page-companies .page-stack,
.page-company .page-stack,
.page-sync .page-stack,
.page-sync_financial .page-stack,
.page-sync_single .page-stack {
  gap: 18px;
}

.local-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--hairline);
}

.local-page-head h1,
.local-page-head h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.local-page-head p {
  margin: 10px 0 0;
  color: var(--ink-3);
  max-width: 760px;
}

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

.local-page-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.page-companies .metric-card::after,
.page-company .metric-card::after,
.page-sync .metric-card::after,
.page-sync_financial .metric-card::after,
.page-sync_single .metric-card::after {
  display: none;
}

.page-companies .metric-card,
.page-company .metric-card,
.page-sync .metric-card,
.page-sync_financial .metric-card,
.page-sync_single .metric-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: none;
}

.page-companies .card,
.page-company .card,
.page-sync .card,
.page-sync_financial .card,
.page-sync_single .card {
  box-shadow: none;
}

.page-companies .companies-filters-card,
.page-company .company-shell-card,
.page-sync .sync-shell-card,
.page-sync_financial .sync-shell-card,
.page-sync_single .sync-shell-card {
  padding: 20px 22px;
}

.page-companies .companies-filters-inline {
  grid-template-columns: minmax(280px, 1.4fr) repeat(2, minmax(180px, .8fr)) auto;
}

.page-companies .filters-actions .btn {
  min-width: 120px;
  justify-content: center;
}

.page-companies .section-note,
.page-company .page-inline-note,
.page-sync .section-note,
.page-sync_financial .section-note,
.page-sync_single .section-note {
  margin-top: 16px;
}

.page-company .company-overview-top {
  grid-template-columns: 1.35fr 1fr;
}

.page-company .contact-card h3 {
  margin: 10px 0 6px;
}

.page-company .contact-role {
  margin-bottom: 8px;
}

.page-company .contacts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.page-company .list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-company .list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--hairline);
}

.page-company .list-item:last-child {
  border-bottom: none;
}

.timeline-legend-stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.timeline-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.timeline-filters-secondary {
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}

.timeline-type-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans);
  appearance: none;
}

.timeline-type-chip:hover {
  border-color: var(--ink-5);
  color: var(--ink);
}

.timeline-type-chip.active {
  background: var(--surface-sunk);
  color: var(--ink);
  border-color: var(--ink-5);
}

@media (max-width:1100px) {

  .page-companies .companies-filters-inline,
  .page-company .company-overview-top,
  .page-company .contacts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width:780px) {
  .local-page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-companies .companies-filters-inline,
  .page-company .company-overview-top,
  .page-company .contacts-grid {
    grid-template-columns: 1fr;
  }
}


/* KPI tooltips */
.kpi-help {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-4);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: help;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}

.kpi-help:hover,
.kpi-help:focus-visible {
  color: var(--ink);
  border-color: var(--ink-5);
  outline: none;
}

.kpi-help svg,
.kpi-help i[data-lucide] {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.hr-stat-label .kpi-help {
  transform: translateY(-1px);
}

.hr-lede .kpi-help {
  transform: translateY(-3px);
}

.dashboard-tooltip {
  position: fixed;
  z-index: 9999;
  width: min(360px, calc(100vw - 24px));
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px;
  padding: 14px 15px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.24);
  pointer-events: auto;
}

.dashboard-tooltip[hidden] {
  display: none;
}

.dashboard-tooltip-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--bg);
}

.dashboard-tooltip-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .88);
}

.dashboard-tooltip-body p {
  margin: 0 0 8px;
}

.dashboard-tooltip-body p:last-child {
  margin-bottom: 0;
}

.dashboard-tooltip-body strong {
  color: #fff;
}

.hr-lede-unit {
  font-family: var(--sans);
  font-size: .38em;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 4px;
}

.section-note {
  display: none;
}

.card-head-with-actions {
  align-items: center;
}

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

.apex-tooltip-card {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.apex-tooltip-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.apex-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-3);
}

.apex-tooltip-row strong {
  color: var(--ink);
  font-weight: 600;
}

.target-settings-panel {
  padding: 18px 24px 20px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}

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

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

.target-settings-copy {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 640px;
}

.target-settings-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.target-settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
}

.target-settings-month {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}

.target-settings-field input {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}

.target-settings-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
}

.target-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.target-settings-status {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
}

.target-settings-status.saved {
  background: var(--good-soft);
  color: var(--good-ink);
}

.target-settings-status.reset {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.legend-item .kpi-help {
  margin-left: 4px;
}

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

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

  .target-settings-actions {
    flex-wrap: wrap;
  }
}


/* pipeline hard fix */
.pipeline-apex-grid {
  grid-template-columns: minmax(170px, 1.45fr) minmax(240px, 2.25fr) minmax(90px, 110px) minmax(44px, 56px);
  gap: 16px;
}

.pipeline-apex-col-chart {
  min-width: 0;
}

.pipeline-apex-row-barline {
  align-items: center;
}

.pipeline-stage-bar-track {
  position: relative;
  width: 100%;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  background: oklch(from var(--accent) 97% 0.02 h / 0.9);
  box-shadow: inset 0 0 0 1px oklch(from var(--accent) 88% 0.03 h / 0.28);
}

.pipeline-stage-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  min-width: 10px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(90deg, oklch(from var(--accent) 91% 0.05 h / 0.95), oklch(from var(--accent) 82% 0.09 h / 0.95));
}

.pipeline-apex-col-values,
.pipeline-apex-col-ratios {
  padding-right: 14px;
}

.pipeline-apex-row-value {
  justify-content: flex-end;
  padding-right: 8px;
}

.pipeline-apex-row-ratio {
  justify-content: flex-end;
  padding-right: 10px;
}

.pipeline-value-amount {
  display: inline-block;
  min-width: 72px;
  text-align: right;
}

.pipeline-value-ratio {
  display: inline-block;
  min-width: 36px;
  text-align: right;
}

/* pipeline alignment polish v19 */
.pipeline-apex-wrap {
  overflow: hidden;
}

.pipeline-apex-grid {
  grid-template-columns: 176px minmax(170px, 1fr) 84px 42px;
  gap: 12px;
  align-items: stretch;
}

.pipeline-apex-col-left .pipeline-apex-row {
  display: grid;
  grid-template-columns: 118px auto;
  align-items: center;
  gap: 10px;
}

.pipeline-stage-copy {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  gap: 8px;
}

.pipeline-stage-label {
  display: block;
  max-width: 100px;
}

.pipeline-stage-count {
  margin-left: 0;
  justify-self: start;
}

.pipeline-apex-col-chart {
  padding-right: 4px;
}

.pipeline-stage-bar-track {
  height: 28px;
}

.pipeline-stage-bar-fill {
  min-width: 8px;
}

.pipeline-apex-col-values {
  padding-right: 14px;
}

.pipeline-apex-col-ratios {
  padding-right: 18px;
}

.pipeline-value-amount {
  min-width: 64px;
}

.pipeline-value-ratio {
  min-width: 32px;
}

@media (max-width: 1280px) {
  .pipeline-apex-grid {
    grid-template-columns: 168px minmax(150px, 1fr) 76px 36px;
    gap: 10px;
  }

  .pipeline-apex-col-left .pipeline-apex-row {
    grid-template-columns: 110px auto;
    gap: 8px;
  }

  .pipeline-stage-copy,
  .pipeline-stage-copy {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
  }

  .pipeline-stage-label {
    max-width: 92px;
  }
}


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

.vf-summary-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 18px;
}

.vf-grid-single {
  grid-template-columns: 1fr;
}

.vf-grid-single .vf-main-list {
  width: 100%;
}

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


.scorecard-shell {
  margin-top: 20px;
}

.scorecard-shell>.card-head {
  background: transparent;
  border: none;
  padding: 0 0 18px;
}

.scorecard-shell>.card-head .eyebrow {
  margin-bottom: 8px;
}

.scorecard-shell .cockpit-two-up {
  margin-top: 0;
}

.metric-icon-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-sunk);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: none;
}

.metric-icon-toggle:hover {
  color: var(--ink);
  border-color: var(--hairline-2);
}

.metric-icon-toggle.active,
.metric-icon-toggle[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 28%, var(--hairline));
  box-shadow: 0 1px 0 var(--hairline), 0 2px 6px -3px oklch(0% 0 0 / 0.15);
}

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

.kpi-help {
  margin-left: 6px;
  vertical-align: middle;
}


.consultant-card-actions {
  flex-wrap: nowrap;
  margin-left: auto;
  align-self: flex-start;
}

.consultant-toggle-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.metric-icon-toggle-sm {
  width: 30px;
  height: 30px;
  min-width: 30px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .consultant-card-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}


/* ============================================================
   EXECUTION METRICS — integrated executive dashboard section
   ============================================================ */
.exec-metrics-block {
  margin-top: 18px;
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.exec-kpi {
  min-height: 158px;
}

.exec-kpi .kpi-value {
  letter-spacing: -0.035em;
}

.exec-activity-card {
  margin-top: 16px;
}

.exec-activity-card .card-head {
  align-items: center;
}

.exec-activity-card-body {
  padding-top: 14px;
}

.chart-apex-exec-activity {
  min-height: 300px;
}

.exec-days-toggle {
  display: inline-flex;
  gap: 2px;
}

.exec-days-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.exec-days-toggle a:hover {
  color: var(--ink);
  background: var(--surface);
}

.exec-days-toggle a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline), 0 2px 6px -4px oklch(0% 0 0 / 0.18);
}

.exec-metrics-error {
  padding: 18px;
  color: var(--bad);
  background: color-mix(in oklab, var(--bad) 7%, var(--surface));
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.exec-activity-empty {
  margin-top: 0;
}

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

  .exec-activity-card .card-head {
    align-items: flex-start;
  }
}

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

  .exec-days-toggle {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}


/* Custom owner activity chart: keeps name, avatar and bar in separate responsive columns. */
.chart-apex-exec {
  width: 100%;
}

.exec-owner-html-chart {
  --owner-label-col: clamp(150px, 22vw, 210px);
  --owner-avatar-size: 24px;
  width: 100%;
  min-width: 560px;
}

.exec-owner-html-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 2px 0 18px;
  font-size: 12px;
  color: var(--ink-3);
}

.exec-owner-html-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.exec-owner-html-legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.exec-owner-html-body {
  display: grid;
  gap: 0;
}

.exec-owner-html-row {
  display: grid;
  grid-template-columns: var(--owner-label-col) minmax(260px, 1fr);
  align-items: center;
  min-height: 64px;
}

.exec-owner-html-person {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  padding-right: 14px;
}

.exec-owner-html-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 400;
}

.exec-owner-html-avatar {
  width: var(--owner-avatar-size);
  height: var(--owner-avatar-size);
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 var(--owner-avatar-size);
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--surface);
}

.exec-owner-html-avatar-empty {
  display: inline-block;
}

.exec-owner-html-track {
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--hairline-2);
}

.exec-owner-html-row:last-child .exec-owner-html-track {
  border-bottom: 1px solid var(--hairline-2);
}

.exec-owner-html-stack {
  height: 30px;
  display: flex;
  min-width: 0;
}

.exec-owner-html-segment {
  min-width: 3px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  overflow: hidden;
}

.exec-owner-html-segment:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.exec-owner-html-segment:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

.exec-owner-html-axis {
  display: grid;
  grid-template-columns: var(--owner-label-col) minmax(260px, 1fr);
  align-items: start;
  padding-top: 8px;
}

.exec-owner-html-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--ink-4);
  font-size: 12px;
}

@media (max-width: 760px) {
  .exec-owner-html-chart {
    --owner-label-col: 138px;
    min-width: 520px;
  }

  .exec-owner-html-row {
    grid-template-columns: var(--owner-label-col) minmax(220px, 1fr);
  }

  .exec-owner-html-axis {
    grid-template-columns: var(--owner-label-col) minmax(220px, 1fr);
  }

  .exec-owner-html-person {
    padding-right: 10px;
    gap: 8px;
  }
}






.exec-owner-html-legend-item {
  cursor: pointer;
  font-weight: 400;
  user-select: none;
}

.exec-owner-html-legend-item:focus-visible {
  outline: 1px solid color-mix(in oklab, var(--ink-4) 55%, transparent);
  outline-offset: 3px;
  border-radius: 3px;
}

.exec-owner-html-legend-item.is-muted {
  opacity: .45;
}

.exec-owner-html-value,
.exec-owner-html-name,
.exec-owner-html-ticks,
.exec-owner-html-legend {
  font-weight: 400;
}



/* ============================================================
   IDEAL CUSTOMER PROFILE / INDUSTRY SEGMENTATION
   ============================================================ */
.icp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.icp-card {
  min-width: 0;
}

.icp-bars {
  display: grid;
  gap: 11px;
  padding: 20px 20px 20px;
}

.icp-bar-row {
  display: grid;
  grid-template-columns: minmax(74px, 110px) 1fr 34px;
  align-items: center;
  gap: 10px;
}

.icp-bar-label {
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icp-bar-track,
.icp-list-bar {
  height: 8px;
  background: var(--surface-sunk);
  border-radius: 999px;
  overflow: hidden;
}

.icp-bar-track span,
.icp-list-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.icp-bar-value {
  text-align: right;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.icp-secondary-grid {
  margin-top: 18px;
}

.icp-list {
  display: grid;
  gap: 0;
  padding: 0 20px 20px;
}

.icp-list-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 220px) minmax(78px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--hairline-2);
}

.icp-list-row:first-child {
  border-top: 0;
}

.icp-list-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.icp-list-row span {
  display: block;
  color: var(--ink-4);
  font-size: 12px;
  margin-top: 2px;
}

.icp-list-row .num {
  text-align: right;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}

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

  .icp-list-row {
    grid-template-columns: minmax(130px, 1fr) minmax(120px, 180px) minmax(78px, auto);
  }
}

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

  .icp-list-row .num {
    text-align: left;
  }
}


/* ============================================================
   Companies + Company pages — adapted from uploaded 2026 HTML mockups
   ============================================================ */
.page-companies .local-page-head h1 em {
  font-style: italic;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--accent);
}

.companies-new-shell,
.company-new-shell {
  display: block;
}

.companies-page-head,
.company-page-head {
  margin-bottom: 18px;
}

.local-page-meta i[data-lucide] {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 5px;
}

/* list layout */
.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  margin-top: 24px;
}

@media (max-width:1280px) {
  .list-layout {
    grid-template-columns: 1fr;
  }
}

.companies-filter-bar {
  margin-top: 14px;
}

.companies-status-seg button {
  white-space: nowrap;
}

.filter-pill-field select {
  max-width: 150px;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.active-chips-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-right: 4px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid oklch(from var(--accent) l c h / .18);
  border-radius: 999px;
  text-decoration: none;
}

.active-chip i[data-lucide] {
  width: 11px;
  height: 11px;
}

.active-chip .x {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  opacity: .75;
}

.active-chip:hover .x {
  background: oklch(from var(--accent) l c h / .15);
  opacity: 1;
}

.active-chip-sep {
  color: var(--ink-5);
  font-family: var(--mono);
  font-size: 11px;
}

.active-clear {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  cursor: pointer;
  padding: 5px 8px;
  text-decoration: none;
}

.active-clear:hover {
  color: var(--ink-2);
}

/* stat ribbon */
.stat-ribbon {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-top: 18px;
}

.stat-ribbon .sr-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.stat-ribbon .sr-cell:last-child {
  border-right: none;
}

.sr-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
}

.sr-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
  background: var(--accent);
}

.sr-label .dot.good {
  background: var(--good);
}

.sr-label .dot.warn {
  background: var(--warn);
}

.sr-label .dot.bad {
  background: var(--bad);
}

.sr-label .dot.info {
  background: var(--info);
}

.sr-value {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 2px;
}

.sr-value .u {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 5px;
}

.sr-meta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1.4;
}

.sr-meta .pct {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink-2);
}

.sr-bar {
  margin-top: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-sunk);
  position: relative;
  overflow: hidden;
}

.sr-bar>span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-radius: 2px;
}

.sr-bar.good>span {
  background: var(--good);
}

.sr-bar.warn>span {
  background: var(--warn);
}

.sr-bar.bad>span {
  background: var(--bad);
}

.sr-bar.info>span {
  background: var(--info);
}

@media (max-width:1100px) {
  .stat-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-ribbon .sr-cell {
    border-bottom: 1px solid var(--hairline);
  }

  .stat-ribbon .sr-cell:nth-child(2n) {
    border-right: none;
  }
}

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

  .stat-ribbon .sr-cell {
    border-right: none;
  }
}

/* companies table */
.list-card {
  padding: 0;
  margin-top: 0;
}

.list-card-head {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}

.list-card-head h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 0;
  letter-spacing: -.005em;
}

.list-card-head p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 4px 0 0;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seg-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 4px 22px 0;
  overflow-x: auto;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.seg-tab:hover {
  color: var(--ink-2);
}

.seg-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.seg-tab .ct {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-sunk);
  color: var(--ink-4);
}

.seg-tab.active .ct {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

table.companies {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.companies thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

table.companies thead th.num,
table.companies tbody td.num {
  text-align: right;
  font-family: var(--mono);
}

table.companies tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  color: var(--ink-2);
}

table.companies tbody tr:last-child td {
  border-bottom: none;
}

table.companies tbody tr {
  cursor: pointer;
  transition: background .15s;
}

table.companies tbody tr:hover {
  background: var(--surface-2);
}

table.companies a {
  color: inherit;
  text-decoration: none;
}

.sortable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sortable i[data-lucide] {
  width: 11px;
  height: 11px;
  opacity: .5;
  color: var(--accent);
}

.co-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.co-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.co-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .25), transparent 60%);
}

.co-mark span {
  position: relative;
  z-index: 1;
}

.co-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-name a:hover {
  color: var(--accent-ink);
}

.co-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--ink);
  color: var(--bg);
}

.co-tag.dream {
  background: oklch(from var(--accent) l c h / .15);
  color: var(--accent-ink);
}

.co-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.co-meta .sep {
  color: var(--ink-5);
}

.owner-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-avatar-sm,
.tk-owner-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  vertical-align: middle;
}

.owner-avatar-sm img,
.tk-owner-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.owner-cell .nope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-4);
}

.owner-cell .nope::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px dashed var(--hairline);
  display: inline-block;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 999px;
  text-transform: capitalize;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.client {
  color: var(--good-ink);
  background: var(--good-soft);
}

.status-pill.opp {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.status-pill.lead {
  color: var(--info);
  background: var(--info-soft);
}

.status-pill.cold {
  color: var(--ink-3);
  background: var(--surface-sunk);
}

.status-pill.lost {
  color: var(--bad-ink);
  background: var(--bad-soft);
}

.status-pill.warn {
  color: var(--warn-ink);
  background: var(--warn-soft);
}

.cov {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
}

.cov-slot {
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-5);
  border-right: 1px solid var(--hairline);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cov-slot:last-child {
  border-right: none;
}

.cov-slot.ok {
  background: oklch(from var(--good) l c h / .12);
  color: var(--good-ink);
}

.cov-slot.ok::before {
  content: "●";
  font-size: 8px;
}

.cov-slot.miss::before {
  content: "○";
  font-size: 8px;
}

.cell-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cell-bar-track {
  width: 42px;
  height: 5px;
  background: var(--surface-sunk);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}

.cell-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.cell-bar-fill.warn {
  background: var(--warn);
}

.cell-bar-fill.bad {
  background: var(--bad);
}

.cell-bar-fill.good {
  background: var(--good);
}

.last-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.last-action i[data-lucide] {
  width: 11px;
  height: 11px;
  color: var(--ink-4);
}

.row-action {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-4);
  cursor: pointer;
}

table.companies tbody tr:hover .row-action {
  border-color: var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
}

.row-action i[data-lucide] {
  width: 13px;
  height: 13px;
}

.companies-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 0;
}

.companies-pagination .pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.companies-pagination .page-link {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  box-shadow: none;
  background: transparent;
}

.companies-pagination .page-link.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* sidebar insights */
.insights-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 20px;
}

.insight-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 18px 20px;
}

.insight-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.insight-card-head h4 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.insight-card-head h4 i[data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.insight-card-head .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.insight-card-sub {
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.5;
  margin: -8px 0 12px;
}

.att-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px dashed var(--hairline);
  text-decoration: none;
  color: inherit;
}

.att-row:last-child {
  border-bottom: none;
}

.att-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.att-icon.bad {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.att-icon.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.att-icon.info {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.att-icon i[data-lucide] {
  width: 14px;
  height: 14px;
}

.att-text {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}

.att-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 3px;
}

.att-count {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--hairline);
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.rank-bar {
  display: inline-block;
  width: 56px;
  height: 5px;
  background: var(--surface-sunk);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 4px;
}

.rank-bar>span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.rank-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.dist-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.dist-row {
  display: grid;
  grid-template-columns: 1fr 70px 30px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.dist-name {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dist-bar {
  height: 5px;
  background: var(--surface-sunk);
  border-radius: 3px;
  overflow: hidden;
}

.dist-bar>span {
  display: block;
  height: 100%;
  background: var(--ink-3);
  border-radius: 3px;
}

.dist-bar.a>span {
  background: var(--accent);
}

.dist-bar.b>span {
  background: oklch(from var(--accent) l c calc(h + 25));
}

.dist-bar.c>span {
  background: oklch(from var(--accent) l c calc(h - 25));
}

.dist-bar.d>span {
  background: var(--good);
}

.dist-bar.e>span {
  background: var(--warn);
}

.dist-bar.f>span {
  background: var(--info);
}

.dist-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
}

/* company detail */
.co-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  padding: 8px 4px 22px;
  border-bottom: 1px solid var(--hairline);
}

.co-hero-left {
  min-width: 0;
}

.co-hero-id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.co-hero-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 30px;
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px -10px rgba(91, 108, 255, .55);
}

.co-hero-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .35), transparent 60%);
}

.co-hero-mark span {
  position: relative;
  z-index: 1;
}

.co-hero-name {
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

.co-hero-name em {
  font-style: italic;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--accent);
}

.co-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 8px;
  flex-wrap: wrap;
}

.co-hero-meta a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline);
}

.co-hero-meta a:hover {
  color: var(--accent-ink);
  border-color: var(--accent);
}

.co-hero-meta .sep {
  color: var(--ink-5);
}

.co-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.co-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
}

.co-hero-tag.dream {
  background: oklch(from var(--accent) l c h / .12);
  color: var(--accent-ink);
  border-color: oklch(from var(--accent) l c h / .25);
}

.co-hero-tag.client {
  background: var(--good-soft);
  color: var(--good-ink);
  border-color: transparent;
}

.co-hero-tag i[data-lucide] {
  width: 11px;
  height: 11px;
}

.co-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.co-hero-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--hairline);
  padding-left: 28px;
}

.co-hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.co-hero-eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
}

.co-hero-summary {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 16px;
}

.co-hero-summary em {
  color: var(--accent);
  font-style: italic;
}

.co-hero-summary .num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

.co-hero-summary .neg {
  color: var(--bad-ink);
  font-style: italic;
}

.co-hero-summary .pos {
  color: var(--good-ink);
  font-style: italic;
}

.co-hero-quickkv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--hairline);
}

.co-hero-quickkv>div {
  padding: 12px 14px 12px 0;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.co-hero-quickkv>div:nth-child(2n) {
  border-right: none;
  padding-right: 0;
  padding-left: 14px;
}

.co-hero-quickkv>div:nth-last-child(-n+2) {
  border-bottom: none;
}

.qkv-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
}

.qkv-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 4px;
}

.qkv-value .o {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 400;
}

@media (max-width:1100px) {
  .co-hero {
    grid-template-columns: 1fr;
  }

  .co-hero-right {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 22px;
  }
}

.co-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-top: 24px;
}

.co-kpi {
  min-width: 0;
  padding: 14px 14px 13px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.co-kpi:last-child {
  border-right: none;
}

.co-kpi-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-kpi-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.co-kpi.good .co-kpi-label::before {
  background: var(--good);
}

.co-kpi.warn .co-kpi-label::before {
  background: var(--warn);
}

.co-kpi.bad .co-kpi-label::before {
  background: var(--bad);
}

.co-kpi.info .co-kpi-label::before {
  background: var(--info);
}

.co-kpi-value {
  font-family: var(--serif);
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 2px;
}

.co-kpi-value .u {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
}

.co-kpi-value .sep {
  color: var(--ink-5);
  margin: 0 2px;
  font-style: normal;
}

.co-kpi-meta {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
  font-family: var(--mono);
}

.co-kpi-meta .pos {
  color: var(--good-ink);
  font-weight: 500;
}

.co-kpi-meta .neg {
  color: var(--bad-ink);
  font-weight: 500;
}

@media (max-width:1380px) {
  .co-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .co-kpi {
    border-bottom: 1px solid var(--hairline);
  }

  .co-kpi:nth-child(4n) {
    border-right: none;
  }
}

@media (max-width:780px) {
  .co-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

.co-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 32px;
}

@media (max-width:1280px) {
  .co-layout {
    grid-template-columns: 1fr;
  }
}

.sec {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.sec+.sec {
  margin-top: 22px;
}

.sec-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.sec-head h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 0;
  letter-spacing: -.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-head h3 .badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-3);
}

.sec-head p {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 4px 0 0;
  line-height: 1.5;
  max-width: 540px;
}

.sec-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-4);
}

.sec-eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
}

.bc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.bc-card {
  padding: 22px 22px 18px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.bc-card:last-child {
  border-right: none;
}

.bc-card.empty {
  background: var(--surface-sunk);
}

.bc-role {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bc-role::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.bc-role.role-2::before {
  background: var(--good);
}

.bc-role.role-2 {
  color: var(--good-ink);
}

.bc-role.role-3::before {
  background: var(--info);
}

.bc-role.role-3 {
  color: var(--info);
}

.bc-person {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bc-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--ink-4);
  position: relative;
  overflow: hidden;
}

.bc-avatar.has-photo {
  background: linear-gradient(135deg, oklch(80% .02 270), oklch(72% .02 270));
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
}

.bc-name {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}

.bc-title {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.bc-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px dashed var(--hairline);
  border-bottom: 1px dashed var(--hairline);
}

.bc-contact-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-2);
}

.bc-contact-row i[data-lucide] {
  width: 12px;
  height: 12px;
  color: var(--ink-4);
}

.bc-contact-row a {
  color: var(--ink-2);
  text-decoration: none;
}

.bc-contact-row a:hover {
  color: var(--accent-ink);
}

.bc-history {
  font-size: 12px;
  color: var(--ink-3);
}

.bc-history-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
  margin-bottom: 6px;
}

.bc-history ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bc-history li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  padding: 4px 0;
  font-size: 11.5px;
}

.bc-history li time {
  font-family: var(--mono);
  color: var(--ink-4);
}

.bc-history li span {
  color: var(--ink-2);
}

.bc-empty-cta {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 8px;
  text-align: center;
}

.bc-empty-cta .ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px dashed var(--hairline);
  display: grid;
  place-items: center;
  color: var(--ink-4);
}

.bc-empty-cta .ic i[data-lucide] {
  width: 18px;
  height: 18px;
}

.bc-empty-cta .t {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.bc-empty-cta .s {
  font-size: 12px;
  color: var(--ink-4);
  max-width: 200px;
  line-height: 1.4;
}

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

  .bc-card {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }

  .bc-card:last-child {
    border-bottom: none;
  }
}

.df-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 16px 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hairline);
}

.df-sum-cell {
  padding: 0 16px;
  border-right: 1px solid var(--hairline);
}

.df-sum-cell:last-child {
  border-right: none;
}

.df-sum-cell:first-child {
  padding-left: 4px;
}

.df-sum-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
}

.df-sum-value {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -.025em;
  line-height: 1;
  margin-top: 4px;
}

.df-sum-value .u {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}

.deals-funnel {
  padding: 4px 16px 18px;
}

.df-row {
  display: grid;
  grid-template-columns: 160px 1fr 110px 82px;
  align-items: center;
  gap: 14px;
  padding: 9px 8px;
  border-radius: 10px;
  transition: background .15s;
}

.df-row:hover {
  background: var(--surface-2);
}

.df-stage {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-stage .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}

.df-bar {
  position: relative;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: linear-gradient(90deg, oklch(from var(--accent) l c h / .06), oklch(from var(--accent) l c h / .16));
  border-left: 2px solid var(--accent);
  min-width: 120px;
  max-width: 100%;
}

.df-bar.won {
  background: linear-gradient(90deg, oklch(from var(--good) l c h / .10), oklch(from var(--good) l c h / .22));
  border-left-color: var(--good);
  color: var(--good-ink);
}

.df-bar.lost {
  background: linear-gradient(90deg, oklch(from var(--bad) l c h / .08), oklch(from var(--bad) l c h / .18));
  border-left-color: var(--bad);
  color: var(--bad-ink);
}

.df-bar.neg {
  border-left-color: var(--warn);
}

.df-bar .pellet {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--surface);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
  color: var(--ink-3);
  white-space: nowrap;
}

.df-amount {
  font-family: var(--serif);
  font-size: 18px;
  text-align: right;
  letter-spacing: -.01em;
  line-height: 1;
  color: var(--ink);
}

.df-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-align: right;
}

.deals-table,
.fin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.deals-table thead th,
.fin-table thead th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-align: left;
  padding: 11px 22px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
  white-space: nowrap;
}

.deals-table thead th.num,
.fin-table thead th.num {
  text-align: right;
}

.deals-table tbody td,
.fin-table tbody td {
  padding: 12px 22px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  color: var(--ink-2);
}

.deals-table tbody tr:last-child td,
.fin-table tbody tr:last-child td {
  border-bottom: none;
}

.deals-table tbody tr:hover {
  background: var(--surface-2);
}

.deals-table .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.deals-table .pill.qual {
  background: var(--info-soft);
  color: var(--info);
}

.deals-table .pill.prop {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.deals-table .pill.neg {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.deals-table .pill.won {
  background: var(--good-soft);
  color: var(--good-ink);
}

.deals-table .pill.lost {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.deals-table .num,
.fin-table .num {
  text-align: right;
  font-family: var(--mono);
}

.tk-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
}

.tk-row:last-child {
  border-bottom: none;
}

.tk-row:hover {
  background: var(--surface-2);
}

.tk-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink-5);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.tk-row.done .tk-check {
  background: var(--good);
  border-color: var(--good);
}

.tk-row.done .tk-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.tk-row.done .tk-title {
  text-decoration: line-through;
  color: var(--ink-4);
}

.tk-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.tk-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tk-meta .sep {
  color: var(--ink-5);
}

.tk-meta .priority {
  color: var(--ink-2);
}

.tk-meta .priority.high {
  color: var(--bad-ink);
}

.tk-meta .due.overdue {
  color: var(--bad-ink);
  font-weight: 500;
}

.tk-meta .due.soon {
  color: var(--warn-ink);
}

.tk-row-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tk-owner-mini {
  width: 24px;
  height: 24px;
  font-size: 9.5px;
}

.tk-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tk-status.todo {
  background: var(--surface-sunk);
  color: var(--ink-3);
}

.tk-status.progress {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tk-status.waiting {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.tk-status.done {
  background: var(--good-soft);
  color: var(--good-ink);
}

.kv {
  display: flex;
  flex-direction: column;
}

.kv>div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  padding: 11px 22px;
  border-bottom: 1px dashed var(--hairline);
}

.kv>div:last-child {
  border-bottom: none;
}

.kv span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.kv strong {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.kv strong .o,
.kv .o {
  color: var(--ink-4);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 22px 18px;
}

.kv-grid>div {
  padding: 12px 14px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.kv-grid>div:nth-child(2n) {
  border-right: none;
}

.kv-grid>div:nth-last-child(-n+2) {
  border-bottom: none;
}

.kv-grid .l {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
}

.kv-grid .v {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 4px;
}

.kv-grid .v .o {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
}

.fin-trends {
  padding: 8px 6px 6px;
}

.fin-trend-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}

.fin-trend-row:last-child {
  border-bottom: none;
}

.fin-trend-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fin-trend-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fin-trend-name::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.fin-trend-row.profit .fin-trend-name::before {
  background: var(--good);
}

.fin-trend-row.employees .fin-trend-name::before {
  background: var(--info);
}

.fin-trend-now {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.025em;
  color: var(--ink);
}

.fin-trend-delta {
  font-family: var(--mono);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.fin-trend-delta.up {
  color: var(--good-ink);
}

.fin-trend-delta.down {
  color: var(--bad-ink);
}

.fin-trend-delta i[data-lucide] {
  width: 10px;
  height: 10px;
  stroke-width: 2.2;
}

.fin-bars {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  height: 56px;
  align-items: end;
  margin-top: 6px;
}

.fin-bars>div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fin-bars .bar {
  width: 100%;
  min-width: 24px;
  background: oklch(from var(--accent) l c h / .15);
  border-radius: 3px 3px 0 0;
  position: relative;
  display: block;
}

.fin-bars .bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transform-origin: bottom;
  transform: scaleY(var(--fill, 1));
}

.fin-trend-row.profit .fin-bars .bar {
  background: oklch(from var(--good) l c h / .18);
}

.fin-trend-row.profit .fin-bars .bar::after {
  background: var(--good);
}

.fin-trend-row.profit .fin-bars .bar.neg::after {
  background: var(--bad);
}

.fin-trend-row.employees .fin-bars .bar {
  background: oklch(from var(--info) l c h / .18);
}

.fin-trend-row.employees .fin-bars .bar::after {
  background: var(--info);
}

.fin-bars .yr {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-5);
  margin-top: 2px;
}

.fin-bars>div.now .bar::after {
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px var(--ink);
}

.fin-bars>div.now .yr {
  color: var(--ink-2);
  font-weight: 600;
}

.fin-table tbody td {
  padding: 9px 22px;
  font-family: var(--mono);
  font-size: 12px;
}

.fin-table tbody td.label {
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 500;
}

.fin-table tbody tr.now td {
  background: oklch(from var(--accent) l c h / .04);
  color: var(--ink);
}

.tl {
  padding: 6px 22px 18px;
}

.tl-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  position: relative;
  padding-bottom: 18px;
}

.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--hairline);
}

.tl-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--hairline);
  display: grid;
  place-items: center;
  z-index: 1;
}

.tl-icon i[data-lucide] {
  width: 11px;
  height: 11px;
  color: var(--ink-3);
  stroke-width: 2;
}

.tl-icon.accent {
  background: var(--accent-soft);
  border-color: oklch(from var(--accent) l c h / .3);
}

.tl-icon.accent i[data-lucide] {
  color: var(--accent-ink);
}

.tl-when {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
}

.tl-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 4px;
  line-height: 1.4;
}

.tl-detail {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.5;
}

.note-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 22px;
  border-left: 3px solid var(--accent);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

.note-card .author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin-bottom: 6px;
}

.note-card .author .av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #5B6CFF;
  color: white;
  font-size: 9px;
  font-weight: 600;
}

.payload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
}

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

.payload-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}

.payload-card summary {
  list-style: none;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.payload-card summary::-webkit-details-marker {
  display: none;
}

.payload-card summary i[data-lucide] {
  width: 14px;
  height: 14px;
  color: var(--ink-4);
  transition: transform .15s;
}

.payload-card[open] summary i[data-lucide] {
  transform: rotate(90deg);
}

.payload-card pre {
  margin: 0;
  padding: 14px 18px;
  background: var(--surface-sunk);
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow: auto;
  max-height: 320px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.empty {
  padding: 30px 22px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}

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

  .df-amount,
  .df-count {
    text-align: left;
  }

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

  .df-sum-cell {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 4px;
  }

  .df-sum-cell:last-child {
    border-bottom: none;
  }

  .tk-row {
    grid-template-columns: 28px 1fr;
  }

  .tk-row-side {
    grid-column: 2;
  }

  .kv>div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .kv-grid>div {
    border-right: none !important;
  }
}

/* Corrections for redesigned companies page */
.page-companies .insight-card {
  display: block;
  align-items: initial;
  gap: 0;
  min-width: 0;
}

.page-companies .insights-stack,
.page-companies .list-layout>aside {
  min-width: 0;
}

.page-companies .att-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.page-companies .att-text,
.page-companies .att-meta,
.page-companies .rank-name,
.page-companies .dist-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-companies .att-count {
  white-space: nowrap;
}

.page-companies .seg-empty-note {
  align-self: center;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  white-space: nowrap;
}

.page-companies .filter-pill-field select {
  width: 170px;
  max-width: 170px;
  text-overflow: ellipsis;
}

.page-companies .filter-pill-field select[name="industry"] {
  width: 220px;
  max-width: 220px;
}

.industry-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 220px;
}

.industry-lines span {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.last-action .last-action-sep {
  color: var(--ink-5);
  margin: 0 2px;
}

.last-action.stale {
  color: var(--bad-ink);
}

@media (max-width: 1280px) {

  .page-companies .filter-pill-field select,
  .page-companies .filter-pill-field select[name="industry"] {
    width: 150px;
    max-width: 150px;
  }
}


/* Company profile timeline status colors */
.tl-icon.good {
  background: var(--good-soft);
  border-color: oklch(from var(--good) l c h / .3);
}

.tl-icon.good i[data-lucide] {
  color: var(--good-ink);
}

.tl-icon.warn {
  background: var(--warn-soft);
  border-color: oklch(from var(--warn) l c h / .3);
}

.tl-icon.warn i[data-lucide] {
  color: var(--warn-ink);
}

.tl-icon.info {
  background: var(--info-soft);
  border-color: oklch(from var(--info) l c h / .3);
}

.tl-icon.info i[data-lucide] {
  color: var(--info);
}

/* Corrections for redesigned company profile */
.page-company .bc-contact-row {
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
}

.page-company .bc-contact-row i[data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.page-company .bc-contact-row a,
.page-company .bc-contact-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-company .bc-linkedin-inline {
  display: inline;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.page-company .bc-linkedin-inline .js-inline-editable {
  display: inline;
  min-width: 42px;
  max-width: 100%;
}

.page-company .bc-linkedin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-4);
  line-height: 1;
  text-decoration: none;
  vertical-align: -9px;
  margin-left: 10px;
}

.page-company .bc-linkedin-button[hidden] {
  display: none;
}

.page-company .bc-linkedin-button i[data-lucide] {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
  color: currentColor;
}

.page-company .bc-linkedin-button:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--accent-ink);
}

.page-company .note-card .author .av {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  overflow: hidden;
  border-radius: 50%;
  line-height: 1;
}

.page-company .note-card .author .av img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* Company profile polish: compact contact icons, timeline owner avatar, hidden payloads */
.company-new-shell .bc-contact-row {
  grid-template-columns: 18px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
  min-height: 22px;
  font-size: 12px !important;
  line-height: 1.35;
}

.company-new-shell .bc-contact-row>i[data-lucide],
.company-new-shell .bc-contact-row>svg,
.company-new-shell .bc-contact-row>.lucide {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  stroke-width: 1.9 !important;
  color: var(--ink-4) !important;
  justify-self: start;
  align-self: center;
}

.company-new-shell .bc-contact-row a,
.company-new-shell .bc-contact-row span {
  display: inline-block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-new-shell .bc-contact-row .bc-linkedin-inline {
  display: inline;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.company-new-shell .bc-contact-row .bc-linkedin-inline .js-inline-editable {
  display: inline;
}

.company-new-shell .bc-contact-row .bc-linkedin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  min-width: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-4);
  line-height: 1;
  text-decoration: none;
  vertical-align: -9px;
  margin-left: 10px;
}

.company-new-shell .bc-contact-row .bc-linkedin-button[hidden] {
  display: none;
}

.company-new-shell .bc-contact-row .bc-linkedin-button i[data-lucide] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  max-width: 15px;
  min-height: 15px;
  max-height: 15px;
  stroke-width: 1.9;
  color: currentColor;
}

.company-new-shell .tl-item {
  grid-template-columns: 28px minmax(0, 1fr) !important;
  gap: 12px !important;
}

.company-new-shell .tl-item:not(:last-child)::before {
  left: 13px !important;
  top: 22px !important;
}

.company-new-shell .tl-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.company-new-shell .tl-rail .tl-icon {
  flex: 0 0 24px;
}

.company-new-shell .tl-owner-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}

.company-new-shell .tl-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.company-new-shell .payload-grid {
  display: none !important;
}


/* Fixuri portofoliu firme + dashboard dreamclient */
.rank-row {
  grid-template-columns: minmax(0, 1fr) 118px;
}

.rank-val {
  display: grid;
  grid-template-columns: 76px 34px;
  gap: 8px;
  align-items: center;
  justify-content: end;
  width: 118px;
  text-align: right;
}

.rank-val .rank-bar {
  width: 76px;
  margin-right: 0;
  justify-self: start;
}

.rank-val .rank-bar>span {
  transform-origin: left center;
}

.att-row {
  cursor: pointer;
}

.dreamclient-target-bar {
  overflow: visible;
}

.dreamclient-target-bar .bullet-target {
  left: var(--target-pct, 80%);
  z-index: 2;
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--surface);
}

.dreamclient-target-bar .bullet-fill {
  z-index: 1;
}

.dreamclient-owner-row {
  grid-template-columns: 160px 1fr 96px;
}

/* ============================================================
   Shared app sidebar refresh — aligned with 2026 templates
   ============================================================ */
.app-sidebar.cockpit-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  padding: calc(22px * var(--unit)) calc(18px * var(--unit));
  border-right: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
  gap: calc(18px * var(--unit));
  overflow-y: auto;
  overflow-x: hidden;
}

.app-sidebar.cockpit-sidebar .sidebar-brand-template {
  margin-bottom: 6px;
  flex-shrink: 0;
}

.app-sidebar.cockpit-sidebar .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
  box-shadow: 0 10px 24px -14px oklch(from var(--accent) l c h / 0.65);
}

.app-sidebar.cockpit-sidebar .brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.app-sidebar.cockpit-sidebar .brand-sub {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-4);
  letter-spacing: .08em;
}

.app-sidebar.cockpit-sidebar .nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.app-sidebar.cockpit-sidebar .nav-label {
  padding: 11px 10px 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .nav-item {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
}

.app-sidebar.cockpit-sidebar .nav-item:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

.app-sidebar.cockpit-sidebar .nav-item.active,
.app-sidebar.cockpit-sidebar .nav-item.is-active {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}

.app-sidebar.cockpit-sidebar .nav-item i[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex: 0 0 18px;
}

.app-sidebar.cockpit-sidebar .nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-3);
  min-width: 24px;
  text-align: center;
}

.app-sidebar.cockpit-sidebar .nav-item.active .nav-count,
.app-sidebar.cockpit-sidebar .nav-item.is-active .nav-count {
  background: oklch(from var(--bg) l c h / 0.18);
  color: var(--bg);
}

.app-sidebar.cockpit-sidebar .sidebar-rule {
  height: 1px;
  background: var(--hairline);
  margin: 4px 10px;
  flex-shrink: 0;
}

.app-sidebar.cockpit-sidebar .sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  flex-shrink: 0;
}

.app-sidebar.cockpit-sidebar .sync-pill {
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-3);
  box-shadow: none;
}

.app-sidebar.cockpit-sidebar .sync-pill strong {
  color: var(--ink-2);
  font-weight: 600;
}

.app-sidebar.cockpit-sidebar .sidebar-user-chip {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.app-sidebar.cockpit-sidebar .user-copy {
  min-width: 0;
  flex: 1;
}

.app-sidebar.cockpit-sidebar .user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar.cockpit-sidebar .user-role {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

.app-sidebar.cockpit-sidebar .user-logout {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--ink-4);
  flex-shrink: 0;
  text-decoration: none;
}

.app-sidebar.cockpit-sidebar .user-logout:hover {
  background: var(--surface-sunk);
  color: var(--ink-2);
}

.app-sidebar.cockpit-sidebar .user-logout i[data-lucide] {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  .app-sidebar.cockpit-sidebar {
    display: none;
  }
}

/* Sidebar static metrics and disabled entries */
.app-sidebar.cockpit-sidebar .nav-stat,
.app-sidebar.cockpit-sidebar .nav-disabled {
  cursor: default;
  user-select: none;
}

.app-sidebar.cockpit-sidebar .nav-stat {
  min-height: 36px;
  margin: 1px 4px;
  padding: 7px 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
}

.app-sidebar.cockpit-sidebar .nav-stat:hover {
  background: transparent;
  color: var(--ink-2);
}

.app-sidebar.cockpit-sidebar .nav-stat i[data-lucide] {
  color: var(--ink-3);
}

.app-sidebar.cockpit-sidebar .nav-stat .nav-count {
  background: var(--surface-sunk);
  border: 1px solid var(--hairline);
  color: var(--ink-3);
}

.app-sidebar.cockpit-sidebar .nav-disabled {
  min-height: 36px;
  margin: 1px 4px;
  padding: 7px 8px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-5);
  opacity: .72;
  filter: grayscale(.25);
}

.app-sidebar.cockpit-sidebar .nav-disabled:hover {
  background: transparent;
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .nav-disabled i[data-lucide] {
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .nav-soon {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-5);
  border: 1px dashed var(--hairline);
}

/* Sidebar quick metrics: compact stats, not menu entries */
.app-sidebar.cockpit-sidebar .sidebar-mini-kpis {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 2px 0;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: oklch(from var(--surface-2) l c h / .68);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .55);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis::before {
  content: "Snapshot";
  display: block;
  padding: 0 4px 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-operational {
  margin-top: 8px;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-operational::before {
  content: "Status";
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi {
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: default;
  user-select: none;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi+.sidebar-mini-kpi {
  border-top: 1px dashed var(--hairline);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi:hover {
  background: transparent;
  color: var(--ink-2);
}

.app-sidebar.cockpit-sidebar .mini-kpi-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink-3);
  flex: 0 0 20px;
}

.app-sidebar.cockpit-sidebar .mini-kpi-icon i[data-lucide] {
  width: 12px;
  height: 12px;
  stroke-width: 1.9;
}

.app-sidebar.cockpit-sidebar .mini-kpi-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-sidebar.cockpit-sidebar .mini-kpi-label {
  order: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar.cockpit-sidebar .mini-kpi-value {
  order: 2;
  min-width: 28px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink-2);
  white-space: nowrap;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi-disabled {
  opacity: .58;
  filter: grayscale(.35);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi-disabled .mini-kpi-icon {
  background: transparent;
  border-style: dashed;
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpi-disabled .mini-kpi-label {
  color: var(--ink-5);
}

.app-sidebar.cockpit-sidebar .mini-kpi-soon {
  min-width: auto;
  padding: 2px 6px;
  border-style: dashed;
  font-size: 8.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-5);
  background: var(--surface-sunk);
}

@media (max-width: 1160px) and (min-width: 901px) {
  .app-sidebar.cockpit-sidebar .sidebar-mini-kpis {
    padding: 7px;
  }

  .app-sidebar.cockpit-sidebar .mini-kpi-label {
    display: none;
  }

  .app-sidebar.cockpit-sidebar .mini-kpi-copy {
    justify-content: center;
  }

  .app-sidebar.cockpit-sidebar .mini-kpi-value {
    min-width: 0;
    padding: 2px 5px;
  }
}

/* Smaller close control inside active filter chips */
.active-chip .x,
.page-companies .active-chip .x {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  flex: 0 0 14px !important;
}

.active-chip .x i[data-lucide],
.active-chip .x svg,
.page-companies .active-chip .x i[data-lucide],
.page-companies .active-chip .x svg {
  width: 9px !important;
  height: 9px !important;
  stroke-width: 2.5;
}

/* Dashboard: HubSpot-style won reconciliation summary */
.won-reconcile {
  margin: 0 24px 18px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface-2);
}

.won-reconcile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.won-reconcile-head strong {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--ink);
}

.won-owner-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.won-owner-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.won-owner-pill strong {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
}

.won-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 14px;
}

.won-summary-row {
  display: grid;
  grid-template-columns: minmax(80px, .8fr) minmax(120px, 1.5fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px dashed var(--hairline);
  font-size: 12.5px;
}

.won-summary-owner,
.won-summary-stage {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.won-summary-owner {
  color: var(--ink);
  font-weight: 600;
}

.won-summary-stage {
  color: var(--ink-2);
}

.won-summary-count {
  justify-self: end;
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .won-reconcile-head {
    flex-direction: column;
  }

  .won-owner-pills {
    justify-content: flex-start;
  }

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

  .won-summary-stage {
    grid-column: 1 / -1;
    white-space: normal;
  }
}

/* Company task filter chips */
.sec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.sec-tab {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
  cursor: default;
}

.sec-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  box-shadow: 0 8px 18px -14px rgba(16, 24, 40, .75);
}

.sec-tab .ct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.sec-tab.active .ct {
  background: rgba(255, 255, 255, .16);
  color: var(--surface);
}

@media (max-width:780px) {
  .sec-tabs {
    padding: 12px 14px;
    gap: 6px;
  }

  .sec-tab {
    flex: 1 1 calc(50% - 6px);
    justify-content: space-between;
  }
}

/* ============================================================
   MOBILE HARDENING PATCH — phones/tablets only
   Keeps desktop untouched; appended last to win over older rules.
   ============================================================ */
@media (max-width: 900px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1990;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
  }

  .app-shell,
  .shell {
    display: block !important;
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }

  .app-main,
  .main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px 14px 40px !important;
  }

  .page-stack {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
  }

  .app-sidebar,
  .sidebar,
  .app-sidebar.cockpit-sidebar {
    display: flex !important;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 320px) !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(-105%) !important;
    transition: transform .22s ease !important;
    z-index: 2000 !important;
    box-shadow: 28px 0 60px rgba(15, 23, 42, .22) !important;
  }

  body.sidebar-open .app-sidebar,
  body.sidebar-open .sidebar,
  body.sidebar-open .app-sidebar.cockpit-sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-toggle,
  .page-index .sidebar-toggle {
    display: inline-grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 12px !important;
    flex: 0 0 42px !important;
  }

  .topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    padding: 14px !important;
    margin: -2px 0 18px !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 18px !important;
    background: oklch(from var(--surface) l c h / .94) !important;
    box-shadow: var(--shadow-sm) !important;
    backdrop-filter: blur(14px) !important;
  }

  .topbar-copy,
  .topbar-lead {
    min-width: 0 !important;
  }

  .topbar-kicker,
  .topbar .eyebrow {
    margin-bottom: 6px !important;
    padding: 0 !important;
    background: transparent !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: .10em !important;
  }

  .topbar h1,
  .topbar-title {
    font-size: clamp(22px, 7vw, 28px) !important;
    line-height: 1.05 !important;
    letter-spacing: -.035em !important;
    margin: 0 !important;
  }

  .topbar p,
  .topbar-subtitle {
    margin-top: 7px !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    max-width: 100% !important;
  }

  .topbar-actions {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    justify-items: stretch !important;
  }

  .topbar-search,
  .search-box,
  .page-index .search-box,
  .page-companies .search-box,
  .page-company .search-box,
  .page-sync .search-box,
  .page-sync_financial .search-box {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    border-radius: 12px !important;
    padding: 9px 11px !important;
  }

  .topbar-badges {
    justify-content: flex-start !important;
    gap: 6px !important;
  }

  .topbar-badges .chip:nth-child(n+2) {
    display: none !important;
  }

  .section {
    margin-top: 22px !important;
  }

  .section-head,
  .page-head,
  .card-head,
  .panel-header,
  .card-head-with-actions,
  .exec-activity-card .card-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .section-title,
  .page-title,
  .card-head h3,
  .panel h3,
  .hero-head h2 {
    font-size: clamp(19px, 5.4vw, 24px) !important;
    line-height: 1.16 !important;
  }

  .section-sub,
  .page-sub,
  .card-head p,
  .panel-description,
  .muted {
    max-width: 100% !important;
    font-size: 12.75px !important;
    line-height: 1.5 !important;
  }

  .card,
  .panel,
  .login-card,
  .hero-card,
  .metric-card,
  .compare-card,
  .company-card,
  .stat-card,
  .surface-card,
  .sync-card,
  .timeline-card,
  .list-item,
  .timeline-item,
  .activity-row,
  .risk-item,
  .company-row-card {
    border-radius: 18px !important;
  }

  .card-padded,
  .panel,
  .hero-card,
  .compare-card,
  .company-card,
  .login-card,
  .surface-card {
    padding: 16px !important;
  }

  .card-head {
    padding: 16px !important;
  }

  .hero-grid,
  .panel-grid,
  .panel-grid.two-cols,
  .panel-grid.three-cols,
  .metrics-grid,
  .metrics-grid.four,
  .metrics-grid.secondary,
  .compare-grid,
  .company-stats-grid,
  .financial-trend-grid,
  .contacts-grid,
  .summary-strip,
  .account-header-card,
  .dashboard-filter-grid,
  .filters-grid,
  .form-grid,
  .cockpit-two-up,
  .cockpit-two-up.narrow,
  .payload-grid,
  .vf-summary-strip,
  .company-row-card,
  .co-hero,
  .co-layout,
  .bc-grid,
  .df-summary,
  .kv-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-metrics,
  .hero-foot-grid,
  .account-meta-grid,
  .exec-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .co-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .filter-span-2,
  [style*="grid-column:1/-1"] {
    grid-column: 1 / -1 !important;
  }

  .page-reports .form-grid,
  .page-admin_users .form-grid,
  .page-sync .form-grid,
  .page-sync_financial .form-grid {
    grid-template-columns: 1fr !important;
  }

  .page-reports form[method="post"],
  .page-admin_users form[method="post"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .page-reports form[method="post"]>*,
  .page-admin_users form[method="post"]>* {
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-reports form[method="post"] label,
  .page-admin_users form[method="post"] label {
    margin-bottom: 2px !important;
  }

  input,
  select,
  textarea,
  .input-like,
  .filter-pill-field select,
  .filter-pill-field input {
    min-height: 44px !important;
    font-size: 16px !important;
    max-width: 100% !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: auto !important;
    min-height: 0 !important;
    font-size: inherit !important;
  }

  .btn,
  button.btn,
  a.btn {
    min-height: 42px !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .page-reports .btn,
  .page-admin_users .btn,
  .page-sync .btn,
  .page-sync_financial .btn {
    width: 100% !important;
  }

  .chip,
  .pill,
  .tag,
  .role-chip,
  .status-badge {
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  .filter-bar {
    width: 100% !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .filter-bar-label .label-text,
  .filter-pill .label-text,
  .filter-pill .chev,
  .filter-search input,
  .filter-search kbd {
    display: inline !important;
  }

  .filter-pill,
  .filter-search,
  .filter-actions-right {
    min-width: 0 !important;
    width: 100% !important;
  }

  .filter-actions-right {
    margin-left: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .seg,
  .period-chips,
  .sec-tabs,
  .owner-chip-strip,
  .timeline-owner-chips,
  .timeline-type-chips {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .seg,
  .period-chips {
    flex-wrap: nowrap !important;
  }

  .seg button,
  .period-chips>*,
  .sec-tab {
    flex: 0 0 auto !important;
  }

  .sec-tabs {
    padding: 12px 14px !important;
    gap: 6px !important;
  }

  .sec-tab {
    min-width: max-content !important;
    justify-content: center !important;
  }

  .list-item,
  .risk-item,
  .snapshot-line,
  .kv-list>div,
  .company-row-actions,
  .account-title-row,
  .won-reconcile-head {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .company-row-actions,
  .account-actions,
  .card-head-actions,
  .consultant-card-actions,
  .section-actions,
  .filters-actions,
  .dashboard-filter-actions {
    width: 100% !important;
    justify-content: stretch !important;
  }

  .company-row-actions>*,
  .account-actions>*,
  .card-head-actions>*,
  .section-actions>*,
  .filters-actions>*,
  .dashboard-filter-actions>* {
    flex: 1 1 auto !important;
  }

  .table-shell,
  .table-wrap,
  .page-admin_users .card div[style*="overflow:auto"],
  .page-reports .card div[style*="overflow:auto"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  table,
  .data-table,
  table.companies {
    min-width: 680px !important;
    font-size: 12.5px !important;
  }

  .page-admin_users table {
    min-width: 760px !important;
  }

  th,
  td {
    padding: 12px 10px !important;
  }

  .alert,
  .sync-result,
  .empty-state {
    border-radius: 16px !important;
    padding: 14px !important;
    overflow-wrap: anywhere !important;
  }

  .metric-value,
  .summary-tile .value,
  .company-kpi-value,
  .hero-metric-value {
    font-size: clamp(24px, 9vw, 34px) !important;
    overflow-wrap: anywhere !important;
  }

  .note-card,
  .activity-row,
  .tl-card,
  .bc-card,
  .df-row,
  .tk-row,
  .won-reconcile,
  .input-like,
  pre,
  code {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .json-box,
  pre {
    max-width: 100% !important;
    overflow-x: auto !important;
    font-size: 11.5px !important;
  }

  .apexcharts-canvas,
  .apexcharts-svg,
  .chart-apex-exec-activity,
  .chart-apex-exec,
  .chart-apex,
  [id$="-chart"] {
    max-width: 100% !important;
  }

  .exec-owner-html-chart {
    min-width: 520px !important;
  }

  .exec-owner-html-chart,
  .pipeline-apex-wrap,
  .vf-main-list,
  .vf-stages-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .pipeline-apex-grid {
    min-width: 520px !important;
  }

  .trend-bars {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)) !important;
  }

  .company-new-shell .tl-item,
  .tl-item,
  .tk-row,
  .df-row,
  .won-summary-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .company-new-shell .tl-rail {
    display: none !important;
  }

  .won-summary-stage,
  .won-summary-owner,
  .company-row-main .subline,
  .bc-contact-row a,
  .bc-contact-row span {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 520px) {

  .app-main,
  .main {
    padding: 10px 10px 34px !important;
  }

  .topbar {
    padding: 12px !important;
    border-radius: 16px !important;
    gap: 10px !important;
  }

  .topbar h1,
  .topbar-title {
    font-size: 22px !important;
  }

  .topbar p,
  .topbar-subtitle {
    font-size: 12px !important;
  }

  .topbar-badges {
    display: none !important;
  }

  .card-padded,
  .panel,
  .hero-card,
  .compare-card,
  .company-card,
  .login-card,
  .surface-card {
    padding: 14px !important;
  }

  .card-head {
    padding: 14px !important;
  }

  .co-kpis,
  .companies-stats-grid,
  .stat-ribbon {
    grid-template-columns: 1fr !important;
  }

  .sec-tab,
  .seg button,
  .period-chips>* {
    min-width: max-content !important;
  }

  table,
  .data-table,
  table.companies {
    min-width: 620px !important;
  }

  .page-admin_users table {
    min-width: 720px !important;
  }

  .exec-owner-html-chart,
  .pipeline-apex-grid {
    min-width: 500px !important;
  }
}

/* Victa Xperience experimental dashboard */
.victa-xp-page code {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: rgba(15, 23, 42, .06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
}

.victa-hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.victa-hero-panel h2 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -.04em;
}

.victa-hero-panel p {
  max-width: 780px;
  color: var(--muted);
  margin: 0;
}

.victa-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.victa-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.victa-grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.victa-table-wrap {
  overflow: auto;
}

.victa-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.victa-table th,
.victa-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.victa-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 800;
  background: rgba(15, 23, 42, .025);
}

.victa-table td {
  font-size: 14px;
}

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

.victa-journey-table {
  min-width: 1240px;
}

.victa-comment-cell {
  white-space: normal;
  min-width: 260px;
  color: var(--muted);
  line-height: 1.45;
}

.victa-debug-list {
  padding: 0 18px 18px;
  display: grid;
  gap: 10px;
}

.victa-debug-list>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .025);
}

.victa-debug-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.victa-debug-list strong {
  font-size: 15px;
}

.victa-debug-list-subjects>div {
  align-items: flex-start;
}

.victa-diagnostics-card {
  margin-top: 18px;
}

.empty-cell {
  text-align: center !important;
  color: var(--muted);
  padding: 28px !important;
}

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

  .victa-grid-two,
  .victa-grid-three {
    grid-template-columns: 1fr;
  }

  .victa-hero-panel {
    flex-direction: column;
  }
}

@media(max-width:720px) {
  .victa-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Commercial service status layer — aligned with existing UI
   ============================================================ */
.company-flash {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
}

.company-flash.error {
  background: var(--danger-soft, #fee2e2);
  color: var(--danger, #b91c1c);
}

.commercial-status-grid,
.key-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.service-status-card,
.key-person-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: none;
}

.service-status-card.is-expired {
  border-color: color-mix(in oklab, var(--warning, #d97706) 38%, var(--hairline));
  background: color-mix(in oklab, var(--warning-soft, #fef3c7) 42%, var(--surface));
}

.service-status-top,
.key-person-head,
.service-history-item,
.meeting-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-status-top,
.key-person-head {
  margin-bottom: 14px;
}

.service-name,
.key-person-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.service-meta,
.service-expiry,
.service-history-meta,
.service-history-note,
.key-person-hint,
.key-person-updated,
.company-cell small,
.status-cell small,
.meeting-body span {
  color: var(--ink-4);
  font-size: 11.5px;
  line-height: 1.45;
}

.service-expiry,
.service-alert,
.meeting-date {
  display: flex;
  align-items: center;
  gap: 7px;
}

.service-expiry,
.service-alert {
  margin: 8px 0 10px;
  font-size: 12px;
  font-weight: 500;
}

.service-alert {
  color: var(--warning, #d97706);
}

.service-expiry i[data-lucide],
.service-alert i[data-lucide],
.meeting-date i[data-lucide] {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.service-form-row,
.key-person-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.service-form-row label,
.key-person-fields label,
.meeting-form label,
.status-filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.service-form-row input,
.service-form-row select,
.key-person-fields input,
.meeting-form input,
.meeting-form select,
.status-filter-bar input,
.status-filter-bar select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  outline: none;
}

.service-form-row input:focus,
.service-form-row select:focus,
.key-person-fields input:focus,
.meeting-form input:focus,
.meeting-form select:focus,
.status-filter-bar input:focus,
.status-filter-bar select:focus {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--hairline));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent);
}

.service-save {
  margin-top: 12px;
  width: 100%;
}

.service-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--hairline);
  background: var(--surface-sunk);
  color: var(--ink-3);
}

.service-pill.good {
  background: var(--success-soft, #dcfce7);
  color: var(--green, #15803d);
  border-color: transparent;
}

.service-pill.info {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}

.service-pill.warn {
  background: var(--warning-soft, #fef3c7);
  color: var(--warning, #d97706);
  border-color: transparent;
}

.service-pill.bad {
  background: var(--danger-soft, #fee2e2);
  color: var(--danger, #b91c1c);
  border-color: transparent;
}

.service-pill.muted {
  background: var(--surface-sunk);
  color: var(--ink-4);
}

.service-history-block {
  margin-top: 22px;
}

.service-history-block h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.service-history-list,
.meeting-list {
  display: grid;
  gap: 10px;
}

.service-history-item,
.meeting-item {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 12px 14px;
}

.service-history-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-2);
}

.service-history-main strong {
  color: var(--ink);
  font-weight: 600;
}

.meeting-form {
  display: grid;
  grid-template-columns: 150px 180px minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.meeting-date {
  min-width: 118px;
  font-weight: 500;
  color: var(--ink);
}

.meeting-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.key-person-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.btn.btn-xs {
  padding: 6px 8px;
  border-radius: 8px;
  min-height: 0;
  font-size: 12px;
}

.commercial-dashboard-shell {
  display: block;
}

.commercial-dashboard-intro {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.commercial-status-help {
  transform: translateY(-1px);
}

.status-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 10px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 1px 0 color-mix(in oklab, white 60%, transparent) inset, 0 6px 20px -12px color-mix(in oklab, black 18%, transparent);
}

.status-filter-bar label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
}

.status-filter-bar input,
.status-filter-bar select {
  width: auto;
  min-width: 140px;
  border: none;
  background: var(--surface-sunk);
  min-height: 32px;
}

.status-filter-bar input[type="search"] {
  min-width: 230px;
}

.status-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.status-kpi {
  min-width: 110px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 10px 12px;
}

.status-kpi.compact {
  min-width: 92px;
}

.status-kpi span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-4);
}

.status-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
}

.status-matrix-wrap {
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.status-matrix-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.status-matrix-table th,
.status-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  text-align: left;
  vertical-align: middle;
}

.status-matrix-table th:last-child,
.status-matrix-table td:last-child {
  border-right: 0;
}

.status-matrix-table tr:last-child td {
  border-bottom: 0;
}

.status-matrix-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  white-space: nowrap;
}

.status-matrix-table tbody tr:hover {
  background: var(--surface-2);
}

.owner-cell {
  width: 130px;
  color: var(--ink-2);
  font-weight: 500;
}

.company-cell {
  width: 230px;
}

.company-cell a {
  display: block;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.company-cell a:hover {
  text-decoration: underline;
}

.company-cell small,
.status-cell small {
  display: block;
  margin-top: 5px;
}

.status-cell {
  min-width: 118px;
}

.status-cell.expired {
  background: color-mix(in oklab, var(--warning-soft, #fef3c7) 48%, transparent);
}

.empty-cell {
  text-align: center !important;
  color: var(--ink-4) !important;
  padding: 26px !important;
}

@media (max-width: 980px) {

  .service-form-row,
  .key-person-fields,
  .meeting-form {
    grid-template-columns: 1fr;
  }

  .service-history-item,
  .meeting-item {
    flex-direction: column;
  }

  .status-filter-bar {
    align-items: stretch;
  }

  .status-filter-bar label,
  .status-filter-bar input,
  .status-filter-bar select,
  .status-filter-bar .btn {
    width: 100%;
  }
}

/* Company page: editable contacts/services reusing existing card rhythm */
.bc-grid-four,
.service-grid-flat {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bc-grid-four .bc-card,
.service-grid-flat .bc-card {
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.bc-grid-four .bc-card:nth-child(4n),
.service-grid-flat .bc-card:nth-child(4n) {
  border-right: none;
}

.bc-grid-four .bc-card:last-child,
.service-grid-flat .bc-card:last-child {
  border-right: none;
}

.bc-role.role-4::before {
  background: var(--warn);
}

.bc-role.role-4 {
  color: var(--warn);
}

.bc-empty-cta.as-button,
.bc-person-button,
.field-button,
.service-status-main {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.bc-empty-cta.as-button {
  width: 100%;
}

.bc-person-button {
  width: 100%;
}

.field-button {
  width: 100%;
}

.field-button:hover span,
.bc-person-button:hover .bc-name {
  color: var(--accent-ink);
}

.is-hidden {
  display: none !important;
}

.bc-inline-editor {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline);
}

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

.inline-editor-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.inline-editor-grid input,
.inline-editor-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  outline: none;
}

.inline-editor-grid input:focus,
.inline-editor-grid select:focus {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--hairline));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent);
}

.inline-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.inline-save-state {
  margin-right: auto;
  font-size: 11px;
  color: var(--ink-4);
}

.inline-save-state.ok {
  color: var(--good-ink);
}

.inline-save-state.err {
  color: var(--bad-ink);
}

.service-contact-card.is-expired {
  background: color-mix(in oklab, var(--warn-soft, #fef3c7) 36%, var(--surface));
}

.service-status-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 2px 0 4px;
}

.service-warning {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn, #d97706);
}

.service-warning i[data-lucide] {
  width: 13px;
  height: 13px;
}

.service-contact-fields {
  min-height: 126px;
}

.service-history-strip {
  border-top: 1px solid var(--hairline);
  padding: 16px 22px 18px;
}

.service-history-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.service-history-list.flat {
  gap: 0;
}

.service-history-list.flat .service-history-item {
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  padding: 10px 0;
}

.service-history-list.flat .service-history-item:first-child {
  border-top: 0;
}

.empty.compact {
  padding: 18px 0 2px;
}

.meeting-form {
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  margin: 0;
  padding: 16px 22px;
  background: var(--surface);
}

.meeting-list {
  padding: 0 22px 18px;
  gap: 0;
}

.meeting-item {
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.meeting-list .meeting-item:first-child {
  border-top: 0;
}

@media (max-width: 1420px) {

  .bc-grid-four,
  .service-grid-flat {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bc-grid-four .bc-card:nth-child(4n),
  .service-grid-flat .bc-card:nth-child(4n) {
    border-right: 1px solid var(--hairline);
  }

  .bc-grid-four .bc-card:nth-child(2n),
  .service-grid-flat .bc-card:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 780px) {

  .bc-grid-four,
  .service-grid-flat {
    grid-template-columns: 1fr;
  }

  .bc-grid-four .bc-card,
  .service-grid-flat .bc-card {
    border-right: none !important;
  }

  .inline-editor-grid {
    grid-template-columns: 1fr;
  }

  .meeting-form {
    grid-template-columns: 1fr;
  }
}

/* Inline editing for company contacts and service statuses */
.js-inline-editable {
  cursor: text;
  border-radius: 6px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background .12s ease, box-shadow .12s ease, color .12s ease;
  font-style: normal;
}

.js-inline-editable:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  box-shadow: inset 0 -1px 0 color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--accent-ink);
}

.bc-name.js-inline-editable {
  display: inline-block;
  min-width: 90px;
}

.bc-contact-row .js-inline-editable {
  display: inline-block;
  min-width: 42px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.bc-inline-input,
.bc-inline-select {
  width: 100%;
  min-height: 28px;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, var(--hairline));
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  padding: 5px 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent);
}

.bc-name+.bc-inline-input,
.bc-person .bc-inline-input {
  font-size: 15px;
  font-weight: 600;
  min-height: 32px;
}

.service-pill.js-inline-editable {
  cursor: pointer;
  padding: 5px 10px;
  margin: 0;
}

.service-status-main .bc-inline-select {
  max-width: 190px;
}

.js-card-save-state {
  min-height: 14px;
  margin-top: 6px;
}

.js-inline-help {
  color: var(--ink-4);
}

.bc-card.empty .js-contact-shell.is-hidden {
  display: none !important;
}

/* Service status matrix: compact table + inline history drawer */
.status-filter-bar input[type="date"] {
  min-width: 132px;
}

.status-filter-bar select[name="date_mode"] {
  min-width: 130px;
}

.status-matrix-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.status-matrix-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}

.status-matrix-table th,
.status-matrix-table td {
  border: 1px solid var(--hairline);
  padding: 10px 10px;
  background: var(--surface);
  vertical-align: middle;
}

.status-matrix-table th:first-child,
.status-matrix-table td:first-child {
  border-left: 0;
}

.status-matrix-table th:last-child,
.status-matrix-table td:last-child {
  border-right: 0;
}

.status-matrix-table thead tr:first-child th {
  border-top: 0;
}

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

.status-matrix-table th {
  text-align: center;
  background: var(--surface-2);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.status-matrix-table th.col-owner,
.status-matrix-table th.col-company {
  text-align: left;
}

.status-matrix-table .owner-cell {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  font-size: 12.5px;
}

.status-matrix-table .company-cell {
  width: 155px;
  min-width: 155px;
  max-width: 155px;
  font-size: 12.5px;
  position: relative;
  overflow: hidden;
}

.status-matrix-table .company-cell.has-zoho-access-warning {
  padding-right: 22px;
}

.zoho-access-warning-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 34px;
  height: 32px;
  pointer-events: auto;
  z-index: 1;
  overflow: hidden;
}

.zoho-access-warning-badge::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 32px solid #f59e0b;
  border-left: 34px solid transparent;
  filter: drop-shadow(-1px 1px 0 rgba(120, 53, 15, .20));
}

.zoho-access-warning-badge span {
  position: absolute;
  top: 1px;
  right: 5px;
  color: #7c2d12;
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.04em;
}

.status-matrix-table .status-cell {
  width: 74px;
  min-width: 74px;
  max-width: 74px;
  padding: 9px 6px;
  text-align: center;
}

.status-cell-date {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.1;
  color: var(--ink-4);
  white-space: nowrap;
}

.service-pill-button {
  appearance: none;
  cursor: pointer;
  max-width: 100%;
}

.service-pill-button.is-open {
  outline: 2px solid color-mix(in oklab, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.status-history-row td {
  padding: 0 !important;
  background: var(--surface-2) !important;
  border-top: 0 !important;
}

.status-history-drawer {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
}

.status-history-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
}

.status-history-head span {
  color: var(--ink-4);
  font-size: 12px;
}

.status-timeline {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.status-timeline-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-timeline-item time {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
}

.status-history-arrow {
  color: var(--ink-4);
  font-size: 16px;
  line-height: 1;
}

.status-history-empty {
  padding: 14px 16px;
  color: var(--ink-4);
  background: var(--surface-2);
}

/* Matrix table cell reset: owner-cell is used elsewhere as flex, but here it must stay a real table cell. */
.status-matrix-table td.owner-cell,
.status-matrix-table td.company-cell,
.status-matrix-table td.status-cell {
  display: table-cell;
  box-sizing: border-box;
}

.status-matrix-table col.matrix-col-owner {
  width: 110px;
}

.status-matrix-table col.matrix-col-company {
  width: 150px;
}

.status-matrix-table col.matrix-col-service {
  width: 70px;
}

.status-matrix-table .owner-cell {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.status-matrix-table .company-cell small {
  display: block;
  margin-top: 4px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 10px;
}

@media (max-width: 1320px) {
  .status-matrix-table {
    min-width: 1120px;
  }

  .status-matrix-table .owner-cell {
    width: 104px;
    min-width: 104px;
    max-width: 104px;
  }

  .status-matrix-table .company-cell {
    width: 142px;
    min-width: 142px;
    max-width: 142px;
  }

  .status-matrix-table .status-cell {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
  }

  .service-pill {
    font-size: 10.5px;
    padding: 4px 7px;
  }
}

/* Dashboard statusuri servicii: compact filters without visible labels */
.status-filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(150px, .85fr) minmax(160px, .9fr) minmax(150px, .85fr) minmax(126px, .7fr) minmax(126px, .7fr) minmax(150px, .85fr) auto 42px;
  align-items: center;
  gap: 10px;
}

.status-filter-bar>input,
.status-filter-bar>select {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.status-filter-bar>input[type="search"] {
  min-width: 0;
}

.status-filter-bar>input[type="date"],
.status-filter-bar>input[name="date_from"],
.status-filter-bar>input[name="date_to"],
.status-filter-bar>select[name="date_mode"] {
  min-width: 0;
}

.status-filter-bar .btn.icon-only {
  width: 42px;
  min-width: 42px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.status-filter-bar .btn.icon-only i[data-lucide] {
  margin: 0;
}

.status-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  align-items: stretch;
}

.status-kpi,
.status-kpi.compact {
  min-width: 0;
}

.status-kpi span {
  line-height: 1.25;
  min-height: 26px;
}

@media (max-width: 1400px) {
  .status-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto 42px;
  }
}

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

  .status-filter-bar .btn.icon-only,
  .status-filter-bar .btn {
    width: 100%;
  }
}

/* Zoho Incasari section */
.company-incasari .sec-head {
  border-bottom: 1px solid var(--hairline);
}

.incasari-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.incasari-kpi {
  padding: 16px 22px;
  border-right: 1px solid var(--hairline);
  min-height: 84px;
}

.incasari-kpi:last-child {
  border-right: 0;
}

.incasari-kpi .k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-bottom: 7px;
}

.incasari-kpi .v {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.025em;
  color: var(--ink);
}

.incasari-kpi .v.small {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.4;
  margin-top: 8px;
}

.incasari-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.incasari-table th,
.incasari-table td {
  white-space: nowrap;
}

.incasari-table td.muted-cell {
  white-space: normal;
  min-width: 260px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.incasari-drawer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}

.incasari-drawer summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.incasari-drawer summary::-webkit-details-marker {
  display: none;
}

.incasari-drawer summary .badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-3);
}

.incasari-drawer summary i[data-lucide] {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--ink-4);
  transition: transform .15s ease;
}

.incasari-drawer[open] summary i[data-lucide] {
  transform: rotate(90deg);
}

.incasari-drawer-debug {
  background: var(--surface-2);
}

.incasari-debug-note {
  margin: 0 22px 18px;
}

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

  .incasari-kpi:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .incasari-kpis {
    grid-template-columns: 1fr;
  }

  .incasari-kpi {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .incasari-kpi:last-child {
    border-bottom: 0;
  }
}

/* Zoho Incasari drawer + diagnostics fixes */
.incasari-sync-note {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.incasari-drawer-content {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}

.incasari-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.incasari-diagnostic-item {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  padding: 12px 14px;
}

.incasari-diagnostic-item span {
  display: block;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.incasari-diagnostic-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.incasari-debug-table {
  min-width: 980px;
}

.incasari-debug-table .date-col {
  width: 105px;
  min-width: 105px;
}

.incasari-debug-table .name-col {
  min-width: 290px;
}

.incasari-debug-table .service-col {
  width: 150px;
  min-width: 150px;
}

.incasari-debug-table .amount-col {
  width: 110px;
  min-width: 110px;
}

.incasari-debug-table .id-col {
  width: 105px;
  min-width: 105px;
}

.incasari-debug-table .reason-col {
  min-width: 320px;
  max-width: 440px;
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: normal;
}

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

@media (max-width: 720px) {
  .incasari-diagnostic-grid {
    grid-template-columns: 1fr;
  }
}


/* Fix responsive filters without disturbing the app shell */
.app-sidebar.cockpit-sidebar {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-sidebar.cockpit-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Victa Xperience filters: deterministic grid instead of wrapping flex chaos */
.victa-xp-page .sales-filter-bar {
  display: grid;
  grid-template-columns:
    auto minmax(210px, auto) minmax(96px, .58fr) minmax(138px, .78fr) minmax(160px, .9fr) minmax(158px, .9fr) minmax(118px, .65fr) minmax(118px, .65fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: visible;
}

.victa-xp-page .sales-filter-bar .filter-bar-label,
.victa-xp-page .sales-filter-bar .seg,
.victa-xp-page .sales-filter-bar .filter-pill,
.victa-xp-page .sales-filter-bar .filter-search {
  min-width: 0;
}

.victa-xp-page .sales-filter-bar .filter-div {
  display: none;
}

.victa-xp-page .sales-filter-bar .seg {
  width: 100%;
}

.victa-xp-page .sales-filter-bar .seg button {
  padding: 7px 10px;
  white-space: nowrap;
}

.victa-xp-page .sales-filter-bar .filter-pill.filter-pill-field {
  width: 100%;
  padding: 7px 9px;
}

.victa-xp-page .sales-filter-bar .filter-pill-field select,
.victa-xp-page .sales-filter-bar .filter-pill-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.victa-xp-page .sales-filter-bar .filter-pill-field input[type="date"] {
  min-width: 0;
}

.victa-xp-page .sales-filter-bar .filter-actions-right {
  display: contents;
}

.victa-xp-page .sales-filter-bar .filter-search {
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
}

.victa-xp-page .sales-filter-bar .filter-search input {
  min-width: 0;
  width: 100%;
}

.victa-xp-page .sales-filter-bar .filter-actions-right>.filter-pill {
  justify-content: center;
  width: auto;
}

@media (max-width: 1700px) {
  .victa-xp-page .sales-filter-bar {
    grid-template-columns:
      auto minmax(190px, auto) minmax(88px, .54fr) minmax(126px, .74fr) minmax(145px, .85fr) minmax(145px, .85fr) minmax(112px, .62fr) minmax(112px, .62fr) minmax(170px, .95fr) auto;
    gap: 8px;
  }

  .victa-xp-page .sales-filter-bar .filter-pill,
  .victa-xp-page .sales-filter-bar .filter-search,
  .victa-xp-page .sales-filter-bar .seg button {
    font-size: 12px;
  }
}

@media (max-width: 1480px) {
  .victa-xp-page .sales-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .victa-xp-page .sales-filter-bar .filter-bar-label {
    display: none;
  }

  .victa-xp-page .sales-filter-bar .seg {
    grid-column: span 2;
  }

  .victa-xp-page .sales-filter-bar .filter-search {
    grid-column: span 3;
  }

  .victa-xp-page .sales-filter-bar .filter-actions-right>.filter-pill {
    width: 100%;
  }
}

@media (max-width: 920px) {
  .victa-xp-page .sales-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .victa-xp-page .sales-filter-bar .seg,
  .victa-xp-page .sales-filter-bar .filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .victa-xp-page .sales-filter-bar {
    grid-template-columns: 1fr;
  }

  .victa-xp-page .sales-filter-bar .seg,
  .victa-xp-page .sales-filter-bar .filter-search {
    grid-column: span 1;
  }

  .victa-xp-page .sales-filter-bar .seg {
    flex-wrap: wrap;
  }

  .victa-xp-page .sales-filter-bar .seg button {
    flex: 1 1 70px;
  }
}

/* Dashboard statusuri servicii filters */
.status-filter-bar {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.45fr) minmax(140px, .86fr) minmax(150px, .92fr) minmax(150px, .92fr) minmax(130px, .78fr) minmax(118px, .68fr) minmax(118px, .68fr) minmax(132px, .78fr) auto;
  align-items: center;
  gap: 10px;
}

.status-filter-bar>input,
.status-filter-bar>select {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.status-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 142px;
}

.status-filter-actions .btn {
  height: 36px;
  white-space: nowrap;
}

.status-filter-actions .btn.icon-only {
  width: 38px;
  min-width: 38px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.status-filter-actions .btn.icon-only i[data-lucide] {
  margin: 0;
}

@media (max-width: 1520px) {
  .status-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .status-filter-bar>input[type="search"] {
    grid-column: span 2;
  }

  .status-filter-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .status-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-filter-bar>input[type="search"],
  .status-filter-actions {
    grid-column: span 2;
  }

  .status-filter-actions .btn:first-child {
    flex: 1 1 auto;
  }
}

@media (max-width: 620px) {
  .status-filter-bar {
    grid-template-columns: 1fr;
  }

  .status-filter-bar>input[type="search"],
  .status-filter-actions {
    grid-column: span 1;
  }

  .status-filter-actions {
    width: 100%;
  }

  .status-filter-actions .btn:first-child {
    flex: 1 1 auto;
  }
}


/* Fix 3: compact sidebar metrics, sane company filters, styled Victa meta */
.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 2px 0;
  padding: 8px;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified::before {
  grid-column: 1 / -1;
  padding: 0 2px 2px;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .sidebar-mini-kpi {
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .sidebar-mini-kpi+.sidebar-mini-kpi {
  border-top: 1px solid var(--hairline);
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .mini-kpi-icon {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  flex-basis: 18px;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .mini-kpi-icon i[data-lucide] {
  width: 15px;
  height: 15px;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .mini-kpi-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  justify-content: stretch;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .mini-kpi-value {
  order: 1;
  justify-self: start;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11px;
  line-height: 1;
}

.app-sidebar.cockpit-sidebar .sidebar-mini-kpis-unified .mini-kpi-label {
  order: 2;
  font-size: 10.5px;
  line-height: 1.05;
  color: var(--ink-4);
}

.app-sidebar.cockpit-sidebar .nav-group {
  margin-bottom: 14px;
}

.app-sidebar.cockpit-sidebar .sidebar-rule {
  margin: 12px 0;
}

/* Companies filters: keep controls aligned instead of floating search to a second random row */
.page-companies .companies-filter-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1.25fr) minmax(150px, .72fr) minmax(170px, .82fr) minmax(150px, .72fr) minmax(260px, 1.12fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 12px 14px;
  overflow: visible;
}

.page-companies .companies-filter-bar .filter-div {
  display: none;
}

.page-companies .companies-filter-bar .filter-bar-label,
.page-companies .companies-filter-bar .seg,
.page-companies .companies-filter-bar .filter-pill,
.page-companies .companies-filter-bar .filter-search {
  min-width: 0;
}

.page-companies .companies-filter-bar .seg {
  width: 100%;
}

.page-companies .companies-filter-bar .seg button {
  padding: 7px 12px;
  white-space: nowrap;
}

.page-companies .companies-filter-bar .filter-pill-field {
  width: 100%;
  padding: 7px 10px;
}

.page-companies .companies-filter-bar .filter-pill-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-companies .companies-filter-bar .filter-actions-right {
  display: contents;
  margin-left: 0;
}

.page-companies .companies-filter-bar .filter-search {
  width: 100%;
  min-width: 0;
  padding: 7px 11px;
}

.page-companies .companies-filter-bar .filter-search input {
  min-width: 0;
}

.page-companies .companies-filter-bar .filter-actions-right>.filter-pill {
  justify-content: center;
  width: auto;
  padding-inline: 10px;
}

@media (max-width: 1500px) {
  .page-companies .companies-filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-companies .companies-filter-bar .filter-bar-label {
    display: none;
  }

  .page-companies .companies-filter-bar .seg {
    grid-column: span 2;
  }

  .page-companies .companies-filter-bar .filter-search {
    grid-column: span 3;
  }

  .page-companies .companies-filter-bar .filter-actions-right>.filter-pill {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .page-companies .companies-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-companies .companies-filter-bar .seg,
  .page-companies .companies-filter-bar .filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .page-companies .companies-filter-bar {
    grid-template-columns: 1fr;
  }

  .page-companies .companies-filter-bar .seg,
  .page-companies .companies-filter-bar .filter-search {
    grid-column: span 1;
  }

  .page-companies .companies-filter-bar .seg {
    flex-wrap: wrap;
  }

  .page-companies .companies-filter-bar .seg button {
    flex: 1 1 88px;
  }
}

/* Victa Xperience: diagnostics belong inside a designed meta card */
.victa-xp-page .victa-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: start;
  gap: 22px;
}

.victa-xp-page .hero-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 oklch(100% 0 0 / .55) inset;
}

.victa-xp-page .hero-meta-grid>div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--hairline);
}

.victa-xp-page .hero-meta-grid>div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.victa-xp-page .hero-meta-grid span {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--ink-5);
}

.victa-xp-page .hero-meta-grid strong {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}

@media (max-width: 1180px) {
  .victa-xp-page .victa-hero-panel {
    grid-template-columns: 1fr;
  }

  .victa-xp-page .hero-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .victa-xp-page .hero-meta-grid>div {
    display: grid;
    gap: 4px;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .victa-xp-page .hero-meta-grid strong {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .victa-xp-page .hero-meta-grid {
    grid-template-columns: 1fr;
  }
}

.companies .co-domain-compact {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--muted);
  text-decoration: none;
}

.companies .co-domain-compact:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* Role access + commercial actions additions */
.status-filter-bar {
  grid-template-columns:
    minmax(220px, 1.35fr) minmax(140px, .82fr) minmax(150px, .88fr) minmax(150px, .88fr) minmax(130px, .74fr) minmax(150px, .9fr) minmax(118px, .66fr) minmax(118px, .66fr) minmax(170px, .95fr) auto;
}

.commercial-actions-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .65fr) minmax(140px, .65fr) auto;
  margin-bottom: 16px;
}

.role-access-table th,
.role-access-table td {
  vertical-align: middle;
}

.role-access-table th small,
.role-access-table td small {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.access-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-width: 54px;
  font-size: 12px;
  color: var(--ink-2);
}

.access-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #2563eb);
}

.commercial-actions-page .data-table .num,
.role-access-table .num {
  text-align: right;
}

@media (max-width: 1520px) {
  .status-filter-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .commercial-actions-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .status-filter-bar,
  .commercial-actions-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Sync + actions table polish */
.tight-table-wrap,
.action-table-wrap {
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 0 oklch(100% 0 0 / .6) inset;
}

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

table.tight-data-table,
.commercial-actions-table {
  width: 100%;
  min-width: 980px;
  font-size: 12.5px;
}

.zoho-history-table {
  min-width: 960px;
  table-layout: fixed;
}

table.tight-data-table thead th,
.commercial-actions-table thead th {
  padding: 10px 14px;
  background: color-mix(in oklab, var(--surface-2) 84%, white);
}

table.tight-data-table tbody td,
.commercial-actions-table tbody td {
  padding: 10px 14px;
  line-height: 1.32;
  vertical-align: top;
}

.nowrap {
  white-space: nowrap;
}

.muted-cell {
  color: var(--ink-4);
}

.owner-cell {
  color: var(--ink-2);
  word-break: break-word;
}

.history-company-cell,
.action-company-cell,
.action-person-cell {
  min-width: 0;
  max-width: none;
}

.history-company-cell strong,
.action-company-cell strong,
.action-person-cell strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cell-subline {
  display: block;
  margin-top: 4px;
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.change-cell {
  min-width: 0;
}

.change-summary {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0 6px 6px 0;
  padding: 5px 8px;
  border: 1px solid color-mix(in oklab, var(--hairline) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface-2) 70%, white);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cell-warning {
  display: block;
  margin-top: 2px;
  color: color-mix(in oklab, var(--warning, #d97706) 82%, var(--ink));
  font-size: 11px;
  line-height: 1.25;
}

.zoho-history-table .date-col {
  width: 128px;
}

.zoho-history-table .company-col {
  width: 30%;
}

.zoho-history-table .cui-col {
  width: 90px;
}

.zoho-history-table .owner-col {
  width: 132px;
}

.zoho-history-table .change-col {
  width: auto;
}

.zoho-coverage-card .card-head {
  padding-bottom: 12px;
}

.zoho-coverage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 16px;
}

.zoho-coverage-summary>div {
  padding: 13px 14px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface-2);
}

.zoho-coverage-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.zoho-coverage-summary strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.inline-warning {
  margin: 0 18px 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--warning, #d97706) 26%, var(--hairline));
  border-radius: 16px;
  background: color-mix(in oklab, var(--warning-soft, #fef3c7) 58%, white);
  color: color-mix(in oklab, var(--warning, #d97706) 74%, var(--ink));
  font-size: 13px;
  line-height: 1.45;
}

.zoho-coverage-table {
  min-width: 860px;
}

.commercial-actions-page .card.card-padded {
  overflow: hidden;
}

.commercial-actions-table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
}

.commercial-actions-table th,
.commercial-actions-table td {
  border-bottom: 1px solid var(--hairline);
}

.commercial-actions-table tbody tr:hover {
  background: color-mix(in oklab, var(--surface-2) 80%, white);
}

.commercial-actions-table .company-col {
  min-width: 180px;
}

.commercial-actions-table .caen-col,
.commercial-actions-table .caen-cell {
  min-width: 340px;
  max-width: 520px;
}

.commercial-actions-table .caen-cell {
  color: var(--ink-2);
  line-height: 1.45;
}

.commercial-actions-table .email-cell {
  min-width: 190px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.commercial-actions-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Slightly stronger CA/CRE expired-candidate marker in the matrix corner */
.zoho-access-warning-badge {
  top: -6px;
  right: -6px;
  width: 40px;
  height: 38px;
}

.zoho-access-warning-badge::before {
  border-top-width: 38px;
  border-left-width: 40px;
}

.zoho-access-warning-badge span {
  top: 2px;
  right: 6px;
  font-size: 19px;
}

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

@media (max-width: 640px) {
  .zoho-coverage-summary {
    grid-template-columns: 1fr;
  }
}

/* Owner/SC cells in compact operational tables: keep table layout intact and reuse cockpit avatars. */
.zoho-history-table td.sc-owner-cell,
.commercial-actions-table td.sc-owner-cell,
.status-matrix-table td.sc-owner-cell {
  display: table-cell !important;
  vertical-align: middle;
  color: var(--ink-2);
  word-break: normal;
  overflow-wrap: anywhere;
}

.zoho-history-table td,
.zoho-history-table th {
  box-sizing: border-box;
}

.zoho-history-table tbody td.sc-owner-cell,
.commercial-actions-table tbody td.sc-owner-cell,
.status-matrix-table tbody td.sc-owner-cell {
  border-bottom: 1px solid var(--hairline);
}

.sc-owner-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  line-height: 1.2;
  vertical-align: middle;
}

.sc-owner-avatar.owner-avatar-sm {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--hairline) 70%, transparent);
}

.sc-owner-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.zoho-history-table .sc-owner-name,
.status-matrix-table .sc-owner-name {
  font-size: 12px;
}

.zoho-history-table .date-col {
  width: 126px;
}

.zoho-history-table .company-col {
  width: 32%;
}

.zoho-history-table .cui-col {
  width: 86px;
}

.zoho-history-table .owner-col {
  width: 150px;
}

.zoho-history-table .change-col {
  width: auto;
}

.zoho-history-table .change-cell {
  vertical-align: middle;
}

.zoho-history-table .change-summary {
  margin-bottom: 0;
}

.commercial-actions-table .owner-col {
  width: 150px;
}

.status-matrix-table col.matrix-col-owner {
  width: 132px;
}

.status-matrix-table .sc-owner-inline {
  align-items: flex-start;
}

@media (max-width: 1320px) {
  .status-matrix-table col.matrix-col-owner {
    width: 122px;
  }
}


/* Sync Extern drawers */
.sync-external-page .local-page-head h1 {
  letter-spacing: -0.035em;
}

.sync-segment-card .filters-actions form {
  margin: 0;
}

.sync-drawer {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.sync-drawer + .sync-drawer {
  margin-top: 14px;
}

.sync-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sync-drawer > summary::-webkit-details-marker {
  display: none;
}

.sync-drawer-title {
  min-width: 0;
}

.sync-drawer-title .eyebrow {
  margin-bottom: 5px;
}

.sync-drawer-title h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.sync-drawer-title p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.sync-drawer-toggle {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface-2);
}

.sync-drawer[open] > summary {
  border-bottom: 1px solid var(--hairline);
}

.sync-drawer[open] .sync-drawer-toggle::after {
  content: " deschis";
}

.sync-drawer:not([open]) .sync-drawer-toggle::after {
  content: " inchis";
}

.sync-drawer-body {
  padding: 0;
}

@media (max-width: 1280px) {
  .sync-drawer > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============================================================
   Commercial status dashboard sticky matrix header — v12
   Actual markup:
   <div class="status-matrix-wrap">
     <table class="status-matrix-table">
       <thead>...
   ============================================================ */

.status-matrix-wrap {
  max-height: calc(100vh - 220px) !important;
  overflow: auto !important;
  position: relative !important;
  border-radius: 22px !important;
  border: 1px solid var(--hairline, rgba(15, 23, 42, 0.10));
  background: var(--surface, #fff);
}

.status-matrix-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.status-matrix-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  background: var(--surface-2, var(--surface, #fff)) !important;
  box-shadow: 0 1px 0 var(--hairline, rgba(15, 23, 42, 0.12)) !important;
}

/* Keep SC + Firma visible on horizontal scroll too. */
.status-matrix-table .col-owner {
  position: sticky !important;
  left: 0 !important;
  z-index: 45 !important;
  background: var(--surface-2, var(--surface, #fff)) !important;
}

.status-matrix-table .col-company {
  position: sticky !important;
  left: 190px !important;
  z-index: 45 !important;
  background: var(--surface-2, var(--surface, #fff)) !important;
}

.status-matrix-table thead .col-owner,
.status-matrix-table thead .col-company {
  z-index: 80 !important;
}

/* Match the actual column widths from the dashboard. */
.status-matrix-table th.col-owner,
.status-matrix-table td.col-owner {
  min-width: 190px;
  width: 190px;
}

.status-matrix-table th.col-company,
.status-matrix-table td.col-company {
  min-width: 220px;
  width: 220px;
}

/* Prevent sticky cells from looking transparent over scrolled content. */
.status-matrix-table tbody td.col-owner,
.status-matrix-table tbody td.col-company {
  background: var(--surface, #fff) !important;
  box-shadow: 1px 0 0 var(--hairline, rgba(15, 23, 42, 0.10)) !important;
}

/* Mobile: avoid over-constraining the table height. */
@media (max-width: 900px) {
  .status-matrix-wrap {
    max-height: calc(100vh - 160px) !important;
  }
}


/* Bulk mail admin / launcher */
.bulk-mail-launch {
    display:inline-flex;
    align-items:center;
    gap:7px;
    border:1px solid rgba(37,99,235,.20);
    background:#eff6ff;
    color:#1d4ed8;
    border-radius:999px;
    padding:7px 11px;
    font-size:12px;
    font-weight:700;
    line-height:1;
    box-shadow:0 8px 20px rgba(37,99,235,.08);
    cursor:pointer;
    transition:.16s ease;
}
.bulk-mail-launch:hover { background:#dbeafe; border-color:rgba(37,99,235,.34); transform:translateY(-1px); }
.bulk-mail-launch svg { width:15px; height:15px; }
.bulk-mail-inline-bar { display:flex; align-items:center; gap:12px; margin:10px 0 12px; }
.bulk-mail-inline-bar .commercial-dashboard-intro { margin:0; }
.bulk-mail-modal[hidden] { display:none; }
.bulk-mail-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:24px; }
.bulk-mail-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.36); backdrop-filter:blur(3px); }
.bulk-mail-modal-card { position:relative; width:min(1040px, calc(100vw - 32px)); max-height:calc(100vh - 42px); background:#fffaf4; border:1px solid rgba(148,163,184,.32); border-radius:24px; box-shadow:0 30px 90px rgba(15,23,42,.24); overflow:hidden; display:flex; flex-direction:column; }
.bulk-mail-modal-head, .bulk-mail-modal-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 22px; border-bottom:1px solid rgba(148,163,184,.25); }
.bulk-mail-modal-head h3 { margin:4px 0 2px; font-size:22px; }
.bulk-mail-modal-footer { border-top:1px solid rgba(148,163,184,.25); border-bottom:0; }
.bulk-mail-modal-footer > div { display:flex; gap:8px; }
.bulk-mail-modal-body { padding:18px 22px; overflow:auto; }
.bulk-mail-controls { display:grid; grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto auto; gap:10px; align-items:end; }
.bulk-mail-controls label, .compact-form-stack label { display:flex; flex-direction:column; gap:6px; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; font-weight:700; }
.bulk-mail-controls select, .compact-form-stack input, .bulk-template-form input, .bulk-template-form select, .bulk-template-form textarea { width:100%; border:1px solid rgba(148,163,184,.28); background:#f7f2ec; border-radius:12px; padding:11px 12px; font:inherit; color:#0f172a; outline:none; }
.bulk-template-form textarea { font-size:13px; line-height:1.55; }
.bulk-wysiwyg-field { display:flex; flex-direction:column; gap:8px; }
.bulk-token-toolbar, .bulk-editor-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.bulk-token-btn, .bulk-editor-btn { border:1px solid rgba(148,163,184,.28); background:#fffaf4; color:#334155; border-radius:999px; min-height:30px; padding:6px 9px; font-size:12px; font-weight:700; line-height:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; cursor:pointer; transition:.15s ease; }
.bulk-editor-btn { min-width:31px; padding:6px 8px; border-radius:10px; }
.bulk-token-btn:hover, .bulk-editor-btn:hover { background:#eff6ff; border-color:rgba(37,99,235,.28); color:#1d4ed8; transform:translateY(-1px); }
.bulk-token-btn:focus-visible, .bulk-editor-btn:focus-visible, .bulk-wysiwyg-editor:focus-visible { outline:2px solid rgba(37,99,235,.28); outline-offset:2px; }
.bulk-editor-btn svg { width:14px; height:14px; }
.bulk-wysiwyg-editor { min-height:310px; border:1px solid rgba(148,163,184,.32); background:#fff; border-radius:16px; padding:16px; font-size:14px; line-height:1.65; color:#0f172a; outline:none; overflow:auto; box-shadow:inset 0 1px 0 rgba(15,23,42,.02); }
.bulk-wysiwyg-editor:empty::before { content:attr(data-placeholder); color:#94a3b8; }
.bulk-wysiwyg-editor p { margin:0 0 12px; }
.bulk-wysiwyg-editor ul, .bulk-wysiwyg-editor ol { margin:0 0 12px 22px; padding:0; }
.bulk-wysiwyg-editor a { color:#1d4ed8; text-decoration:underline; }
.bulk-mail-stats { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.bulk-stat { display:inline-flex; align-items:center; gap:5px; border:1px solid rgba(148,163,184,.25); background:#fff; border-radius:999px; padding:7px 10px; color:#475569; font-size:12px; }
.bulk-stat strong { color:#0f172a; }
.bulk-stat.dry { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.bulk-stat.live { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.bulk-mail-preview-shell { border:1px solid rgba(148,163,184,.28); border-radius:18px; background:#fff; overflow:hidden; }
.bulk-mail-preview-nav { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border-bottom:1px solid rgba(148,163,184,.2); background:#fbf7f1; }
.bulk-mail-preview-meta { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; border-bottom:1px solid rgba(148,163,184,.2); }
.bulk-mail-preview-meta div { padding:10px 12px; border-right:1px solid rgba(148,163,184,.18); min-width:0; }
.bulk-mail-preview-meta div:last-child { border-right:0; }
.bulk-mail-preview-meta span { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; margin-bottom:3px; }
.bulk-mail-preview-meta strong { display:block; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bulk-mail-preview-frame { width:100%; height:330px; border:0; background:#fff; }
.bulk-mail-modal-error { margin-top:12px; border:1px solid rgba(37,99,235,.18); background:#eff6ff; color:#1e3a8a; border-radius:14px; padding:11px 12px; font-size:13px; }
.bulk-mail-grid { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:18px; }
.bulk-mail-side { display:flex; flex-direction:column; gap:18px; }
.compact-form-stack { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.mini-status-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.mini-status-list div { display:flex; justify-content:space-between; gap:10px; border-bottom:1px dashed rgba(148,163,184,.35); padding-bottom:8px; }
.mini-status-list span { color:#64748b; font-size:12px; }
.mini-status-list strong { color:#0f172a; font-size:12px; text-align:right; }
.inline-check { display:inline-flex !important; flex-direction:row !important; align-items:center; gap:8px !important; text-transform:none !important; letter-spacing:0 !important; color:#0f172a !important; }
@media (max-width: 980px) {
    .bulk-mail-controls { grid-template-columns:1fr; }
    .bulk-mail-grid { grid-template-columns:1fr; }
    .bulk-mail-preview-meta { grid-template-columns:1fr 1fr; }
}

/* Service analytics dashboard */
.service-analytics-page {
  display: grid;
  gap: 18px;
}

.service-analytics-filter-panel {
  padding: 22px;
}

.panel-header.compact,
.card-head.compact {
  align-items: center;
}

.service-analytics-filters {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1.2fr) minmax(140px, .9fr) minmax(150px, .9fr) minmax(130px, .8fr) minmax(130px, .8fr) auto auto;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.service-analytics-filters select,
.service-analytics-filters input[type="date"] {
  min-height: 42px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(244, 241, 236, .82);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
}

.service-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.service-analytics-kpi {
  background: var(--panel);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.service-analytics-kpi span,
.service-analytics-kpi small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.service-analytics-kpi strong {
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(24px, 2.2vw, 34px);
  letter-spacing: -.04em;
  color: var(--ink);
}

.service-analytics-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.service-analytics-card {
  overflow: hidden;
}

.service-bars {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.service-bar-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(120px, 1fr) 58px;
  gap: 12px;
  align-items: center;
}

.service-bar-label {
  min-width: 0;
}

.service-bar-label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-bar-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, .06);
}

.service-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(37, 99, 235, .35), rgba(16, 185, 129, .55));
}

.service-bar-row strong {
  text-align: right;
  font-size: 14px;
}

.service-row-service .service-bar-label strong {
  display: inline-block;
  min-width: 46px;
  font-size: 13px;
}

.service-analytics-timeline-card {
  padding-bottom: 22px;
}

.service-timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-height: 180px;
  margin-top: 22px;
  overflow-x: auto;
  padding: 8px 0 4px;
}

.service-timeline-day {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 28px;
}

.service-timeline-stack {
  width: 14px;
  min-height: 6px;
  border-radius: 999px 999px 6px 6px;
  background: rgba(15, 23, 42, .07);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05);
}

.service-timeline-stack span {
  display: block;
  width: 100%;
  min-height: 0;
}

.service-timeline-stack .timeline-good { background: rgba(16, 185, 129, .62); }
.service-timeline-stack .timeline-info { background: rgba(59, 130, 246, .52); }
.service-timeline-stack .timeline-warn { background: rgba(245, 158, 11, .62); }

.service-timeline-day small {
  color: var(--muted);
  font-size: 10px;
  transform: rotate(-45deg);
  transform-origin: center;
  white-space: nowrap;
}

.service-timeline-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-dot.good { background: rgba(16, 185, 129, .8); }
.legend-dot.info { background: rgba(59, 130, 246, .75); }
.legend-dot.warn { background: rgba(245, 158, 11, .8); }

.service-transition-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.service-transition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.service-transition-row:last-child {
  border-bottom: 0;
}

.service-transition-row > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.service-transition-row svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.service-transition-row strong {
  text-align: right;
}

.service-transition-row small {
  color: var(--muted);
  text-align: right;
}

.service-analytics-table-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
}

.service-analytics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  background: rgba(255, 255, 255, .58);
}

.service-analytics-table th,
.service-analytics-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.service-analytics-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(244, 241, 236, .75);
}

.service-analytics-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1300px) {
  .service-analytics-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .service-analytics-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .service-analytics-grid.two,
  .service-analytics-kpis,
  .service-analytics-filters {
    grid-template-columns: 1fr;
  }
  .service-bar-row,
  .service-transition-row {
    grid-template-columns: 1fr;
  }
  .service-bar-row strong,
  .service-transition-row strong,
  .service-transition-row small {
    text-align: left;
  }
}
