@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap');

:root {
  --bg: #060b16;
  --surface: #0f1729;
  --surface-2: #111d34;
  --dark: #060b16;
  --dark-2: #0b1427;
  --dark-3: #101d35;
  --primary: #2f6bff;
  --primary-h: #4a85ff;
  --primary-dim: rgba(47, 107, 255, 0.2);
  --primary-bg: rgba(47, 107, 255, 0.16);
  --green: #2dc08d;
  --green-bg: rgba(45, 192, 141, 0.16);
  --red: #ff6b7a;
  --red-bg: rgba(255, 107, 122, 0.16);
  --amber: #ffb25d;
  --amber-bg: rgba(255, 178, 93, 0.16);
  --text: #e6edf8;
  --text-2: #c4d2ea;
  --muted: #96a8c9;
  --muted-lt: #8196bc;
  --border: rgba(141, 163, 199, 0.22);
  --border-dk: rgba(141, 163, 199, 0.32);
  --fb: 'Manrope', system-ui, -apple-system, sans-serif;
  --fd: 'Sora', 'Manrope', system-ui, -apple-system, sans-serif;
  --sh-xs: 0 1px 2px rgba(2, 6, 23, 0.5);
  --sh-sm: 0 6px 18px rgba(2, 6, 23, 0.36);
  --sh-md: 0 16px 34px rgba(2, 6, 23, 0.4);
  --sh-lg: 0 28px 64px rgba(2, 6, 23, 0.46);
}

html,
body {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(47, 107, 255, 0.24), transparent 66%),
    radial-gradient(760px 460px at 96% 8%, rgba(45, 192, 141, 0.13), transparent 64%),
    linear-gradient(180deg, #060b16 0%, #060b16 100%);
  color: var(--text);
  font-family: var(--fb);
}

a,
.nav-link,
.btn,
input,
select,
textarea,
.topbar,
.sidebar,
.main,
.main-shell,
.page,
.card,
.panel,
.table-card,
.filter-card,
.hero-card,
.hero-title,
.pg-title,
.h2,
.h1 {
  font-family: var(--fb);
}

.logo-name,
.hero-title,
.pg-title,
.h1,
.h2,
.stat-v,
.kpi-value,
.status-value {
  font-family: var(--fd);
}

.topbar,
.sidebar,
.main-shell,
.main,
.card,
.panel,
.table-card,
.filter-card,
.stats-bar .stat-card,
.offer-overview,
.offer-card,
.lp-card,
.profile-card,
.meta-card,
.plan-card,
.data-table,
.field,
.dlg,
.import-dialog__box,
.mapping-card,
.modal,
.customer-page,
.content-grid .card,
.dashboard-stack .dash-card {
  background: linear-gradient(165deg, rgba(15, 23, 41, 0.96), rgba(11, 20, 39, 0.96));
  border-color: var(--border) !important;
  box-shadow: var(--sh-sm) !important;
  color: var(--text);
}

.topbar,
.sidebar,
.nav-link,
.btn,
.search-input,
.styled-select,
.field-input,
input,
select,
textarea,
.toast,
.badge,
.pill,
.plan-badge {
  backdrop-filter: blur(10px);
}

.topbar {
  background: rgba(10, 17, 33, 0.88) !important;
  border-bottom: 1px solid var(--border) !important;
}

.sidebar {
  background: rgba(8, 15, 30, 0.92) !important;
  border-right: 1px solid var(--border) !important;
}

.nav-link {
  color: var(--muted) !important;
}

.nav-link:hover {
  color: var(--text) !important;
  background: rgba(47, 107, 255, 0.12) !important;
}

.nav-link.active {
  color: #dbe7ff !important;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.28), rgba(74, 133, 255, 0.16)) !important;
  border: 1px solid rgba(110, 153, 255, 0.34);
}

.nav-count,
.badge,
.pill,
.offer-status,
.hero-pill,
.search-res-badge {
  border: 1px solid var(--border);
}

