:root {
  --bg: #f3efe7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --surface-dark: #163029;
  --border: rgba(22, 48, 41, 0.12);
  --text: #14221d;
  --muted: #597067;
  --accent: #0f8c6a;
  --accent-soft: #d8f3e8;
  --warning: #d7812b;
  --danger: #bf4e3d;
  --shadow: 0 22px 45px rgba(20, 34, 29, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 140, 106, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(215, 129, 43, 0.16), transparent 28%),
    linear-gradient(135deg, #f8f4ec 0%, #f2efe9 42%, #e9f1ee 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(20, 34, 29, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 34, 29, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 85%);
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
}

.sidebar,
.panel,
.hero {
  backdrop-filter: blur(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  border-radius: 28px;
  padding: 24px;
}

.brand {
  display: grid;
  gap: 0;
  margin-bottom: 28px;
}

.brand-logo {
  width: 100%;
  max-width: 248px;
  height: auto;
  display: block;
  object-fit: contain;
}

.hero h2,
.panel h3 {
  margin: 0;
}

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

.nav {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: #163029;
  color: #f7f3eb;
}

.sidebar-panel {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(22, 48, 41, 0.08);
}

.sidebar-panel + .sidebar-panel {
  margin-top: 14px;
}

.panel-label,
.panel-hint {
  margin: 0;
  color: var(--muted);
}

.panel-link {
  color: var(--accent);
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

.panel-hint {
  margin-top: 6px;
  font-size: 14px;
}

.goal-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(22, 48, 41, 0.08);
}

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

.content {
  display: grid;
  gap: 24px;
}

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

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(22, 48, 41, 0.08);
  box-shadow: 0 10px 24px rgba(20, 34, 29, 0.06);
}

.topbar-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(22, 48, 41, 0.12);
}

