:root {
  color-scheme: light;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --sidebar: #182033;
  --sidebar-hover: #242F49;
  --text: #1F2937;
  --text-secondary: #5E6B7A;
  --text-muted: #8A96A5;
  --border: #E2E7EE;
  --border-strong: #CBD4E0;

  --investment: #2563EB;
  --investment-dark: #1D4ED8;
  --investment-soft: #EFF6FF;

  --contacts: #0891B2;
  --contacts-dark: #0E7490;
  --contacts-soft: #ECFEFF;

  --outcome: #16A34A;
  --outcome-dark: #15803D;
  --outcome-soft: #F0FDF4;

  --projects: #0891B2;
  --projects-dark: #0E7490;
  --projects-soft: #ECFEFF;

  --advisors: #7C3AED;
  --advisors-dark: #6D28D9;
  --advisors-soft: #F5F3FF;

  --review: #D97706;
  --review-dark: #B45309;
  --review-soft: #FFF7ED;

  --general: #64748B;
  --general-dark: #475569;
  --general-soft: #F1F5F9;

  --danger: #C2414B;
  --success: #16A34A;
  --shadow-card: 0 5px 18px rgba(31, 41, 55, 0.055);
  --shadow-soft: 0 2px 9px rgba(31, 41, 55, 0.045);
  --shadow-sm: none;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 6px;
  --sidebar-width: 198px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(34, 87, 122, 0.34);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.auth-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(23, 36, 43, 0.12);
}

.auth-card-stack {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.auth-copy {
  display: grid;
  gap: 4px;
}

.auth-card strong {
  display: block;
  font-size: 15px;
}

.auth-card p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.clerk-sign-in-mount {
  width: 100%;
}

.clerk-sign-in-mount:empty {
  min-height: 180px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 16px 10px 14px;
  background: var(--sidebar);
  color: #ffffff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 18px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(234, 244, 255, 0.2);
  border-radius: 8px;
  background: #0B3B6D;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(234, 244, 255, 0.68);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(234, 244, 255, 0.78);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.is-active {
  border-color: rgba(234, 244, 255, 0.2);
  background: rgba(234, 244, 255, 0.15);
  color: #ffffff;
}

.nav-item.is-active::before {
  content: none;
}

.nav-item[data-view="projects"].is-active::before { background: var(--projects); }
.nav-item[data-view="advisors"].is-active::before { background: var(--advisors); }
.nav-item[data-view="unqualified"].is-active::before { background: var(--review); }

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: rgba(234, 244, 255, 0.82);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.nav-item.is-active .nav-icon {
  color: #ffffff;
}

.sidebar-footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
}

.sync-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--general);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: var(--general);
}

.topbar h1,
.hero-panel h2,
.database-hero h2,
.database-action-bar h2,
.panel h3,
.drawer-header h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar #page-eyebrow {
  font-weight: 700;
}

.page-subtitle {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
}

.period-control {
  display: flex;
  flex: 0 0 auto;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.period-control label {
  display: grid;
  gap: 3px;
}

.period-control span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
}

.period-control select,
.period-control input {
  min-height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
}

.period-control select {
  width: 128px;
  padding: 0 8px;
}

.period-control input {
  width: 124px;
  padding: 0 6px;
}

.sync-status {
  display: inline-flex;
  min-width: 232px;
  min-height: 50px;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

#sync-copy {
  display: grid;
  max-width: 220px;
  gap: 2px;
}

#sync-primary {
  color: var(--text);
  font-weight: 700;
}

#sync-secondary {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.sync-status.is-stale .sync-dot {
  background: var(--review);
}

.sync-status.is-error .sync-dot {
  background: var(--danger);
}

.user-chip {
  display: flex;
  min-width: 160px;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.sidebar-user-chip {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(234, 244, 255, 0.07);
  box-shadow: none;
}

.sidebar-user-chip .user-avatar {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-user-chip strong {
  max-width: 110px;
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-user-chip span {
  color: rgba(255, 255, 255, 0.54);
}

.sign-out-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#sign-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--sidebar);
  color: #ffffff;
  font-size: 11px;
  font-weight: 650;
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip strong {
  max-width: 124px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.15;
}

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

.refresh-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--projects);
  border-radius: 50%;
  background: var(--projects);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(11, 111, 232, 0.20);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.refresh-button:hover:not(:disabled) {
  border-color: var(--projects-dark);
  background: var(--projects-dark);
  color: #FFFFFF;
  box-shadow: 0 5px 15px rgba(11, 111, 232, 0.25);
  transform: translateY(-1px);
}

.refresh-button:active:not(:disabled) {
  transform: translateY(0);
}

.refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.refresh-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.refresh-button.is-refreshing .refresh-icon {
  animation: refresh-spin 900ms linear infinite;
}

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

.btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--general);
}

.btn:active:not(:disabled) {
  filter: brightness(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  border-color: var(--projects);
  background: var(--projects);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--projects-dark);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text-secondary);
}

.sidebar .btn-ghost {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.68);
}

.sidebar .btn-ghost:hover:not(:disabled) {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar .btn {
  min-height: 32px;
  font-size: 10px;
  font-weight: 650;
}

.btn-light {
  border-color: rgba(255, 255, 255, 0.22);
  background: #ffffff;
  color: var(--general);
}

.btn-link {
  min-height: 28px;
  padding: 0;
  background: transparent;
  color: var(--projects);
}

.btn-full {
  width: 100%;
}

.alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.45;
}

.alert-error {
  border: 1px solid #e9b8c3;
  background: #fff2f4;
  color: #81283a;
}

.view-panel {
  display: block;
}

.hero-panel,
.database-hero,
.database-action-bar {
  display: flex;
  min-height: auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--general);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

