:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --ink: #17212f;
  --muted: #67758a;
  --line: #dbe3ed;
  --teal: #0f8b8d;
  --teal-soft: #dff4f2;
  --blue: #276ef1;
  --blue-soft: #e7efff;
  --green: #15803d;
  --amber: #b7791f;
  --red: #c2413d;
  --shadow: 0 18px 45px rgba(25, 42, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px 18px;
  background: #111a25;
  color: #ffffff;
}

.brand,
.sync-card,
.nav-item,
.topbar,
.filters,
.panel-header,
.legend,
.manager-row,
.top-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #29b7a8;
  color: #071217;
  font-size: 22px;
  font-weight: 800;
}

.brand strong,
.sync-card strong {
  display: block;
  font-size: 15px;
}

.brand span,
.sync-card span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

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

.nav-item {
  min-height: 42px;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #67d5ca;
}

.sync-card {
  gap: 10px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.16);
}

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

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

.top-actions {
  gap: 10px;
}

.button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.button {
  padding: 0 16px;
  font-weight: 700;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.icon-button {
  width: 40px;
  font-size: 20px;
}

.filters {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters label {
  display: grid;
  min-width: 190px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 18px;
}

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

.metric strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.metric em {
  color: var(--green);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  margin-bottom: 18px;
}

.lower-grid {
  grid-template-columns: minmax(360px, 0.88fr) minmax(420px, 1.12fr);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.panel-badge.danger {
  background: #fee6e4;
  color: var(--red);
}

.funnel-chart {
  display: grid;
  gap: 12px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 132px minmax(120px, 1fr) 88px;
  align-items: center;
  gap: 12px;
}

.stage-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 36px;
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 28px;
  padding-right: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--teal), #48b7b2);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.stage-money {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(24px, 1fr));
  align-items: end;
  gap: 10px;
  height: 280px;
  padding: 12px 4px 0;
  border-bottom: 1px solid var(--line);
}

.trend-column {
  display: grid;
  align-items: end;
  gap: 5px;
  height: 100%;
}

.trend-bar {
  min-height: 4px;
  border-radius: 7px 7px 0 0;
}

.trend-revenue {
  background: var(--blue);
}

.trend-leads {
  background: var(--teal);
}

.trend-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.legend {
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 2px;
}

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

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

.manager-list {
  display: grid;
  gap: 14px;
}

.manager-row {
  gap: 12px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.manager-info {
  min-width: 0;
  flex: 1;
}

.manager-name {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.manager-name span:last-child {
  color: var(--green);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

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

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

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-weight: 700;
}

.age-risk {
  color: var(--red);
}

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

  .brand div,
  .nav-item span:last-child,
  .sync-card div {
    display: none;
  }

  .brand,
  .nav-item,
  .sync-card {
    justify-content: center;
  }

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

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

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

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

  .main {
    padding: 16px;
  }

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

  .top-actions,
  .button.primary {
    width: 100%;
  }

  .button.primary {
    flex: 1;
  }

  .filters label {
    min-width: 100%;
  }

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

  .panel {
    padding: 14px;
  }

  .funnel-row {
    grid-template-columns: 92px minmax(90px, 1fr) 72px;
    gap: 8px;
  }

  .stage-name,
  .stage-money {
    font-size: 12px;
  }

  .trend-chart {
    gap: 6px;
    height: 220px;
  }
}
