:root {
  --ink: #0f2436;
  --muted: #5c728a;
  --line: #dce5f2;
  --panel: #ffffff;
  --soft: #f5f8fc;
  --blue: #0274be;
  --navy: #00223a;
  --cyan: #49c8f5;
  --green: #0f9d58;
  --orange: var(--blue);
  --red: #ff334d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f7fb;
  font-family: Lato, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 34px 15px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  color: var(--navy);
  font-family: Koulen, Lato, sans-serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

input,
button,
select {
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: min(330px, 35vw);
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: #fff;
}

button {
  border: 1px solid #8fc6e8;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.actions button {
  padding: 11px 20px;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.actions .outline-action {
  background: #fff;
  color: var(--blue);
  border-color: #8fc6e8;
}

.actions .primary-action {
  min-width: 140px;
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

#refreshButton {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 12px rgba(2, 116, 190, 0.4);
}

.custom-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-date-range input[type="date"] {
  padding: 8px 10px;
  font-size: 12px;
}

.custom-date-range span {
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  padding: 0 34px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 140px;
  padding: 17px 18px;
  color: var(--ink);
  background: #f8fafd;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.tab.active {
  background: #fff;
  box-shadow: inset 0 -4px 0 var(--blue);
}

.quick-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 34px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.quick-filter-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-filter-bar select {
  width: 190px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-transform: none;
}

.quick-filter-bar p {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  padding: 18px 34px 14px;
}

.table-panel,
.chart-card,
.summary-card,
.rep-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  gap: 22px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.link-button {
  padding: 0;
  color: var(--blue);
  border: 0;
  background: transparent;
}

.table-panel {
  position: relative;
}

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

.scroll-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.scroll-fade.visible {
  opacity: 1;
}

.scroll-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--panel), transparent);
}

.scroll-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--panel), transparent);
}

table {
  width: 100%;
  min-width: 1976px;
  border-collapse: collapse;
  table-layout: fixed;
}

.col-store {
  width: 260px;
}

.col-health {
  width: 100px;
}

.col-money {
  width: 118px;
}

.col-milestone {
  width: 92px;
}

.col-next {
  width: 130px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: #47617f;
  background: #fbfcff;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

thead tr:first-child th {
  text-align: center;
}

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

.carts-header {
  color: var(--blue);
  background: #eaf5fd;
}

.sort-header {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: inherit;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  width: 100%;
}

.sort-header.active::after {
  content: attr(data-direction);
  margin-left: 6px;
  color: var(--blue);
}

.filter-row th {
  padding: 8px 10px 12px;
  background: #fff;
}

.filter-row input,
.filter-row select {
  width: 100%;
  min-width: 92px;
  padding: 8px 9px;
  color: var(--ink);
  font-size: 12px;
  text-transform: none;
}

.clear-filters {
  width: 100%;
  padding: 8px 9px;
  color: var(--blue);
  background: #fff;
  border-color: var(--line);
  font-size: 12px;
}

.columns-control {
  position: relative;
}

.columns-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 260px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 35, 60, 0.16);
}

.columns-panel-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.columns-panel-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.column-toggle,
.columns-density-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.column-toggle input,
.columns-density-option input {
  width: auto;
  padding: 0;
}