.hero-panel h2,
.database-hero h2,
.database-action-bar h2 {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-panel p:not(.eyebrow),
.database-hero p:not(.eyebrow),
.database-action-bar p:not(.eyebrow) {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

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

.kpi-grid-four {
  grid-template-columns: 1fr;
}

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

.overview-review-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.kpi-card {
  position: relative;
  display: flex;
  min-height: 110px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--general);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.kpi-action {
  width: 100%;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.kpi-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.kpi-card.front-projects { border-left-color: var(--projects); }
.kpi-card.front-advisors { border-left-color: var(--advisors); }
.kpi-card.front-review { border-left-color: var(--review); }
.kpi-card.front-mixed,
.kpi-card.front-general { border-left-color: var(--general); }

.overview-primary-kpis .kpi-card {
  min-height: 120px;
}

.overview-review-kpis .kpi-card {
  min-height: 76px;
  padding: 10px 12px;
}

.overview-review-kpis .kpi-number {
  margin-top: 6px;
  font-size: 22px;
}

.kpi-card.is-secondary .kpi-number,
.campaign-secondary .kpi-number {
  font-size: 20px;
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.kpi-number {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.kpi-number.currency {
  font-size: 27px;
}

.kpi-foot {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-grid-main {
  grid-template-columns: minmax(0, 2fr) minmax(250px, 0.72fr);
  align-items: stretch;
}

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

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

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

.panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.rail-panel {
  border-left-width: 4px;
}

.rail-projects { border-left-color: var(--projects); }
.rail-advisors { border-left-color: var(--advisors); }
.rail-review { border-left-color: var(--review); }
.rail-general { border-left-color: var(--general); }

#view-funnel[data-funnel="projects"] .table-panel,
#view-funnel[data-funnel="projects"] .panel-large {
  border-left-color: var(--projects);
}

#view-funnel[data-funnel="advisors"] .table-panel,
#view-funnel[data-funnel="advisors"] .panel-large {
  border-left-color: var(--advisors);
}

#view-funnel[data-funnel="unqualified"] .table-panel,
#view-funnel[data-funnel="unqualified"] .panel-large {
  border-left-color: var(--review);
}

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

.panel-header-row {
  align-items: center;
}

.panel h3 {
  font-size: 15px;
  line-height: 1.22;
  letter-spacing: 0;
}

.panel h4,
.compact-heading {
  margin: 14px 0 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.panel-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.panel-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.chart-wrap {
  position: relative;
  height: 228px;
}

.chart-wrap.chart-wide {
  height: 252px;
}

.chart-wrap.compact {
  height: 190px;
}

.rank-list {
  display: grid;
  gap: 10px;
  padding-top: 1px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
}

.rank-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-total {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.rank-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-subtle);
}

.rank-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--projects);
}

#view-funnel[data-funnel="projects"] #funnel-secondary-content .rank-bar span {
  background: var(--projects);
}

#view-funnel[data-funnel="advisors"] #funnel-secondary-content .rank-bar span {
  background: var(--advisors);
}

#view-funnel[data-funnel="unqualified"] #funnel-secondary-content .rank-bar span {
  background: var(--review);
}

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

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

.metric-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.metric-item span,
.metric-item small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.metric-item strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.metric-item small {
  margin-top: 5px;
}

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

.metric-list-foot {
  margin-top: 10px;
}

.reconciliation-line {
  margin: -4px 0 14px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

#view-overview {
  display: grid;
  gap: 11px;
}

#view-overview .panel {
  border-radius: 12px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

#view-overview .panel h3 {
  font-weight: 700;
}

#view-overview .eyebrow {
  font-weight: 700;
}

#view-overview .kpi-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

#view-overview .kpi-card {
  min-height: 140px;
  padding: 13px;
  border-left-width: 1px;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

#view-overview .kpi-action {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#view-overview .kpi-action:hover {
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(16, 42, 67, 0.07);
  transform: translateY(-1px);
}

#view-overview .kpi-action:active {
  transform: translateY(1px);
}

.kpi-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--general-soft);
  color: var(--general);
}

.kpi-icon svg,
.review-strip-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.7;
}

.review-strip-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.6;
}

#view-overview .front-projects {
  color: var(--projects);
}

#view-overview .front-advisors {
  color: var(--advisors);
}

#view-overview .front-review {
  color: var(--review);
}

#view-overview .front-general {
  color: var(--general);
}

#view-overview .front-projects .kpi-icon {
  background: var(--projects-soft);
  color: var(--projects);
}

#view-overview .front-advisors .kpi-icon {
  background: var(--advisors-soft);
  color: var(--advisors);
}

#view-overview .front-review .kpi-icon {
  background: var(--review-soft);
  color: var(--review);
}

#view-overview .kpi-label {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

#view-overview .kpi-number {
  margin-top: 6px;
  color: var(--text);
  font-size: 34px;
  font-weight: 700;
}

#view-funnel {
  display: grid;
  gap: 11px;
}

#view-funnel #funnel-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

#view-funnel .funnel-kpi {
  min-height: 104px;
  justify-content: flex-start;
  padding: 12px 13px;
  border-left-width: 1px;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.funnel-kpi-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

#view-funnel[data-funnel="projects"] .funnel-kpi-dot { background: var(--projects); }
#view-funnel[data-funnel="advisors"] .funnel-kpi-dot { background: var(--advisors); }
#view-funnel[data-funnel="unqualified"] .funnel-kpi-dot { background: var(--review); }

#view-funnel .funnel-kpi .kpi-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

#view-funnel .funnel-kpi .kpi-number {
  margin-top: 12px;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
}

#view-funnel .dashboard-grid-main {
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.65fr);
  gap: 11px;
  margin-bottom: 0;
}

#view-funnel .panel,
#view-campaigns .panel,
#view-database .panel {
  border-radius: 11px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

#view-funnel .panel {
  padding: 14px;
}

#view-funnel .table-panel,
#view-campaigns .table-panel,
#view-database .table-panel {
  padding: 0;
}

#view-funnel .chart-wide,
#view-campaigns .chart-wide {
  height: 292px;
}

#view-funnel .rank-list {
  gap: 9px;
}

#view-funnel .rank-name {
  font-size: 11px;
  font-weight: 600;
}

#view-funnel .rank-total {
  font-size: 14px;
  font-weight: 700;
}

