:root {
  /* Акценты бренда — без изменений */
  --teal: #22B8A0;
  --indigo: #6E5BFF;
  --coral: #F26B5B;
  --amber: #F59E0B;

  /* Тёмно-синяя база (связана с --navy #1A1D3B на лендинге, но глубже) */
  --bg: #0A0F1E;
  --bg-sidebar: #0E1528;
  --surface: #141C32;
  --surface-hover: #1A2440;
  --surface-raised: #1E2947;

  /* Алиас для карточек и блоков */
  --white: var(--surface);

  /* Текст на тёмном */
  --text: #E8EDF7;
  --text-2: #96A8C6;
  --text-3: #5C7090;

  /* Акцентные подложки (tint на тёмном) */
  --teal-light: rgba(34, 184, 160, 0.16);
  --teal-dark: #3DD4BF;
  --indigo-light: rgba(110, 91, 255, 0.22);
  --coral-light: rgba(242, 107, 91, 0.18);
  --amber-light: rgba(245, 158, 11, 0.18);

  --border: rgba(110, 91, 255, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glow-indigo: 0 0 24px rgba(110, 91, 255, 0.12);
  --r: 16px;
  --sidebar-w: 226px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(110, 91, 255, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(34, 184, 160, 0.06) 0%, transparent 50%),
    linear-gradient(165deg, #0A0F1E 0%, #0D1528 50%, #0A1020 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

.layout {
  display: flex;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-text .l1,
.logo-text .l2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.logo-text .l1 {
  color: var(--text);
}

.logo-text .l2 {
  color: var(--teal);
}

.logo-sub {
  font-size: 9px;
  color: var(--text-3);
  margin-top: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 18px 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.12s;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--indigo-light);
  color: #B8AEFF;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: var(--indigo);
  border-radius: 0 3px 3px 0;
}

.nav-item--disabled {
  cursor: default;
  opacity: 0.72;
}

.nav-item--disabled:hover {
  background: transparent;
  color: var(--text-2);
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: auto;
  font-weight: 700;
  flex-shrink: 0;
}

.b-mvp {
  background: var(--teal-light);
  color: var(--teal);
}

.b-2 {
  background: var(--amber-light);
  color: #FBBF24;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-footer-note {
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 8px;
  text-align: center;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 26px 30px;
  min-height: 100vh;
  max-width: calc(100vw - var(--sidebar-w));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.breadcrumb {
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 3px;
}

.page-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--teal);
  background: var(--surface-raised);
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.placeholder-soon {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow), var(--glow-indigo);
  padding: 64px 32px;
  text-align: center;
}

.placeholder-soon-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.placeholder-soon-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.placeholder-soon-text {
  font-size: 13px;
  color: var(--text-3);
  max-width: 420px;
  margin: 0 auto;
}

.placeholder-soon-badge {
  display: inline-block;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--amber-light);
  color: #FBBF24;
}

.btn {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: 'Manrope', sans-serif;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: rgba(110, 91, 255, 0.35);
  color: var(--text);
}

@media (max-width: 900px) {
  .sidebar {
    width: 200px;
  }

  .main {
    margin-left: 200px;
    padding: 20px 16px;
  }

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

  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Dashboard */
@keyframes live-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.live-ind {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--teal);
  font-weight: 700;
}

.live-d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: live-blink 1.4s ease-in-out infinite;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

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

.metric-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.metric-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
}

.metric-value.teal {
  color: var(--teal);
}

.metric-value.indigo {
  color: var(--indigo);
}

.metric-value.coral {
  color: var(--coral);
}

.metric-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}

.card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.cdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cdot-teal {
  background: var(--teal);
}

.cdot-coral {
  background: var(--coral);
}

.cdot-indigo {
  background: var(--indigo);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.phase-chip {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
  background: var(--amber-light);
  color: #fbbf24;
}

.questions-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--coral);
  font-weight: 700;
}

.card-footnote {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-3);
}

.dashboard-empty {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  padding: 8px 0;
}

.funnel-item {
  margin-bottom: 11px;
}

.funnel-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.funnel-name {
  font-size: 12px;
  color: var(--text-2);
}

.funnel-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.funnel-bg {
  height: 8px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.35s ease;
}

.f-teal {
  background: linear-gradient(90deg, var(--teal), #5ddfc9);
}

.f-indigo {
  background: linear-gradient(90deg, var(--indigo), #9b8fff);
}

.f-coral {
  background: linear-gradient(90deg, var(--coral), #ff8a7d);
}

.f-amber {
  background: linear-gradient(90deg, var(--amber), #fbbf24);
}

.q-dash {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--bg);
}

.q-dash-meta {
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.q-dash-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.dashboard-loading .metric-value,
.dashboard-loading #dashboardFunnel,
.dashboard-loading #dashboardQuestions {
  opacity: 0.55;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo), #8b7bff);
  color: #fff;
  border: 1px solid rgba(110, 91, 255, 0.5);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.tab {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-2);
  background: var(--surface-hover);
}

.tab.active {
  background: var(--indigo-light);
  color: var(--text);
}

.payments-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.payments-period-label {
  font-size: 12px;
  color: var(--text-3);
}

.payments-period-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
}

.payments-import-status {
  font-size: 12px;
  color: var(--teal);
  margin-left: auto;
}

.payments-import-status.is-error {
  color: var(--coral);
}

.analytic-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.an-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.an-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.an-label {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.an-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.an-val-teal {
  color: var(--teal);
}

.an-val-indigo {
  color: var(--indigo);
}

.an-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
}

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

.card-table .card-title {
  padding: 16px 18px 0;
}

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

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

.data-table th {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  vertical-align: middle;
}

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

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

.table-empty {
  text-align: center;
  color: var(--text-3);
  padding: 28px 12px !important;
}

.mono-sm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

.user-contact {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 1px;
}

.tag-chip {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-block;
}

.tag-m {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.tag-y {
  background: var(--indigo-light);
  color: var(--indigo);
}

.tag-ch {
  background: var(--amber-light);
  color: #fbbf24;
}

.ltv-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--indigo);
  font-weight: 500;
}

.pay-status {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.s-paid {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.s-pending {
  background: var(--amber-light);
  color: #fbbf24;
}

.s-refund {
  background: var(--indigo-light);
  color: #a5b4fc;
}

.s-cancel {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.receipt-ok {
  font-size: 12px;
  color: var(--teal);
  font-weight: 700;
}

.receipt-empty {
  color: var(--text-3);
}

.payments-loading .an-val,
.payments-loading #paymentsTableBody {
  opacity: 0.55;
}

@media (max-width: 1100px) {
  .analytic-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .header-right {
    flex-wrap: wrap;
  }
}