.topbar-period {
  font-size: 14px;
  color: var(--muted);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  border-radius: 32px;
  padding: 30px;
  background:
    radial-gradient(circle at top right, rgba(15, 140, 106, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
}

.hero h2 {
  max-width: 680px;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero-badge {
  min-width: 200px;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(160deg, #163029, #21473d);
  color: #fbf7ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.hero-badge strong {
  display: block;
  margin-top: 12px;
  font-size: 40px;
}

.hero-badge .panel-hint {
  display: block;
  margin-top: 6px;
  color: rgba(251, 247, 239, 0.74);
}

.kpi-grid,
.grid-two {
  display: grid;
  gap: 20px;
}

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

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

.kpi-card,
.panel {
  border-radius: 24px;
}

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

.sales-grid {
  margin-top: 18px;
}

.sales-panel {
  margin-top: 4px;
}

.sales-filter-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 18px;
}

.sales-filter-grid .toolbar-group {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.sales-filter-grid .filter-label {
  display: block;
  line-height: 1.25;
}

.sales-filter-grid .month-filter {
  width: 100%;
  min-width: 0;
}

.panel-nested {
  padding: 22px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

.sales-copy {
  margin-top: 8px;
}

.kpi-card {
  padding: 20px 20px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

.kpi-value {
  margin: 12px 0 10px;
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.kpi-change {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.is-up {
  background: var(--accent-soft);
  color: var(--accent);
}

.is-down {
  background: rgba(191, 78, 61, 0.12);
  color: var(--danger);
}

.panel {
  padding: 24px;
}

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

.panel-head-tight {
  margin-bottom: 0;
}

.toolbar-panel {
  padding: 18px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76));
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(243, 239, 231, 0.72);
  border: 1px solid rgba(22, 48, 41, 0.06);
}

.toolbar-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.refresh-button {
  border: 0;
  border-radius: 16px;
  min-height: 52px;
  padding: 0 18px;
  background: linear-gradient(135deg, #163029, #215041);
  color: #f7f3eb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(22, 48, 41, 0.14);
}

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

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

.refresh-status[data-state="error"] {
  color: var(--danger);
}

.filter-label {
  color: var(--muted);
  font-size: 14px;
}

.month-filter {
  min-width: 180px;
  border: 1px solid rgba(22, 48, 41, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: inherit;
}

.language-toggle {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: #163029;
  color: #f7f3eb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(22, 48, 41, 0.18);
}

.topbar-toggle {
  min-width: 64px;
}

.channel-list,
.funnel,
.insight-list,
.action-list {
  display: grid;
  gap: 14px;
}

.channel-item {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(22, 48, 41, 0.035);
  border: 1px solid rgba(22, 48, 41, 0.06);
}

.channel-item.is-selected {
  background: linear-gradient(180deg, rgba(15, 140, 106, 0.08), rgba(15, 140, 106, 0.03));
  border: 1px solid rgba(15, 140, 106, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.channel-head,
.channel-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.channel-head {
  margin-bottom: 12px;
}

.channel-head strong {
  font-size: 15px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(22, 48, 41, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #163029, #0f8c6a);
}

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

.chart-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(243, 239, 231, 0.8), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(22, 48, 41, 0.05);
}

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

.sales-status-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(22, 48, 41, 0.03);
}

.sales-status-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.sales-status-head strong {
  font-size: 14px;
}

.sales-status-head span {
  color: var(--muted);
  font-size: 12px;
}

.sales-bar-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(22, 48, 41, 0.08);
}

.sales-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #163029, #0f8c6a);
}

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

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

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(22, 48, 41, 0.06);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
}

.legend-swatch.revenue,
.legend-swatch.line-revenue {
  background: #0f8c6a;
}

.legend-swatch.expense,
.legend-swatch.line-expense {
  background: #163029;
}

.legend-swatch.line-expense {
  background: #d7812b;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.funnel-step {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(22, 48, 41, 0.03);
}

.funnel-label,
.funnel-value {
  font-weight: 700;
}

.funnel-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(22, 48, 41, 0.08);
  overflow: hidden;
}

.funnel-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d7812b, #0f8c6a);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(22, 48, 41, 0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.7);
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid rgba(22, 48, 41, 0.08);
  text-align: left;
}

th {
  color: #42564f;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(243, 239, 231, 0.86);
  position: sticky;
  top: 0;
}

tbody tr:nth-child(even) {
  background: rgba(22, 48, 41, 0.025);
}

tbody tr:hover {
  background: rgba(15, 140, 106, 0.05);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-scale {
  background: rgba(15, 140, 106, 0.12);
  color: var(--accent);
}

.status-watch {
  background: rgba(215, 129, 43, 0.14);
  color: var(--warning);
}

.status-fix {
  background: rgba(191, 78, 61, 0.12);
  color: var(--danger);
}

.insight-list,
.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.insight-list li,
.action-list li {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(22, 48, 41, 0.08);
  line-height: 1.5;
  box-shadow: 0 8px 20px rgba(20, 34, 29, 0.04);
}

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

  .sidebar {
    position: relative;
    top: 0;
    display: grid;
    gap: 14px;
  }

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

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

  .toolbar-group {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-cluster {
    width: 100%;
    justify-content: stretch;
  }

  .refresh-button {
    width: 100%;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav {
    margin-bottom: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
    gap: 14px;
  }

  .sidebar,
  .panel,
  .hero,
  .kpi-card {
    border-radius: 22px;
  }

  .hero {
    padding: 22px;
  }

  .hero h2 {
    font-size: 30px;
    line-height: 1.08;
  }

  .funnel-step {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: start;
    gap: 12px;
  }

  .topbar-meta,
  .toolbar-group,
  .month-filter,
  .language-toggle,
  .refresh-button {
    width: 100%;
  }

  .sidebar {
    padding: 16px;
    gap: 12px;
  }

  .brand {
    justify-items: center;
  }

  .brand-logo {
    max-width: 170px;
  }

  .nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
    padding: 11px 14px;
  }

  .sidebar-panel {
    padding: 14px;
  }

  .goal-row {
    padding: 8px 0;
    font-size: 13px;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-meta {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
    text-align: center;
  }

  .topbar-divider {
    display: none;
  }

  .topbar-period {
    width: 100%;
  }

  .hero-copy,
  .sales-copy {
    font-size: 14px;
    line-height: 1.55;
  }

  .hero-badge {
    width: 100%;
    min-width: 0;
    padding: 18px;
  }

  .hero-badge strong {
    font-size: 34px;
  }

  .panel,
  .kpi-card {
    padding: 18px;
  }

  .toolbar-panel {
    padding: 16px;
  }

  .toolbar-cluster,
  .sales-filter-grid {
    gap: 10px;
  }

  .toolbar-group {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .filter-label {
    font-size: 13px;
  }

  .month-filter {
    min-width: 0;
    padding: 11px 12px;
  }

  .kpi-value {
    font-size: clamp(24px, 7vw, 34px);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .kpi-change {
    font-size: 12px;
  }

  .channel-head,
  .channel-metrics,
  .sales-status-head {
    flex-direction: column;
    align-items: start;
  }

  .chart-shell {
    padding: 12px;
    border-radius: 18px;
  }

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

  .chart-legend span {
    width: 100%;
    justify-content: center;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 640px;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 13px;
  }

  .insight-list li,
  .action-list li {
    padding: 14px;
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  body::before {
    background-size: 28px 28px;
  }

  .shell {
    padding: 10px;
    gap: 10px;
  }

  .sidebar,
  .panel,
  .hero,
  .kpi-card {
    border-radius: 18px;
  }

  .hero {
    padding: 18px;
    gap: 18px;
  }

  .hero h2 {
    font-size: 27px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .brand-logo {
    max-width: 150px;
  }

  .topbar-meta,
  .language-toggle {
    min-height: 44px;
  }

  .hero-badge strong {
    font-size: 30px;
  }

  .panel-head {
    margin-bottom: 14px;
  }

  .sales-filter-grid {
    grid-template-columns: 1fr;
  }

  .chart-legend {
    grid-template-columns: 1fr;
  }
}