#view-funnel .rank-bar {
  height: 4px;
  background: var(--general-soft);
}

#view-funnel .metric-item,
#view-database .filters-panel {
  border-radius: 10px;
  background: var(--surface);
}

#view-campaigns .campaign-kpis {
  gap: 11px;
  margin-bottom: 11px;
}

#view-campaigns .campaign-kpi-group {
  gap: 10px;
}

#view-campaigns .kpi-card {
  min-height: 112px;
  padding: 12px 13px;
  border-left-width: 1px;
  border-radius: 11px;
  box-shadow: var(--shadow-card);
}

#view-campaigns .kpi-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

#view-campaigns .kpi-number {
  margin-top: 9px;
  color: var(--text);
  font-size: 31px;
  font-weight: 700;
}

#view-campaigns .campaign-secondary .kpi-number {
  font-size: 27px;
}

#view-campaigns .kpi-foot {
  color: var(--text-muted);
  font-size: 11px;
}

#view-campaigns .insight-list > div {
  padding: 11px 0;
}

#view-campaigns .insight-list span {
  border-radius: 8px;
  background: var(--general-soft);
}

.campaign-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.campaign-control strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.campaign-control-content {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
}

.campaign-selector {
  width: min(340px, 44vw);
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.campaign-selected-pill,
.campaign-muted-pill {
  display: inline-flex;
  min-width: 0;
  max-width: min(420px, 48vw);
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.campaign-selected-pill {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-video-section {
  margin-bottom: 11px;
}

.campaign-video-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.video-ad-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.video-ad-header {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.video-ad-header h4 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-ad-header p {
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-metric,
.video-step {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.video-metric span,
.video-step span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}

.video-metric strong,
.video-step strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}

.video-metric small,
.video-step small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
}

.video-metrics-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: stretch;
}

.video-metric-group {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.video-metric-group-general {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-metric-group-progress {
  grid-template-rows: auto 1fr auto;
  padding-left: 14px;
  border-left: 2px solid var(--border-strong);
}

.video-progress-heading {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.video-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.video-progress-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.video-step {
  position: relative;
  border-color: var(--border-strong);
}

.campaign-commercial-kpis {
  display: grid;
  gap: 9px;
}

.campaign-commercial-kpis > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.campaign-commercial-kpis span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.campaign-commercial-kpis strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 760;
}

.campaign-empty-note {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.campaign-placement-panel {
  margin-top: 11px;
}

.database-action-bar {
  min-height: auto;
  margin-bottom: 12px;
  padding: 13px 14px;
  border-left-width: 1px;
  border-radius: 11px;
  box-shadow: var(--shadow-card);
}

.database-action-bar #export-all {
  min-height: 36px;
  padding: 0 14px;
  border-color: var(--projects);
  background: var(--surface);
  color: var(--projects);
  text-decoration: none;
}

.database-action-bar #export-all:hover:not(:disabled) {
  border-color: var(--projects-dark);
  background: var(--surface-subtle);
  color: var(--projects-dark);
}

#view-overview .kpi-foot {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.kpi-sparkline {
  width: 100%;
  height: 30px;
  margin-top: 6px;
  color: currentColor;
}

.kpi-sparkline-area {
  fill: currentColor;
  opacity: 0.08;
}

.kpi-sparkline-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.kpi-sparkline-point {
  fill: currentColor;
}

#view-overview .reconciliation-line {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(229, 132, 19, 0.28);
  border-radius: 10px;
  background: var(--review-soft);
  color: var(--review-dark);
  font-size: 12px;
}

.overview-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 0.72fr) minmax(250px, 0.72fr);
  gap: 11px;
  align-items: stretch;
}

#view-overview .overview-chart-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 13px;
}

#view-overview .chart-wide {
  height: 300px;
}

@media (min-width: 1200px) {
  #view-overview .overview-chart-panel .chart-wrap.chart-wide {
    flex: 1;
    height: auto;
    min-height: 292px;
  }
}

#view-overview .executive-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px;
}

.panel-description {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.overview-metric-list,
.overview-rank-list {
  display: grid;
  gap: 7px;
}

.overview-metric-row,
.overview-rank-row {
  display: grid;
  gap: 5px;
}

.overview-metric-copy,
.overview-rank-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
}

.overview-metric-copy {
  display: grid;
  gap: 8px;
}

.overview-metric-copy span,
.overview-rank-row > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-metric-copy strong,
.overview-rank-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

.overview-bar {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--general-soft);
}

.overview-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--general);
}

.tone-projects .overview-bar span {
  background: var(--projects);
}

.tone-advisors .overview-bar span {
  background: var(--advisors);
}

.tone-review .overview-bar span {
  background: var(--review);
}

#view-overview .compact-heading {
  margin-top: 12px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.overview-panel-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
}

.overview-review-strip {
  display: grid;
  grid-template-columns: minmax(210px, 0.95fr) minmax(0, 2.5fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px 14px;
}

.review-strip-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.review-strip-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--review-soft);
  color: var(--review);
}

.overview-review-strip h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.review-strip-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.review-strip-metric {
  min-width: 0;
  padding: 6px 8px;
  border-left: 1px solid var(--border);
}

.review-strip-metric span,
.review-strip-metric strong {
  display: block;
}

.review-strip-metric span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.25;
}

.review-strip-metric strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.review-strip-metric.is-primary strong {
  color: var(--review);
}

.review-strip-action {
  white-space: nowrap;
}

#view-overview .overview-recent-panel {
  padding: 14px;
}

.recent-columns {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(155px, 0.7fr) minmax(240px, 1.6fr) auto;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
}

#view-overview .recent-list {
  border-top: 0;
}

#view-overview .recent-row {
  min-height: 54px;
  padding: 9px 0;
  border-bottom-color: var(--border);
}

#view-overview .recent-row:hover {
  background: transparent;
}

#view-overview .contact-block strong {
  font-size: 13px;
  font-weight: 650;
}

#view-overview .contact-block span,
#view-overview .reason-block span {
  font-size: 11px;
}