.btn,
.btn--ghost,
.btn--sm,
.link-btn {
  color: var(--text) !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
}

.btn:hover,
.btn--ghost:hover,
.btn--sm:hover {
  background: rgba(148, 163, 184, 0.14) !important;
}

.btn--primary,
.recover-btn,
.rbtn,
.lp-cta,
.upgrade-submit,
#upgrade-submit,
#kpi-upgrade-view-plans,
#lp-publish,
#lp-save,
#lp-copy-link,
.plan-btn,
.btn-primary {
  color: #fff !important;
  background: linear-gradient(135deg, #2f6bff 0%, #4a85ff 100%) !important;
  border: 1px solid rgba(120, 162, 255, 0.45) !important;
  box-shadow: 0 10px 22px rgba(47, 107, 255, 0.34) !important;
}

.btn--primary:hover,
.recover-btn:hover,
.rbtn:hover,
.lp-cta:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #3d77ff 0%, #5b93ff 100%) !important;
}

.btn--danger,
.btn--danger-solid,
#logout-button,
.topbar-logout-icon,
.sb-logout {
  color: #ffb4bf !important;
}

.search-input,
.styled-select,
.field-input,
input,
select,
textarea {
  background: rgba(7, 13, 27, 0.74) !important;
  color: var(--text) !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

input::placeholder,
textarea::placeholder,
.search-input::placeholder {
  color: var(--muted-lt) !important;
}

.search-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(92, 138, 255, 0.92) !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.2) !important;
}

.hero-card,
.hero,
.hero-card-bg-glow,
.hero-card::before,
.hero-card::after {
  background-color: transparent;
}

.hero-card {
  background:
    radial-gradient(520px 220px at 86% 10%, rgba(47, 107, 255, 0.33), transparent 68%),
    linear-gradient(128deg, rgba(7, 17, 34, 0.98), rgba(12, 26, 50, 0.96)) !important;
}

.hero-sub,
.page-note,
.pg-sub,
.meta,
.card-sub,
.dlg-sub,
.offer-card-sub,
.tbl-empty-sub,
.tbl-loading,
.field-hint,
.upgrade-note,
.upgrade-msg,
.search-res-meta,
.breadcrumb,
.topbar-breadcrumb,
.hero-stat-lbl {
  color: var(--muted) !important;
}

.page,
.main,
.main-shell {
  position: relative;
}

.page::before,
.main::before,
.main-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.2;
  z-index: -1;
}

.cust-tbl thead th,
.tbl thead th,
.table thead th {
  color: #d9e5fb !important;
  background: rgba(20, 35, 63, 0.86) !important;
}

.cust-tbl tbody td,
.tbl tbody td,
.table tbody td {
  color: #d0def7 !important;
  border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}

.row-muted,
.tbl-empty,
.tbl-empty-title,
.tbl-loading,
.hero-stat-lbl,
.stat-sub {
  color: var(--muted) !important;
}

.mobile-quick-nav .mq-link {
  background: rgba(8, 15, 30, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--muted);
}

.mobile-quick-nav .mq-link.active {
  background: rgba(47, 107, 255, 0.2);
  color: #e0eaff;
}

.toast,
.action-notice {
  background: rgba(7, 12, 25, 0.96) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

/* Offer template builder polish */
.lp-wrap {
  gap: 16px;
}

.lp-preview {
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.42) !important;
}

.lp-preview-shell {
  background: rgba(255, 255, 255, 0.94) !important;
}

/* Modern 3D KPI cards */
.kpi-grid {
  perspective: 1300px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: 16px !important;
}