#resetColumns {
  padding: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.store-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.store-name {
  display: block;
  max-width: 210px;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-link,
.metric-link,
.link-cell,
.next-pill,
.milestone-dot {
  text-decoration: none;
}

.store-link,
.metric-link {
  color: var(--ink);
}

.store-link:hover,
.metric-link:hover,
.next-pill:hover,
.milestone-dot:hover {
  color: var(--blue);
}

.deal-name {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-estimate {
  color: #b45309;
  font-style: italic;
}

.deal-name-estimate {
  color: #b45309;
}

.status-chip {
  display: inline-flex;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-open {
  color: #065f46;
  background: #dff7e9;
}

.status-closed {
  color: #4f46e5;
  background: #e9e8ff;
}

.status-perpetual {
  color: #065f46;
  background: #dff7e9;
}

.status-has-close-date {
  color: #b45309;
  background: #fff3d8;
}

.health {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: 800;
}

.health-live {
  color: #065f46;
  background: #dff7e9;
}

.health-closed {
  color: #4f46e5;
  background: #e9e8ff;
}

.health-risk {
  color: #c5162f;
  background: #ffe8ec;
}

.health-pending {
  color: #b45309;
  background: #fff3d8;
}

.health-tooltip {
  position: relative;
  display: inline-block;
}

.health-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  color: #fff;
  background: var(--navy);
  border-radius: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  white-space: normal;
}

.health-tooltip:hover::after,
.health-tooltip:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.amount {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  font-size: 17px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-up {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.milestone-cell {
  text-align: center;
}

.milestone-dot {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #6e7f99;
  background: #fff;
  border: 2px solid #b7c5da;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

.milestone-dot.reached {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.milestone-dot.next {
  color: var(--blue);
  background: #fff;
  border-color: var(--blue);
}

.next-pill {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  padding: 7px 9px;
  color: #0f3366;
  background: #eaf2ff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.milestone-bar {
  width: 120px;
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  background: #e8eef7;
  border-radius: 999px;
}

.milestone-fill {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.external-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.summary {
  display: grid;
  gap: 10px;
  align-content: start;
}

.summary-card {
  padding: 18px;
}

.summary-card h2 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
}

.stat-line {
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.stat-line strong {
  color: var(--green);
  font-size: 26px;
}

.stat-line.warning strong {
  color: var(--red);
}

.stat-line-clickable {
  width: 100%;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 4px 6px;
  margin-left: -6px;
  margin-right: -6px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.stat-line-clickable:hover,
.stat-line-clickable:focus-visible {
  background: rgba(15, 157, 88, 0.08);
}

.stat-line.warning.stat-line-clickable:hover,
.stat-line.warning.stat-line-clickable:focus-visible {
  background: rgba(217, 48, 37, 0.08);
}

.stat-line-clickable.active {
  background: rgba(15, 157, 88, 0.14);
}

.stat-line.warning.stat-line-clickable.active {
  background: rgba(217, 48, 37, 0.14);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.big-number {
  display: block;
  margin: 6px 0 14px;
  font-size: 28px;
}

.line-chart {
  height: 72px;
  margin-top: 10px;
  padding: 4px;
  background: linear-gradient(180deg, #fbfffd, #eefcf4);
  border-radius: 8px;
}

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

.chart-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.alert-card {
  color: #8f1028;
  background: #fff8fa;
  border-color: #ffd6de;
}

ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

li {
  font-size: 13px;
}

.leaderboard-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.leaderboard-link:hover {
  color: var(--blue);
}

.rep-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 18px 34px;
  overflow: hidden;
}

.metric {
  padding: 18px 22px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .topbar,
  .tabs,
  .quick-filter-bar,
  .content-grid,
  .rep-summary {
    margin-left: 0;
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .quick-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-filter-bar p {
    margin-left: 0;
  }

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

@media (max-width: 640px) {
  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  input {
    width: 100%;
  }

  .tabs {
    overflow-x: auto;
  }

  .rep-summary {
    grid-template-columns: 1fr;
  }
}
/* Compact HubSpot-style desktop density */
body {
  font-family: Lato, Arial, Helvetica, sans-serif;
  font-size: 12px;
}

.topbar {
  padding: 12px 18px 10px;
  gap: 16px;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
}

.brand-logo {
  width: 30px;
  height: 30px;
}

.topbar p {
  margin-top: 3px;
  font-size: 10px;
}

.actions {
  gap: 7px;
}

.actions input {
  width: 250px;
  padding: 8px 10px;
  font-size: 11px;
}

.actions button {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
}

.actions .primary-action {
  min-width: 112px;
}

.tabs {
  padding: 0 18px;
}

.tab {
  min-width: 112px;
  padding: 11px 13px;
  border-radius: 6px 6px 0 0;
  font-size: 11px;
}

.quick-filter-bar {
  gap: 10px;
  padding: 8px 18px;
}

.quick-filter-bar label {
  gap: 6px;
  font-size: 9px;
}

.quick-filter-bar select {
  width: 155px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 10px;
}

.quick-filter-bar p {
  font-size: 9px;
}

.quick-clear {
  width: auto;
  padding: 6px 9px;
  font-size: 10px;
}

.content-grid {
  grid-template-columns: minmax(0, 1fr) 238px;
  gap: 10px;
  padding: 10px 18px 8px;
}

.table-panel,
.summary-card,
.rep-summary {
  border-radius: 6px;
}

.table-wrap {
  scrollbar-width: thin;
}

table {
  min-width: 1408px;
  font-size: 10px;
}

.col-store {
  width: 190px;
}

.col-health {
  width: 64px;
}

.col-money {
  width: 82px;
}

.col-milestone {
  width: 78px;
}

.col-next {
  width: 96px;
}

th,
td {
  padding: 8px 6px;
  line-height: 1.2;
}

th {
  font-size: 9px;
}

.sort-header {
  font-size: 9px;
  line-height: 1.15;
}

.sort-header.active::after {
  margin-left: 3px;
  font-size: 7px;
}

.table-dense {
  font-size: 8px;
}

.table-dense th,
.table-dense td {
  padding: 4px 4px;
  line-height: 1.05;
}

.table-dense th,
.table-dense .sort-header {
  font-size: 7px;
}

.table-dense .amount {
  font-size: 10px;
}

.table-dense .deal-name,
.table-dense .trend-up {
  font-size: 6.5px;
}

.table-dense .logo {
  width: 26px;
  height: 26px;
  font-size: 8px;
}

.filter-row th {
  padding: 5px 6px 7px;
}

.filter-row input,
.filter-row select {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 5px;
  font-size: 9px;
}

.store-cell {
  gap: 8px;
}

.logo {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 11px;
}

.store-name {
  max-width: 150px;
  font-size: 11px;
}

.deal-name {
  max-width: 165px;
  font-size: 8.5px;
}

.status-chip {
  margin-right: 3px;
  padding: 1px 4px;
  font-size: 7px;
}

.health {
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 9px;
}

.amount {
  font-size: 12px;
}

.trend-up {
  font-size: 8.5px;
}

.milestone-dot {
  width: 18px;
  height: 18px;
  border-width: 1.5px;
  font-size: 7px;
}

.milestone-cell .deal-name {
  margin-top: 2px;
  text-align: center;
}

.summary {
  gap: 7px;
}

.summary-card {
  padding: 11px;
}

.summary-card h2 {
  margin-bottom: 9px;
  font-size: 10px;
}

.stat-line {
  grid-template-columns: minmax(34px, auto) 1fr;
  gap: 5px;
  margin: 7px 0;
  font-size: 9px;
}

.stat-line strong {
  font-size: 19px;
}

.eyebrow,
.chart-foot {
  font-size: 8.5px;
}

.big-number {
  margin: 4px 0 8px;
  font-size: 22px;
}

.line-chart {
  height: 52px;
  margin-top: 6px;
}

ol {
  gap: 6px;
  padding-left: 16px;
}

li,
.leaderboard-link {
  font-size: 9px;
}

.rep-summary {
  margin: 10px 18px;
}

.metric {
  padding: 11px 14px;
}

.metric span {
  font-size: 9px;
}

.metric strong {
  margin-top: 3px;
  font-size: 20px;
}

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

  .actions .outline-action {
    display: none;
  }
}