#view-overview .reason-block strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.action-stack {
  display: grid;
  gap: 6px;
}

.action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
}

.action-row:hover {
  border-color: var(--border);
  background: var(--surface-subtle);
}

.action-row span strong,
.action-row span small {
  display: block;
}

.action-row span strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row span small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.3;
}

.action-row b {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.action-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-teal { background: var(--advisors); }
.dot-amber { background: var(--review); }
.dot-slate { background: var(--text-muted); }

.recent-list {
  display: grid;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
}

.tab-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.tab-button:hover,
.tab-button.is-active {
  border-color: rgba(34, 87, 122, 0.32);
  background: rgba(34, 87, 122, 0.08);
  color: var(--projects);
}

.recent-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(155px, 0.7fr) minmax(240px, 1.6fr) auto;
  min-height: 52px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

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

.contact-block strong,
.contact-block span,
.reason-block strong,
.reason-block span {
  display: block;
}

.contact-block strong,
.reason-block strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-block span,
.reason-block span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
}

.reason-block strong {
  color: var(--text-secondary);
  font-weight: 650;
}

.loading-block,
.table-empty,
.empty-state {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.loading-block {
  padding: 24px 14px;
}

.badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge-comprador,
.badge-propietario_vendedor,
.badge-inversion_general {
  border-color: rgba(34, 87, 122, 0.34);
  background: rgba(34, 87, 122, 0.08);
  color: var(--projects-dark);
}

.badge-asesor,
.badge-asesor_potencial,
.badge-perfil_comercial,
.badge-evento_capacitacion {
  border-color: rgba(22, 117, 107, 0.34);
  background: rgba(22, 117, 107, 0.08);
  color: var(--advisors-dark);
}

.badge-indefinido,
.badge-signal {
  border-color: rgba(165, 107, 34, 0.36);
  background: rgba(165, 107, 34, 0.08);
  color: var(--review-dark);
}

.badge-mixto,
.badge-ruta_historica,
.badge-ninguno {
  border-color: rgba(57, 74, 82, 0.28);
  background: rgba(57, 74, 82, 0.07);
  color: var(--general);
}

.badge-anuncio,
.badge-conversacion {
  border-color: rgba(34, 87, 122, 0.22);
  background: rgba(34, 87, 122, 0.05);
  color: var(--text-secondary);
}

.filters-panel {
  margin-bottom: 14px;
  padding: 10px;
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) repeat(4, minmax(128px, 0.65fr));
  gap: 10px;
}

.funnel-filters-grid {
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(130px, 0.7fr));
}

.database-filters-grid {
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(138px, 0.72fr));
}

.field {
  display: grid;
  gap: 5px;
}

.field span,
.page-size-control span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 750;
}

.field input,
.field select,
.page-size-control select {
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.field input::placeholder {
  color: #9ca7b4;
}

.filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.view-return {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.back-button {
  min-width: 154px;
}

.breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.breadcrumb strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

.table-toolbar h3 {
  margin-bottom: 2px;
}

.table-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(140px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.table-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control select {
  width: 72px;
  min-height: 34px;
}

.table-scroll {
  width: 100%;
  max-height: calc(100vh - 270px);
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e9eef2;
  vertical-align: middle;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}

.data-table td {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.42;
}

.data-table tbody tr {
  height: 50px;
}

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

.data-table .table-empty {
  padding: 32px 20px;
}

.table-contact strong,
.table-contact span {
  display: block;
}

.table-contact strong {
  max-width: 190px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-contact span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.table-reason {
  max-width: 360px;
  color: #4f5d6b;
}

.signal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 210px;
}

.confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 10px;
}

.confidence-bar {
  width: 50px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--border);
}

.confidence-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--advisors);
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--projects);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.table-action:hover {
  border-color: rgba(34, 87, 122, 0.32);
  background: rgba(34, 87, 122, 0.06);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
}

.pagination span {
  min-width: 130px;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

.campaign-kpis {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.campaign-kpi-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.campaign-group-label {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.empty-state {
  display: grid;
  height: 252px;
  place-content: center;
  padding: 18px;
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.empty-state p {
  max-width: 390px;
  margin: 6px auto 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.insight-list {
  display: grid;
  gap: 8px;
}

.insight-list > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.insight-list > div:last-child {
  border-bottom: 0;
}

.insight-list span {
  display: grid;
  min-width: 34px;
  height: 24px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(57, 74, 82, 0.08);
  color: var(--general);
  font-size: 9px;
  font-weight: 800;
}

.insight-list p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.insight-list strong {
  color: var(--text);
}

.database-hero {
  min-height: auto;
  border-left-color: var(--general);
}

.database-hero .btn {
  min-width: 190px;
}

.database-hero #export-all {
  min-height: 36px;
  padding: 0 14px;
  border-color: var(--projects);
  background: var(--surface);
  color: var(--projects);
  text-decoration: none;
}

.database-hero #export-all:hover:not(:disabled) {
  border-color: var(--projects-dark);
  background: var(--surface-subtle);
  color: var(--projects-dark);
}

.database-period-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-top: 10px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
}

.policy-card {
  min-height: 124px;
  padding: 15px;
}

.policy-number {
  display: inline-grid;
  min-width: 28px;
  height: 22px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: rgba(34, 87, 122, 0.08);
  color: var(--projects);
  font-size: 10px;
  font-weight: 800;
}

.policy-card h3 {
  font-size: 14px;
}

.policy-card p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.48;
}

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

.column-grid span {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px 0;
  color: var(--text-muted);
  font-size: 10px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 27, 42, 0.42);
}

.lead-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 310;
  width: min(460px, 100vw);
  overflow: auto;
  background: #F7F9FC;
  box-shadow: 0 22px 54px rgba(16, 42, 67, 0.16);
  transform: translateX(102%);
  transition: transform 200ms ease;
}

.lead-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: #FFFFFF;
}