.kpi-rev {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transform-style: preserve-3d;
  border-radius: 20px !important;
  padding: 20px 20px 16px !important;
  background:
    radial-gradient(140% 100% at 8% 0%, rgba(96, 165, 250, 0.22), transparent 45%),
    radial-gradient(120% 120% at 100% 100%, rgba(45, 192, 141, 0.12), transparent 58%),
    linear-gradient(158deg, rgba(17, 30, 54, 0.95), rgba(10, 20, 39, 0.96)) !important;
  border: 1px solid rgba(144, 170, 214, 0.25) !important;
  box-shadow:
    0 18px 34px rgba(2, 6, 23, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -1px 0 rgba(8, 15, 30, 0.72) inset !important;
  transition: transform 220ms cubic-bezier(.16,1,.3,1), box-shadow 220ms cubic-bezier(.16,1,.3,1);
}

.kpi-rev::after {
  content: "";
  position: absolute;
  inset: auto -32% -48% auto;
  width: 72%;
  height: 78%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  transform: rotate(15deg) translateZ(16px);
  opacity: 0.5;
}

.kpi-rev:hover {
  transform: translateY(-4px) rotateX(3deg);
  box-shadow:
    0 24px 44px rgba(2, 6, 23, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 -1px 0 rgba(8, 15, 30, 0.75) inset !important;
}

.kpi-rev::before {
  height: 5px !important;
  border-radius: 20px 20px 0 0 !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.36) !important;
}

.kpi-rev.r-risk::before { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.34) !important; }
.kpi-rev.r-recovered::before { box-shadow: 0 6px 20px rgba(16, 185, 129, 0.34) !important; }
.kpi-rev.r-health::before { box-shadow: 0 6px 20px rgba(245, 158, 11, 0.34) !important; }

.kpi-rev-lbl {
  color: #9eb0cf !important;
  letter-spacing: 0.08em !important;
}

.kpi-rev-ic {
  width: 38px !important;
  height: 38px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  box-shadow:
    0 10px 20px rgba(2, 6, 23, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.1) inset !important;
  transform: translateZ(16px);
}

.kpi-rev-ic svg {
  width: 16px !important;
  height: 16px !important;
}

.kpi-revenue-val {
  font-size: clamp(25px, 2.4vw, 32px) !important;
  color: #eef4ff !important;
  letter-spacing: -0.04em !important;
  text-shadow: 0 8px 20px rgba(2, 6, 23, 0.44) !important;
}

