:root {
  --bg: #f4f8ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: #eef4ff;
  --border: rgba(17, 49, 108, 0.1);
  --shadow: 0 20px 50px rgba(21, 54, 117, 0.1);
  --shadow-soft: 0 10px 30px rgba(21, 54, 117, 0.08);
  --text: #17305f;
  --text-soft: #5670a3;
  --text-faint: #7d90b7;
  --nav: linear-gradient(180deg, #081938 0%, #0e2a5c 55%, #081a3f 100%);
  --blue: #1567ff;
  --blue-strong: #114eca;
  --blue-soft: #d8e8ff;
  --green: #16b86f;
  --green-soft: #dff8ec;
  --orange: #ff9f1a;
  --orange-soft: #fff0db;
  --red: #ef4444;
  --red-soft: #ffe3e3;
  --purple: #8b5cf6;
  --purple-soft: #ede5ff;
  --teal: #0ea5a4;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 276px;
  --content-width: 1480px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(21, 103, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 164, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

body {
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  padding: 28px 18px 26px;
  background: var(--nav);
  color: #fff;
  box-shadow: 8px 0 36px rgba(4, 16, 44, 0.22);
}

.brand {
  padding: 4px 10px 0;
}

.brand-logo-wrap {
  width: 100%;
  padding: 16px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 16px 32px rgba(3, 17, 48, 0.22);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.nav-section {
  display: grid;
  gap: 10px;
}

.nav-label {
  padding: 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.48);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(26, 109, 255, 0.55), rgba(38, 142, 255, 0.22));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-item.locked {
  opacity: 0.7;
}

.nav-icon,
.metric-icon,
.table-avatar,
.hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav-icon svg,
.metric-icon svg,
.hero-icon svg {
  width: 22px;
  height: 22px;
}

.nav-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lock-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 20px;
  padding: 0 10px;
}

.update-badge {
  display: flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.update-dot {
  width: 13px;
  height: 13px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #29d391 0%, #09b27f 100%);
  box-shadow: 0 0 20px rgba(41, 211, 145, 0.6);
}

.copyright {
  color: rgba(255, 255, 255, 0.75);
}

.content {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(248, 251, 255, 0.7);
  border-bottom: 1px solid rgba(31, 69, 145, 0.08);
}

.topbar-inner,
.page {
  width: min(calc(100vw - var(--sidebar-width)), var(--content-width));
  max-width: calc(100vw - var(--sidebar-width));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.topbar-subtitle {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 15px;
}

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

.ghost-button,
.primary-button,
.period-chip,
.toggle-chip,
.filter-input,
.filter-select,
.button-chip {
  border: 1px solid rgba(21, 103, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.ghost-button,
.primary-button,
.button-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  cursor: pointer;
}

.ghost-button:hover,
.primary-button:hover,
.button-chip:hover,
.period-chip:hover,
.toggle-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.ghost-button {
  width: 52px;
}

.primary-button {
  background: linear-gradient(180deg, #1d78ff 0%, #1157ff 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(17, 87, 255, 0.24);
}

.page {
  padding: 28px;
}

.page-grid {
  display: grid;
  gap: 24px;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.card-enter {
  animation: cardRise 520ms ease both;
}

.card::before {
  position: absolute;
  content: "";
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 35%),
    radial-gradient(circle at top right, rgba(21, 103, 255, 0.07), transparent 20%);
  pointer-events: none;
}

.card-body {
  position: relative;
  padding: 24px;
}

.hero-grid,
.stats-grid,
.summary-grid,
.progress-grid,
.funnel-grid,
.table-grid,
.placeholder-grid,
.single-grid {
  display: grid;
  gap: 24px;
}

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

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

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

.summary-grid {
  grid-template-columns: 340px minmax(0, 1fr);
}

.funnel-grid {
  grid-template-columns: 1.4fr 0.9fr;
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filters-column {
  display: grid;
  gap: 14px;
}

.filter-block {
  display: grid;
  gap: 10px;
}

.filter-title,
.section-label {
  font-size: 18px;
  font-weight: 600;
}

.period-chip,
.toggle-chip,
.button-chip {
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

.period-chip.active,
.toggle-chip.active,
.button-chip.active {
  border-color: rgba(21, 103, 255, 0.28);
  background: linear-gradient(180deg, rgba(21, 103, 255, 0.16), rgba(21, 103, 255, 0.06));
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(21, 103, 255, 0.14);
}

.filter-input,
.filter-select {
  min-height: 52px;
  padding: 0 16px;
  width: min(100%, 320px);
}

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

.kpi-card,
.metric-card,
.info-card,
.mini-card {
  position: relative;
  display: grid;
  gap: 16px;
  height: 100%;
}

.kpi-card {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.metric-icon,
.table-avatar,
.hero-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.metric-icon.blue,
.hero-icon.blue,
.table-avatar.blue {
  background: linear-gradient(180deg, #e4efff, #d8ebff);
  color: var(--blue);
}

.metric-icon.green,
.hero-icon.green,
.table-avatar.green {
  background: linear-gradient(180deg, #e1fbef, #d2f6e5);
  color: var(--green);
}

.metric-icon.orange,
.hero-icon.orange,
.table-avatar.orange {
  background: linear-gradient(180deg, #fff2df, #ffe8c8);
  color: var(--orange);
}

.metric-icon.purple,
.hero-icon.purple,
.table-avatar.purple {
  background: linear-gradient(180deg, #efe9ff, #e7deff);
  color: var(--purple);
}

.metric-icon.red,
.hero-icon.red,
.table-avatar.red {
  background: linear-gradient(180deg, #ffe7e7, #ffdcdc);
  color: var(--red);
}

.metric-label {
  color: var(--text-soft);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-center {
  text-align: center;
}

.metric-spaced {
  margin-top: 20px;
}

.stats-title {
  font-size: 16px;
}

.metric-subvalue {
  color: var(--text-soft);
  font-size: 16px;
}

.delta {
  font-weight: 700;
}

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

.delta.warning {
  color: var(--orange);
}

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

.delta.neutral {
  color: var(--blue);
}

.split-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(21, 49, 108, 0.1);
  color: var(--text-soft);
}

.chart-card {
  display: grid;
  gap: 22px;
}

.chart-legend {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 26px;
  color: var(--text-soft);
}

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

.legend-line {
  width: 26px;
  height: 0;
  border-top: 3px solid var(--blue);
  border-radius: 999px;
}

.legend-line.dashed {
  border-top-style: dashed;
  border-top-color: rgba(70, 103, 168, 0.45);
}

.line-chart {
  width: 100%;
  aspect-ratio: 16 / 5.6;
}

.chart-area {
  opacity: 0;
  transition: opacity 700ms ease;
}

.chart-area.is-visible {
  opacity: 1;
}

.chart-line {
  transition: stroke-dashoffset 1100ms cubic-bezier(.22,1,.36,1);
}

.chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-faint);
  font-size: 14px;
}

.grid-label {
  font-size: 13px;
  fill: #7388b3;
}

.axis-label {
  font-size: 12px;
  fill: #7d90b7;
}

.table-card,
.placeholder-card,
.funnel-card {
  height: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.data-table th,
.data-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(21, 49, 108, 0.08);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-soft);
  font-weight: 600;
}

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

.data-table tfoot td {
  font-size: 17px;
  font-weight: 700;
  border-top: 1px solid rgba(21, 49, 108, 0.08);
  border-bottom: 0;
}

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

.hint {
  display: flex;
  gap: 10px;
  color: var(--text-soft);
  line-height: 1.55;
}

.hint-dot {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1px solid rgba(21, 103, 255, 0.24);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.progress-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.progress-ring {
  --size: 170px;
  --ring-color: var(--blue);
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
  display: grid;
  place-items: center;
  position: relative;
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 10;
}

.ring-track {
  stroke: rgba(21, 103, 255, 0.1);
}

.ring-progress {
  stroke: var(--ring-color);
  stroke-linecap: round;
  transition: stroke-dashoffset 900ms cubic-bezier(.22,1,.36,1);
}

.ring-inner {
  display: grid;
  gap: 4px;
  text-align: center;
  z-index: 1;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  place-content: center;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 10px 30px rgba(21, 103, 255, 0.08);
}

.ring-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ring-label {
  color: var(--text-soft);
  font-size: 14px;
}

.progress-stats {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-soft);
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(18, 72, 170, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue) 0%, #59a3ff 100%);
  transition: width 900ms cubic-bezier(.22,1,.36,1);
}

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

.hero-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0;
}

.hero-separator {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 1px;
  height: calc(100% - 56px);
  background: rgba(21, 49, 108, 0.12);
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.performance-board {
  display: grid;
  gap: 22px;
}

.person-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 110px;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(21, 49, 108, 0.08);
}

.person-row:last-child {
  border-bottom: 0;
}

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

.person-name {
  font-size: 18px;
  font-weight: 600;
}

.person-sub {
  color: var(--text-soft);
  font-size: 14px;
}

.segmented-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(21, 49, 108, 0.08);
  overflow: hidden;
}

.segmented-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  transition:
    width 900ms cubic-bezier(.22,1,.36,1),
    left 900ms cubic-bezier(.22,1,.36,1);
}

.segmented-fill.incoming {
  background: linear-gradient(90deg, #2679ff 0%, #1f67e7 100%);
}

.segmented-fill.missed {
  background: linear-gradient(90deg, #ff5f5f 0%, #ef4444 100%);
}

.segmented-fill.outgoing {
  background: linear-gradient(90deg, #ffb11a 0%, #ff9600 100%);
}

.segment-values {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 14px;
}

.segment-values strong {
  font-size: 17px;
}

.plan-note {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  color: var(--text-soft);
}

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

.mini-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.9));
  border: 1px solid rgba(21, 49, 108, 0.08);
}

.funnel-stack {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}

.funnel-stage {
  position: relative;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  color: #fff;
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  box-shadow: 0 18px 32px rgba(17, 72, 170, 0.16);
}

.funnel-stage.orders {
  background: linear-gradient(90deg, #1f79ff, #5eb2ff);
}

.funnel-stage.bills {
  background: linear-gradient(90deg, #7c4dff, #a47cff);
}

.funnel-stage.payments {
  background: linear-gradient(90deg, #ff8a00, #ffb54a);
}

.funnel-stage.shipments {
  background: linear-gradient(90deg, #0cb97a, #42d3a0);
}

.funnel-stage.s1 {
  width: 100%;
}

.funnel-stage.s2 {
  width: 88%;
  margin-left: auto;
  margin-right: auto;
}

.funnel-stage.s3 {
  width: 76%;
  margin-left: auto;
  margin-right: auto;
}

.funnel-stage.s4 {
  width: 64%;
  margin-left: auto;
  margin-right: auto;
}

.funnel-stage strong {
  font-size: 30px;
  letter-spacing: -0.03em;
}

.funnel-meta {
  display: grid;
  gap: 4px;
}

.funnel-conversions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--text-soft);
}

.placeholder-wrap {
  min-height: 640px;
  display: grid;
  place-items: center;
  text-align: center;
}

.placeholder-content {
  max-width: 740px;
  display: grid;
  gap: 20px;
}

.row-percent {
  text-align: right;
  font-size: 28px;
}

.forecast-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 0;
  border-left: 2px dashed rgba(21, 103, 255, 0.55);
}

.placeholder-title {
  margin: 0;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.placeholder-text {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1.6;
}

.joke {
  padding: 18px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(21, 103, 255, 0.08), rgba(14, 165, 164, 0.08));
  color: var(--text);
  font-size: 18px;
}

.cat-scene {
  width: min(100%, 520px);
  margin: 10px auto 0;
}

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

.shell-enter {
  animation: shellFade 320ms ease both;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shellFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(21, 103, 255, 0.08);
  color: var(--blue);
  font-weight: 600;
}

.empty-state {
  padding: 30px 0 8px;
  color: var(--text-soft);
}

@media (max-width: 1380px) {
  .stats-grid,
  .hero-grid,
  .progress-grid,
  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .funnel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .topbar-inner,
  .page {
    width: 100%;
    max-width: none;
  }
}

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

  .sidebar {
    position: relative;
    min-height: auto;
    gap: 20px;
  }

  .content {
    width: 100%;
  }

  .topbar {
    position: relative;
  }

  .topbar-inner,
  .page {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .hero-separator {
    display: none;
  }
}

@media (max-width: 780px) {
  .stats-grid,
  .hero-grid,
  .progress-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .page-title {
    font-size: 34px;
  }

  .card-body {
    padding: 20px;
  }

  .person-row {
    gap: 12px;
  }

  .funnel-stage {
    height: auto;
    padding-top: 18px;
    padding-bottom: 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .line-chart {
    aspect-ratio: 16 / 8.8;
  }
}