.drawer-header h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.phone-link {
  display: inline-block;
  margin-top: 5px;
  color: var(--projects);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.drawer-content {
  padding: 16px 18px 24px;
}

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

.drawer-stat,
.drawer-note {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: var(--shadow-soft);
}

.drawer-stat span,
.drawer-note span {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
}

.drawer-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.drawer-note {
  margin-bottom: 10px;
  border-left: 1px solid var(--border);
}

.drawer-note p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.48;
}

.conversation-title {
  margin: 16px 0 10px;
  color: var(--text);
  font-size: 12px;
}

.message-list {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.message-row {
  display: flex;
}

.message-row.is-human {
  justify-content: flex-end;
}

.message-row.is-ai {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 86%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.is-human .message-bubble {
  border-color: rgba(22, 117, 107, 0.28);
  background: #EAF8F2;
  color: var(--advisors-dark);
}

.message-row.is-ai .message-bubble {
  background: #ffffff;
  color: var(--text-secondary);
  box-shadow: var(--shadow-soft);
}

.message-id {
  display: block;
  margin-top: 5px;
  color: rgba(100, 113, 132, 0.62);
  font-size: 8px;
  text-align: right;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  max-width: 360px;
  padding: 11px 13px;
  border: 1px solid rgba(22, 117, 107, 0.32);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--advisors-dark);
  box-shadow: 0 10px 22px rgba(23, 36, 43, 0.12);
  font-size: 11px;
  font-weight: 750;
}

.toast.is-error {
  border-color: rgba(181, 71, 71, 0.32);
  background: #ffffff;
  color: var(--danger);
}

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

  .kpi-grid-four {
    grid-template-columns: 1fr;
  }

  .campaign-kpis {
    grid-template-columns: 1fr;
  }

  #view-campaigns .campaign-kpis {
    grid-template-columns: 1fr;
  }

  .campaign-kpi-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

  .table-filter-actions {
    grid-column: 1 / -1;
  }

  .field-search {
    grid-column: span 2;
  }

  #view-overview .kpi-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-funnel #funnel-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .overview-chart-panel {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 196px;
  }

  .main-content {
    padding: 16px;
  }

  .dashboard-grid-main,
  .dashboard-grid-thirds,
  .dashboard-grid-two {
    grid-template-columns: 1fr;
  }

  #view-funnel .dashboard-grid-main {
    grid-template-columns: 1fr;
  }

  .video-metrics-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .video-metric-group-progress {
    padding-top: 10px;
    padding-left: 0;
    border-top: 2px solid var(--border-strong);
    border-left: 0;
  }

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

  .recent-row {
    grid-template-columns: minmax(170px, 1fr) minmax(160px, 0.8fr) auto;
  }

  .recent-row .reason-block {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .overview-primary-kpis {
    grid-template-columns: 1fr;
  }

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

  .period-control {
    flex: 1 1 360px;
  }

  .sync-status {
    order: 3;
    flex: 1 1 260px;
  }

  .overview-main-grid {
    grid-template-columns: 1fr;
  }

  #view-overview .chart-wide {
    height: 280px;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    width: 100%;
    padding: 10px;
  }

  .sidebar-brand {
    padding: 0 2px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-footer {
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .sidebar-user-chip {
    min-height: 40px;
    padding: 5px 7px;
  }

  .sidebar-user-chip .user-avatar {
    width: 28px;
    height: 28px;
  }

  .sidebar-user-chip strong {
    max-width: 150px;
    font-size: 11px;
  }

  .sidebar-user-chip span {
    display: none;
  }

  #sign-out {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .sign-out-label {
    display: none;
  }

  .nav-item {
    min-width: 132px;
    justify-content: flex-start;
    min-height: 40px;
  }

  .nav-item.is-active::before {
    content: none;
  }

  .main-content {
    margin-left: 0;
    padding: 14px;
  }

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

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

  .sync-status {
    flex: 1 1 calc(100% - 54px);
    min-width: 0;
  }

  .period-control {
    flex: 1 1 100%;
    flex-wrap: wrap;
    padding: 8px;
  }

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

  .campaign-control-content,
  .campaign-selector,
  .campaign-selected-pill,
  .campaign-muted-pill {
    width: 100%;
    max-width: none;
  }

  .campaign-control-content {
    justify-content: stretch;
  }

  #sync-copy {
    max-width: none;
  }

  .hero-panel,
  .database-hero,
  .database-action-bar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 12px;
  }

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

  #view-funnel #funnel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid-four {
    grid-template-columns: 1fr;
  }

  .overview-primary-kpis {
    grid-template-columns: 1fr;
  }

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

  #view-overview .kpi-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-overview .kpi-card {
    min-height: 150px;
  }

  .recent-columns {
    display: none;
  }

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

  .field-search {
    grid-column: 1 / -1;
  }

  .database-hero .btn,
  .database-action-bar .btn {
    width: 100%;
    min-height: 40px;
  }

  .database-hero #export-all,
  .database-action-bar #export-all {
    min-height: 40px;
  }

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

  .recent-row .badges,
  .recent-row .reason-block {
    grid-column: 1 / -1;
  }

  .view-return {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

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

@media (max-width: 560px) {
  .topbar h1 {
    font-size: 24px;
  }

  .hero-panel h2,
  .database-hero h2,
  .database-action-bar h2 {
    font-size: 18px;
  }

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

  .topbar-actions {
    gap: 8px;
  }

  .sync-status {
    flex: 1 1 calc(100% - 48px);
    min-height: 52px;
  }

  .period-control {
    gap: 6px;
  }

  .kpi-grid,
  .filters-grid,
  .table-filters,
  .column-grid,
  .metric-grid,
  .metric-grid-six,
  .video-metric-group-general,
  .video-metric-group-progress,
  .video-progress-steps,
  .drawer-summary-grid {
    grid-template-columns: 1fr;
  }

  #view-overview .kpi-grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #view-overview .kpi-card {
    min-height: 144px;
    padding: 12px;
  }

  #view-overview .kpi-label,
  #view-overview .kpi-foot {
    font-size: 11px;
  }

  #view-overview .kpi-number {
    font-size: 32px;
  }

  .kpi-icon {
    width: 32px;
    height: 32px;
  }

  #view-overview .chart-wide {
    height: 240px;
  }

  #view-overview .overview-recent-panel .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  #view-overview .overview-recent-panel .panel-header .btn-link {
    min-height: 36px;
    white-space: nowrap;
  }

  .overview-review-strip {
    padding: 14px;
  }

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

  .review-strip-metric {
    padding: 8px 0 8px 9px;
  }

  .review-strip-action {
    width: 100%;
  }

  #funnel-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #funnel-kpis .kpi-card {
    min-height: 86px;
    padding: 10px 11px;
  }

  #funnel-kpis .kpi-number {
    font-size: 26px;
  }

  #business-panel .metric-grid,
  #advisors-panel .metric-grid,
  #qualification-panel .metric-grid,
  #qualification-panel .metric-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .campaign-kpi-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #view-campaigns .campaign-kpi-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .campaign-kpi-group:first-child > .kpi-card:first-of-type,
  .campaign-kpi-group:last-child > .kpi-card:last-of-type {
    grid-column: 1 / -1;
  }

  .empty-state {
    height: 190px;
  }

  .kpi-card {
    min-height: 92px;
  }

  .overview-primary-kpis .kpi-card {
    min-height: 104px;
  }

  .overview-review-kpis .kpi-card {
    min-height: 72px;
  }

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

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

  .table-filter-actions {
    flex-direction: column-reverse;
  }

  .table-filter-actions .btn {
    width: 100%;
  }

  .period-control {
    flex: 1 1 100%;
    width: 100%;
  }

  .period-control label {
    width: auto;
    min-width: 0;
  }

  .period-control select {
    width: 100%;
  }

  .period-control input {
    width: 100%;
  }

  .period-select-wrap,
  .period-month-wrap {
    flex: 1 1 138px;
  }

  .panel,
  .hero-panel,
  .database-hero {
    padding: 14px;
  }

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

  .app-footer {
    flex-direction: column;
    gap: 6px;
  }

  .lead-drawer {
    width: 100vw;
  }

  .drawer-header,
  .drawer-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 350px) {
  #view-overview .kpi-grid-four {
    grid-template-columns: 1fr;
  }
}

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