.r-risk .kpi-revenue-val { color: #ffc7ce !important; }
.r-recovered .kpi-revenue-val { color: #b8f7dc !important; }
.r-health .kpi-revenue-val { color: #ffd8a4 !important; }

.kpi-delta {
  margin-bottom: 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.kpi-rev-sep {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.42), rgba(148, 163, 184, 0.16)) !important;
}

.kpi-cta-row {
  align-items: center !important;
}

.kpi-cta-tag {
  border-radius: 999px !important;
  border: 1px solid rgba(148, 163, 184, 0.34) !important;
  backdrop-filter: blur(8px);
  font-size: 10.5px !important;
}

.kpi-roi-badge {
  top: 12px !important;
  right: 12px !important;
  font-size: 10px !important;
  padding: 4px 9px !important;
  box-shadow: 0 10px 18px rgba(4, 120, 87, 0.32) !important;
}

.kpi-value-area--locked > :not(.kpi-value-lock) {
  filter: blur(5.8px) saturate(0.9) contrast(0.9) !important;
}

.kpi-value-lock {
  border: 1px solid rgba(148, 163, 184, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 20px rgba(2, 6, 23, 0.35) !important;
}

.kpi-lock-chip {
  color: #dce7ff !important;
  border: 1px solid rgba(96, 165, 250, 0.36) !important;
  background: rgba(47, 107, 255, 0.2) !important;
}

/* WhatsApp automation card + queue (dark premium alignment) */
.wa-auto-card {
  background:
    radial-gradient(540px 220px at 92% -8%, rgba(47, 107, 255, 0.24), transparent 68%),
    linear-gradient(158deg, rgba(15, 26, 47, 0.96), rgba(10, 20, 37, 0.95)) !important;
  border: 1px solid rgba(141, 163, 199, 0.26) !important;
  box-shadow:
    0 16px 34px rgba(2, 6, 23, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.08) inset !important;
}

.wa-auto-card::before {
  background: linear-gradient(90deg, #3d77ff, #4a85ff) !important;
}

.wa-auto-title,
.wa-auto-switch-row {
  color: var(--text) !important;
}

.wa-auto-sub,
.wa-auto-meta,
.wa-auto-label {
  color: var(--muted) !important;
}

.wa-auto-mode {
  color: #cfe0ff !important;
  background: rgba(47, 107, 255, 0.2) !important;
  border-color: rgba(120, 162, 255, 0.38) !important;
}

.wa-auto-select,
.wa-auto-input,
.wa-auto-switch-row {
  background: rgba(7, 13, 27, 0.78) !important;
  border: 1px solid rgba(148, 163, 184, 0.32) !important;
  color: var(--text) !important;
}

.wa-auto-select:focus,
.wa-auto-input:focus {
  border-color: rgba(92, 138, 255, 0.92) !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.2) !important;
}

.wa-auto-meta {
  border-top-color: rgba(148, 163, 184, 0.22) !important;
}

.wa-auto-queue-badge {
  background: rgba(45, 192, 141, 0.16) !important;
  color: #9ff0d2 !important;
  border-color: rgba(45, 192, 141, 0.34) !important;
}

.wa-link-queue-dialog {
  background: linear-gradient(165deg, rgba(15, 23, 41, 0.98), rgba(11, 20, 39, 0.98)) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

.wa-link-queue-head,
.wa-link-queue-toolbar {
  border-bottom-color: rgba(148, 163, 184, 0.2) !important;
}

.wa-link-queue-title,
.wa-link-queue-name {
  color: var(--text) !important;
}

.wa-link-queue-sub,
.wa-link-queue-campaign,
.wa-link-queue-meta,
.wa-link-queue-link {
  color: var(--muted) !important;
}

.wa-link-queue-list {
  background: rgba(10, 18, 35, 0.68) !important;
}

.wa-link-queue-row {
  border-top-color: rgba(148, 163, 184, 0.18) !important;
}

.wa-link-queue-row.is-active {
  background: rgba(47, 107, 255, 0.18) !important;
}

.wa-link-queue-source {
  background: rgba(148, 163, 184, 0.14) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #c4d2ea !important;
}

/* Responsive improvements */
@media (max-width: 1200px) {
  .main,
  .main-shell,
  .page {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .hero-card,
  .hero,
  .profile-hero {
    padding: 20px !important;
  }
}

@media (max-width: 960px) {
  .kpi-grid,
  .stats-bar,
  .analytics-row,
  .content-grid,
  .dashboard-body,
  .profile-grid,
  .offer-grid,
  .plan-grid,
  .usecase-grid,
  .how-grid,
  .pricing-preview-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-right,
  .hero-actions,
  .pg-actions,
  .filter-right,
  .lp-actions,
  .offer-card-actions {
    width: 100%;
    justify-content: flex-start !important;
  }

  .hero-stat-val {
    font-size: 28px !important;
  }
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 12px !important;
    gap: 8px !important;
  }

  .main,
  .main-shell,
  .page {
    padding: 14px !important;
  }

  .hero-card,
  .card,
  .panel,
  .table-card,
  .filter-card,
  .lp-card,
  .offer-card,
  .profile-card,
  .meta-card {
    border-radius: 14px !important;
  }
}

@media (max-width: 640px) {
  .btn,
  .btn--ghost,
  .btn--primary,
  .recover-btn,
  .engage-btn,
  .rbtn,
  .lp-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-title,
  .pg-title,
  .h1,
  .h2 {
    font-size: clamp(22px, 7vw, 30px) !important;
    line-height: 1.2 !important;
  }

  .topbar-breadcrumb,
  .hero-meta,
  .hero-sub {
    font-size: 12px !important;
  }
}