.rank-0 { width: 0; }
.rank-10, .confidence-10 { width: 10%; }
.rank-20, .confidence-20 { width: 20%; }
.rank-30, .confidence-30 { width: 30%; }
.rank-40, .confidence-40 { width: 40%; }
.rank-50, .confidence-50 { width: 50%; }
.rank-60, .confidence-60 { width: 60%; }
.rank-70, .confidence-70 { width: 70%; }
.rank-80, .confidence-80 { width: 80%; }
.rank-90, .confidence-90 { width: 90%; }
.rank-100, .confidence-100 { width: 100%; }
.confidence-0 { width: 0; }

/* ELITE RESUMEN V3 COMPACT */
#view-overview.elite-overview {
  --elite-ink: #222833;
  --elite-muted: #727B88;
  --elite-line: #DCE3EA;
  --elite-accent: #0878B8;
  display: block;
  max-width: 1600px;
  color: var(--elite-ink);
}
#view-overview .elite-intro { display: none; }
#view-overview .elite-section { margin: 0 0 22px; }
#view-overview .elite-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
#view-overview .elite-section-heading > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
#view-overview .elite-section-heading h2 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 720; letter-spacing: -.015em; }
#view-overview .elite-section-heading > p { margin: 0; max-width: 46%; color: var(--elite-muted); font-size: 11px; line-height: 1.35; text-align: right; }
#view-overview .elite-section-step { display: inline-flex; flex: 0 0 auto; width: 24px; height: 24px; justify-content: center; align-items: center; border-radius: 7px; background: #E9F4FA; color: var(--elite-accent); font-size: 10px; font-weight: 800; }
#view-overview .kpi-grid-four { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
#view-overview .kpi-card { min-height: 132px; padding: 14px 15px; border: 1px solid var(--elite-line); border-radius: 12px; box-shadow: 0 3px 12px rgba(34,40,51,.025); }
#view-overview .kpi-card .kpi-icon { width: 31px; height: 31px; border-radius: 9px; }
#view-overview .kpi-label { margin-top: 7px; color: var(--elite-muted); font-size: 11px; line-height: 1.3; font-weight: 650; }
#view-overview .kpi-number { margin-top: 6px; color: var(--elite-ink); font-size: 30px; letter-spacing: -.025em; line-height: 1; }
#view-overview .kpi-foot { margin-top: 5px; font-size: 10px; line-height: 1.35; }
#view-overview .kpi-sparkline { height: 16px; opacity: .72; }
#view-overview .panel { padding: 16px; border: 1px solid var(--elite-line); border-radius: 12px; box-shadow: 0 3px 12px rgba(34,40,51,.025); }
#view-overview .overview-chart-panel { padding: 16px; }
#view-overview .chart-wide { height: 235px; }
#view-overview .elite-opportunity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#view-overview .executive-panel { padding: 16px; }
#view-overview .panel h3 { font-size: 15px; letter-spacing: 0; line-height: 1.25; }
#view-overview .eyebrow { font-size: 9px; letter-spacing: .06em; }
#view-overview .overview-metric-list, #view-overview .overview-rank-list { gap: 9px; }
#view-overview .overview-metric-copy span, #view-overview .overview-rank-row > span { font-size: 11px; line-height: 1.35; }
#view-overview .overview-metric-copy strong, #view-overview .overview-rank-row strong { font-size: 13px; }
#view-overview .compact-heading { margin-top: 16px; font-size: 12px; }
#view-overview .overview-bar { height: 4px; }
#view-overview .overview-review-strip { grid-template-columns: 1fr; gap: 10px; }
#view-overview .review-strip-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
#view-overview .review-strip-metric { padding: 8px 9px; border: 1px solid var(--elite-line); border-radius: 9px; }
#view-overview .review-strip-metric span { font-size: 10px; line-height: 1.3; }
#view-overview .review-strip-metric strong { margin-top: 5px; font-size: 19px; }
#view-overview .review-strip-action { justify-self: start; }
#view-overview .overview-recent-panel { padding: 16px; }
#view-overview .recent-columns { padding: 9px 0; font-size: 10px; }
#view-overview .recent-row { padding: 11px 0; }

@media (max-width: 1080px) {
  #view-overview .kpi-grid-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1024px) {
  #view-overview .elite-section-heading { display: block; }
  #view-overview .elite-section-heading > p { max-width: none; margin-top: 6px; text-align: left; padding-left: 32px; }
  #view-overview .elite-opportunity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #view-overview .elite-section { margin-bottom: 20px; }
  #view-overview .elite-section-heading { margin-bottom: 10px; }
  #view-overview .elite-section-heading h2 { font-size: 17px; }
  #view-overview .elite-section-heading > p { padding-left: 0; font-size: 11px; }
  #view-overview .kpi-grid-four { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #view-overview .kpi-card { min-height: 122px; padding: 12px; }
  #view-overview .kpi-label { font-size: 11px; }
  #view-overview .kpi-number { font-size: 28px; }
  #view-overview .panel, #view-overview .executive-panel, #view-overview .overview-chart-panel, #view-overview .overview-recent-panel { padding: 14px; }
  #view-overview .chart-wide { height: 225px; }
  #view-overview .review-strip-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 350px) {
  #view-overview .kpi-grid-four, #view-overview .review-strip-metrics { grid-template-columns: 1fr; }
}
/* ELITE RESUMEN V4 POLISH */
#view-overview .overview-chart-panel {
  padding: 15px 17px 13px;
}

#view-overview .overview-chart-panel .panel-header {
  margin-bottom: 4px;
}

#view-overview .overview-chart-panel .chart-wrap.chart-wide {
  height: 210px;
}

#view-overview .overview-review-strip {
  grid-template-columns: minmax(220px, .8fr) minmax(0, 3fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
}

#view-overview .review-strip-heading {
  min-width: 0;
}

#view-overview .review-strip-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  width: 100%;
}

#view-overview .review-strip-metric {
  min-width: 0;
  padding: 5px 10px;
  border: 0;
  border-left: 1px solid var(--elite-line);
  border-radius: 0;
  background: transparent;
}

#view-overview .review-strip-metric:first-child {
  border-left: 0;
}

#view-overview .review-strip-metric span {
  min-height: 25px;
  font-size: 10px;
  line-height: 1.25;
}

#view-overview .review-strip-metric strong {
  margin-top: 5px;
  font-size: 20px;
}

#view-overview .review-strip-action {
  justify-self: end;
  align-self: center;
}

@media (max-width: 1180px) {
  #view-overview .overview-review-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #view-overview .review-strip-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-overview .review-strip-metric:nth-child(4) {
    border-left: 0;
  }

  #view-overview .review-strip-action {
    justify-self: start;
  }
}

@media (max-width: 600px) {
  #view-overview .overview-chart-panel .chart-wrap.chart-wide {
    height: 205px;
  }

  #view-overview .review-strip-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-overview .review-strip-metric:nth-child(odd) {
    border-left: 0;
  }

  #view-overview .review-strip-metric:nth-child(4) {
    border-left: 1px solid var(--elite-line);
  }
}
/* ELITE RESUMEN V5 INSIGHTS GRID */
#view-overview.elite-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(360px, 1fr);
  column-gap: 20px;
  row-gap: 0;
}

#view-overview > .elite-section[aria-labelledby="elite-section-results"] {
  grid-column: 1 / -1;
  grid-row: 1;
}

#view-overview > .elite-section[aria-labelledby="elite-section-trend"] {
  grid-column: 1;
  grid-row: 2;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] {
  grid-column: 2;
  grid-row: 2;
}

#view-overview > .elite-section[aria-labelledby="elite-section-detail"] {
  grid-column: 1 / -1;
  grid-row: 3;
}

#view-overview > .elite-section[aria-labelledby="elite-section-activity"] {
  grid-column: 1 / -1;
  grid-row: 4;
}

#view-overview > .elite-section[aria-labelledby="elite-section-trend"] .elite-section-heading,
#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .elite-section-heading {
  display: block;
  min-height: 49px;
}

#view-overview > .elite-section[aria-labelledby="elite-section-trend"] .elite-section-heading > p,
#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .elite-section-heading > p {
  max-width: none;
  margin-top: 5px;
  padding-left: 32px;
  text-align: left;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .overview-review-strip {
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
  padding: 15px 16px;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-heading {
  align-items: flex-start;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metric,
#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metric:first-child,
#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metric:nth-child(4) {
  padding: 9px 10px;
  border: 1px solid var(--elite-line);
  border-radius: 9px;
  background: #FFFFFF;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metric span {
  min-height: 25px;
}

#view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-action {
  justify-self: start;
  margin-top: 1px;
}

#view-overview .elite-opportunity-grid {
  gap: 20px;
}

@media (max-width: 1280px) {
  #view-overview.elite-overview {
    display: block;
  }

  #view-overview > .elite-section[aria-labelledby="elite-section-trend"] .elite-section-heading,
  #view-overview > .elite-section[aria-labelledby="elite-section-pending"] .elite-section-heading {
    min-height: 0;
  }

  #view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  #view-overview > .elite-section[aria-labelledby="elite-section-pending"] .review-strip-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-overview .elite-opportunity-grid {
    gap: 14px;
  }
}
/* ELITE FUNNEL V7 POLISH */
#view-funnel {
  gap: 13px;
}

#view-funnel .view-return {
  margin-bottom: 4px;
}

#view-funnel #funnel-kpis {
  gap: 12px;
}

#view-funnel .funnel-kpi {
  min-height: 96px;
  padding: 13px 14px;
  border-left-width: 1px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(34, 40, 51, .025);
}

#view-funnel .funnel-kpi:not(.is-secondary) .kpi-number {
  font-size: 31px;
}

#view-funnel .funnel-kpi.is-secondary {
  background: #FBFCFD;
}

#view-funnel .funnel-kpi.is-secondary .kpi-number {
  font-size: 24px;
}

#view-funnel .dashboard-grid-main {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr);
  gap: 16px;
  align-items: stretch;
}

#view-funnel .panel {
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(34, 40, 51, .025);
}

#view-funnel .table-panel {
  padding: 0;
}

#view-funnel .chart-wide {
  height: 224px;
}

#view-funnel .panel-header {
  margin-bottom: 8px;
}

#view-funnel .rank-list {
  gap: 11px;
}

#view-funnel .rank-name {
  font-size: 11px;
  line-height: 1.3;
}

#view-funnel .rank-total {
  font-size: 15px;
}

#view-funnel .rank-bar {
  height: 4px;
}

#view-funnel #funnel-secondary-content .metric-item {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  background: #FBFCFD;
}

#view-funnel .table-toolbar {
  padding: 14px 16px;
}

#view-funnel .table-filters {
  gap: 12px;
  padding: 12px 14px;
  background: #F8FAFC;
}

#view-funnel .data-table th,
#view-funnel .data-table td {
  padding: 9px 11px;
}

#view-funnel .data-table tbody tr {
  height: 54px;
}

@media (max-width: 1024px) {
  #view-funnel .dashboard-grid-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #view-funnel .chart-wide {
    height: 220px;
  }
}

@media (max-width: 600px) {
  #view-funnel .funnel-kpi {
    min-height: 88px;
    padding: 11px 12px;
  }

  #view-funnel .funnel-kpi:not(.is-secondary) .kpi-number {
    font-size: 27px;
  }

  #view-funnel .funnel-kpi.is-secondary .kpi-number {
    font-size: 22px;
  }

  #view-funnel .chart-wide {
    height: 205px;
  }
}
/* MARIBEL CAMPAIGNS V9 */
#view-campaigns .elite-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#view-campaigns .elite-section-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#view-campaigns .elite-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

#view-campaigns .elite-section-heading > p {
  max-width: 46%;
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

#view-campaigns .elite-section-step {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}
#view-campaigns.campaign-story {
  gap: 0;
}

#view-campaigns .campaign-story-section {
  margin-top: 15px;
}

#view-campaigns .campaign-story-section:first-of-type {
  margin-top: 13px;
}

#view-campaigns .campaign-story-copy {
  margin-bottom: 12px;
  padding: 13px 15px;
  border: 1px solid #BFDBFE;
  border-left: 4px solid var(--investment);
  border-radius: 11px;
  background: linear-gradient(90deg, var(--investment-soft), #FFFFFF 72%);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

#view-campaigns .campaign-outcome-grid,
#view-campaigns .campaign-meta-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#view-campaigns .campaign-story-card,
#view-campaigns .campaign-meta-card {
  min-height: 116px;
  padding: 13px 14px;
  border-left-width: 3px;
  border-radius: 11px;
  box-shadow: var(--shadow-card);
}

#view-campaigns .campaign-story-card.is-investment {
  border-left-color: var(--investment);
  background: linear-gradient(180deg, #FFFFFF, var(--investment-soft));
}

#view-campaigns .campaign-story-card.is-contact {
  border-left-color: var(--contacts);
  background: linear-gradient(180deg, #FFFFFF, var(--contacts-soft));
}

#view-campaigns .campaign-story-card.is-outcome {
  border-left-color: var(--outcome);
  background: linear-gradient(180deg, #FFFFFF, var(--outcome-soft));
}

#view-campaigns .campaign-meta-card {
  border-left-color: #93A4B8;
  background: #FFFFFF;
}

#view-campaigns .campaign-story-card .kpi-number,
#view-campaigns .campaign-meta-card .kpi-number {
  margin-top: 9px;
  font-size: 27px;
}

#view-campaigns .campaign-method-note {
  margin: 9px 1px 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.45;
}

#view-campaigns .campaign-trend-panel,
#view-campaigns .campaign-commercial-ad-panel,
#view-campaigns .campaign-video-section,
#view-campaigns .campaign-placement-panel {
  margin-top: 0;
  margin-bottom: 0;
}

#view-campaigns .campaign-media-ad-panel {
  margin-top: 11px;
}

#view-campaigns .campaign-result-table th:nth-child(n+2),
#view-campaigns .campaign-result-table td:nth-child(n+2) {
  text-align: right;
}

#view-campaigns .campaign-contact-value {
  color: var(--contacts-dark);
}

#view-campaigns .campaign-outcome-value {
  color: var(--outcome-dark);
}

#view-campaigns .elite-section-step {
  background: var(--general-soft);
  color: var(--general-dark);
}

#view-campaigns .campaign-story-section:nth-of-type(1) .elite-section-step {
  background: var(--investment-soft);
  color: var(--investment-dark);
}

#view-campaigns .campaign-story-section:nth-of-type(2) .elite-section-step {
  background: var(--contacts-soft);
  color: var(--contacts-dark);
}

#view-campaigns .campaign-story-section:nth-of-type(4) .elite-section-step {
  background: var(--outcome-soft);
  color: var(--outcome-dark);
}

@media (max-width: 1180px) {
  #view-campaigns .campaign-outcome-grid,
  #view-campaigns .campaign-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #view-campaigns .campaign-outcome-grid,
  #view-campaigns .campaign-meta-grid {
    grid-template-columns: 1fr;
  }

  #view-campaigns .campaign-story-card,
  #view-campaigns .campaign-meta-card {
    min-height: 96px;
  }

  #view-campaigns .campaign-story-copy {
    font-size: 12px;
  }
}
@media (max-width: 1024px) {
  #view-campaigns .elite-section-heading {
    display: block;
  }

  #view-campaigns .elite-section-heading > p {
    max-width: none;
    margin-top: 6px;
    padding-left: 32px;
    text-align: left;
  }
}

@media (max-width: 700px) {
  #view-campaigns .elite-section-heading > p {
    padding-left: 0;
  }
}
