:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --brand: #f97316;
  --brand-strong: #ea580c;
  --accent: #1f2a6c;
  --border: #e2e8f0;
  --shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --sidebar-expanded: 260px;
  --sidebar-collapsed: 76px;
  --sidebar-current: var(--sidebar-expanded);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
   --sidebar-current: var(--sidebar-expanded);
}

body.blocked {
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7dd3fc; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  padding: 32px;
}

.auth-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  color: #0f172a;
}

.auth-card {
  margin: auto;
  max-width: 520px;
  padding: 40px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card-wide {
  width: 100%;
}

.hero-panel {
  padding: 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.hero-title {
  font-size: 38px;
  line-height: 1.2;
  color: #0f172a;
  margin-top: 16px;
  margin-bottom: 12px;
}

.hero-sub {
  color: #334155;
  font-size: 16px;
  margin-bottom: 16px;
}

.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  color: #334155;
}

.hero-bullets li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
}

.hero-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.hero-cards {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.feature-pill {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: #1f2937;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.badge-soft {
  background: rgba(31, 94, 255, 0.12);
  color: #1f5eff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.social-proof {
  color: #475569;
  font-size: 14px;
}

.hero-visual {
  background: linear-gradient(135deg, rgba(31, 94, 255, 0.1), rgba(14, 165, 233, 0.12));
  border-radius: 24px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.visual-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.visual-header {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.visual-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.visual-chart .bar {
  background: linear-gradient(180deg, rgba(31, 94, 255, 0.8), rgba(31, 94, 255, 0.2));
  border-radius: 10px;
}

.visual-row, .visual-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px;
}

.auth-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: #64748b;
}

.auth-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow);
}

.input-group {
  align-items: stretch;
  gap: 10px;
}

.input-group-text {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}

.btn-loading {
  opacity: 0.8;
  pointer-events: none;
}

.auth-left-blue {
  padding: 48px 40px;
  border-radius: 24px;
  background: linear-gradient(135deg, #2f80ed, #2563eb);
  color: #f8fafc;
  box-shadow: var(--shadow);
}

.auth-left-blue .brand-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #f8fafc;
}

.auth-left-blue .hero-title,
.auth-left-blue .hero-sub,
.auth-left-blue .small,
.auth-left-blue .feature-line,
.auth-left-blue .badge-soft {
  color: #f8fafc;
}

.auth-left-blue .hero-sub {
  opacity: 0.85;
}

.hero-feature-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.feature-line {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-card-white {
  background: #ffffff;
  border-radius: 20px;
}

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #cfeaff 0%, #c8ccff 100%);
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  position: relative;
  overflow: hidden;
}

.login-body::before,
.login-body::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(20px);
  z-index: 0;
}

.login-body::before {
  top: -120px;
  left: -120px;
}

.login-body::after {
  bottom: -140px;
  right: -120px;
}

.login-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px 20px;
}

.login-card {
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  z-index: 999;
}

.login-card-blue {
  width: 420px;
  min-height: 420px;
  padding: 42px 40px 32px;
  background: linear-gradient(135deg, #2c92d8 0%, #4aa9ff 100%);
  color: #fff;
  position: relative;
  z-index: 2;
}

.login-card-blue::before,
.login-card-blue::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.login-card-blue::before {
  width: 220px;
  height: 220px;
  top: -40px;
  right: -40px;
}

.login-card-blue::after {
  width: 160px;
  height: 160px;
  bottom: 40px;
  left: 30px;
}

.login-card-white {
  width: 420px;
  min-height: 440px;
  padding: 48px 46px;
  background: #ffffff;
  position: relative;
  z-index: 1;
  margin-left: -120px;
}

.login-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 36px;
}

.login-copy h1 {
  font-size: 36px;
  margin-bottom: 12px;
  font-weight: 700;
}

.login-copy h1 span {
  font-weight: 600;
  display: block;
}

.login-kicker {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.login-text {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 280px;
}

.login-outline {
  margin-top: 28px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.login-dots {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 28px;
  left: 40px;
}

.login-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.login-dots .dot.active {
  background: #ffffff;
}

.login-card-white h2 {
  color: #2b6cd9;
  font-weight: 700;
  margin-bottom: 10px;
}

.login-muted {
  color: #9aa5b1;
  margin-bottom: 26px;
}

.login-label {
  font-size: 12px;
  letter-spacing: 1px;
  color: #7f8ea3;
  margin-bottom: 8px;
  display: block;
}

.login-input {
  position: relative;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px 12px 26px;
  margin-bottom: 20px;
  border: 1px solid #eef1f6;
}

.login-input input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: #334155;
}

.login-input input:focus {
  outline: none;
}

.login-input .accent-bar {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 3px;
  height: 24px;
  background: linear-gradient(180deg, #6b5dff, #38bdf8);
  border-radius: 999px;
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-link {
  font-size: 12px;
  color: #9aa5b1;
  text-decoration: none;
}

.login-keep {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #7f8ea3;
  margin-bottom: 20px;
}

.login-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #6a5cff 0%, #30b3ff 100%);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.login-footer {
  font-size: 13px;
  color: #7f8ea3;
  text-align: center;
}

.login-footer a {
  color: #2b6cd9;
  text-decoration: none;
}

@media (max-width: 1400px) {
  :root {
    --sidebar-expanded: 240px;
  }

  body {
    --sidebar-current: var(--sidebar-expanded);
  }

  .main {
    padding: 24px;
  }

  .topbar {
    padding: 0 24px;
  }

  .topbar-search input {
    min-width: 200px;
  }

  .editor-body {
    max-width: 100%;
    padding: 28px 32px;
  }
}

@media (max-width: 992px) {
  .login-stage {
    flex-direction: column;
  }

  .login-card-white {
    margin-left: 0;
  }
}

.auth-network {
  min-height: 100vh;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}

.network-shell {
  width: min(980px, 100%);
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  overflow: hidden;
  border: 4px solid #1f2a6c;
  position: relative;
}

.network-shell::after {
  content: '';
  position: absolute;
  top: -4px;
  right: 30%;
  width: 6px;
  height: 40px;
  background: #f97316;
  border-radius: 999px;
}

.network-left {
  padding: 40px 36px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.network-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #1f2a6c;
  font-size: 20px;
}

.network-brand img {
  width: 28px;
  height: 28px;
  display: block;
}

.network-bars {
  display: inline-flex;
  gap: 3px;
}

.network-bars span {
  width: 4px;
  height: 18px;
  border-radius: 8px;
  background: #f97316;
}

.network-bars span:nth-child(2) {
  height: 24px;
  background: #3b82f6;
}

.network-bars span:nth-child(3) {
  height: 14px;
}

.network-sub {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 10px;
}

.network-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.network-field input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: #1f2937;
}

.network-field input:focus {
  outline: none;
}

.network-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f97316;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.network-row {
  display: flex;
  justify-content: flex-end;
}

.network-link {
  font-size: 12px;
  color: #7c879b;
  text-decoration: none;
}

.network-primary {
  background: #f97316;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  width: 100%;
}

.network-divider {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  position: relative;
  margin: 6px 0;
}

.network-divider::before,
.network-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: #e2e8f0;
}

.network-divider::before {
  left: 0;
}

.network-divider::after {
  right: 0;
}

.network-secondary {
  background: #ffffff;
  color: #f97316;
  border: 1px solid #f97316;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  width: 100%;
}

.network-right {
  background: #f5f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.network-illustration {
  width: min(360px, 100%);
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 24px;
  position: relative;
  box-shadow: inset 0 0 0 2px #e2e8f0;
}

.network-illustration::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.12);
  top: 18%;
  left: 10%;
}

.network-illustration::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  bottom: 18%;
  right: 18%;
}

.phone-card {
  position: absolute;
  inset: 15% 20%;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone-card .pill {
  width: 60%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
}

.phone-card .cta {
  margin-top: 10px;
  background: #f97316;
  color: #ffffff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .network-shell {
    grid-template-columns: 1fr;
  }

  .network-right {
    display: none;
  }
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 600;
}

.brand-pill img {
  width: 150px;
  display: block;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-expanded);
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, width 0.2s ease, box-shadow 0.2s ease;
  z-index: 950;
  box-shadow: 6px 0 20px rgba(15, 23, 42, 0.05);
  outline: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #1f2937;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(31, 94, 255, 0.08);
  color: #0f172a;
  transform: translateX(4px);
}

.nav-link::before {
  content: '•';
  font-size: 12px;
  color: #1f2a6c;
  display: inline-flex;
  width: 12px;
  justify-content: center;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: opacity 0.18s ease, width 0.18s ease;
}

.nav-link::before {
  content: '' !important;
  display: none !important;
}

.main {
  margin-left: var(--sidebar-current);
  padding: 32px;
  transition: margin-left 0.2s ease;
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-current);
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 900;
  backdrop-filter: blur(10px);
  transition: left 0.2s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-search input {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 240px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

body:not([data-area="admin"]) .main {
  padding-top: 96px;
}

body.sidebar-collapsed {
  --sidebar-current: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .brand-logo {
  display: none;
}

body.sidebar-collapsed .brand-mini {
  display: inline-flex;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
}

body.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed);
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 940;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.card-neo {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border-radius: 14px;
  background: #f8faff;
  border: 1px solid var(--border);
}

.editor-shell {
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  overflow: visible;
  background: #f8fafc;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.editor-toolbar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
  background: #f8fafc;
  pointer-events: auto;
}

.editor-toolbar-main {
  background: linear-gradient(180deg, #e2e8f0 0%, #f8fafc 60%);
}

.editor-toolbar-format {
  position: relative;
  z-index: 60;
  background: #f3f4f6;
  border-top: 1px solid #e2e8f0;
  pointer-events: auto;
}

.editor-toolbar-format .editor-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  margin-right: 8px;
  border-right: 1px solid #d8e0ea;
  pointer-events: auto;
}

.editor-toolbar-format .editor-group:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.editor-toolbar-format .btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  pointer-events: auto;
}

.editor-toolbar-format .btn:hover {
  background: #e2e8f0;
}

.nav-icon {
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: inherit;
}

.nav-label {
  white-space: nowrap;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.brand-logo {
  display: block;
  max-width: 180px;
}

.brand-mini {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

.editor-toolbar-format .form-select {
  height: 28px;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 70;
}

.text-underline {
  text-decoration: underline;
}

.text-strike {
  text-decoration: line-through;
}

.editor-body {
  min-height: 520px;
  max-width: 860px;
  margin: 20px auto;
  padding: 32px 44px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  font-family: 'Source Sans 3', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.voice-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f5f8ff;
}

.voice-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.dot.active {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f6fb;
  color: #0f172a;
}

.muted { color: var(--muted); }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 10px;
}

#toastContainer {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  background: #1f2937;
  color: #e2e8f0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-bubble.hide {
  opacity: 0;
  transform: translateY(-6px);
}

.toast-success { border-color: rgba(34, 197, 94, 0.5); }
.toast-error { border-color: rgba(239, 68, 68, 0.6); }

.access-gate,
.trial-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 1500;
  padding: 20px;
}

.access-card,
.trial-card {
  max-width: 520px;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border: none;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(31, 94, 255, 0.25);
}

.btn-brand:hover {
  background: linear-gradient(135deg, var(--brand-strong), #173fb0);
  color: #fff;
}

.btn-outline-light {
  color: #1f2937;
  border-color: #cbd5e1;
  background: #ffffff;
}

.btn-outline-light:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-outline-info,
.btn-outline-success {
  color: #1f2937;
  border-color: #cbd5e1;
  background: #ffffff;
}

.btn-outline-info:hover,
.btn-outline-success:hover {
  background: #eef2ff;
  color: #0f172a;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.status-draft { background: rgba(31, 94, 255, 0.12); color: #1f5eff; }
.status-finalized { background: rgba(34, 197, 94, 0.12); color: #15803d; }

.marketing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
}

.marketing-hero {
  padding: 64px 48px;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  height: 140px;
}

.chart-bar {
  background: linear-gradient(180deg, rgba(31, 94, 255, 0.8), rgba(31, 94, 255, 0.2));
  border-radius: 10px;
}

/* =========================
   SIDEBAR (FINAL / CORRIGIDA)
   ========================= */
:root{
  --sidebar-expanded: 260px;
  --sidebar-collapsed: 76px;
  --sidebar-current: var(--sidebar-expanded);
}

/* Estado normal: expandida */
body{
  --sidebar-current: var(--sidebar-expanded);
}

/* Layout principal acompanha sidebar */
.main{
  margin-left: var(--sidebar-current);
  transition: margin-left .2s ease;
}

.topbar{
  left: var(--sidebar-current);
  transition: left .2s ease;
}

/* Sidebar base */
.sidebar{
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-expanded);
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 950;
  box-shadow: 6px 0 20px rgba(15, 23, 42, 0.05);
  transition: width .2s ease, transform .2s ease, box-shadow .2s ease;
}

/* Links */
.nav-link{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #1f2937;
  transition: background .2s ease, transform .2s ease, color .2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active{
  background: rgba(31, 94, 255, 0.08);
  color: #0f172a;
  transform: translateX(4px);
}

.nav-icon{
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: inherit;
}

.nav-label{
  white-space: nowrap;
  transition: opacity .18s ease, width .18s ease;
}

/* Marca */
.brand-logo{ display:block; max-width:180px; }
.brand-mini{
  display:none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

/* =========================
   COLLAPSE (DESKTOP)
   ========================= */
body.sidebar-collapsed{
  --sidebar-current: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar{
  width: var(--sidebar-collapsed);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
}

body.sidebar-collapsed .nav-label{
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .brand-logo{ display:none; }
body.sidebar-collapsed .brand-mini{ display:inline-flex; }
body.sidebar-collapsed .nav-link{ justify-content:center; }

/* Tooltip s? no desktop quando colapsado */
body.sidebar-collapsed .nav-link::after{
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  background: #0f172a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  transition: opacity .15s ease, transform .15s ease;
  white-space: nowrap;
  z-index: 960;
}

body.sidebar-collapsed .nav-link:hover::after{
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* =========================
   OVERLAY (MOBILE/TABLET)
   - breakpoint real: 992px
   - no mobile N?O existe collapsed (s? open/closed)
   ========================= */
.sidebar-overlay{
  display:none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 940;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

@media (max-width: 992px){
  /* O conte?do N?O desloca no mobile */
  body{
    --sidebar-current: 0px;
  }

  .main{ margin-left: 0; }
  .topbar{ left: 0; }

  /* Sidebar vira drawer */
  .sidebar{
    transform: translateX(-100%);
    width: var(--sidebar-expanded);
    box-shadow: 14px 0 30px rgba(15, 23, 42, 0.18);
  }

  /* Abre/fecha no mobile */
  body.sidebar-open .sidebar{
    transform: translateX(0);
  }

  /* Overlay */
  .sidebar-overlay{
    display:block;
  }

  body.sidebar-open .sidebar-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* IMPORTANTE: no mobile n?o colapsa nunca */
  body.sidebar-collapsed{
    --sidebar-current: 0px;
  }

  body.sidebar-collapsed .sidebar{
    width: var(--sidebar-expanded);
  }

  body.sidebar-collapsed .nav-label{
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }

  body.sidebar-collapsed .brand-logo{ display:block; }
  body.sidebar-collapsed .brand-mini{ display:none; }

  /* Tooltip n?o precisa no touch */
  body.sidebar-collapsed .nav-link::after{ display:none; }
}

@media (max-width: 768px){
  .topbar{
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-left{
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-search{
    width: 100%;
    flex: 1 1 100%;
  }

  .topbar-search input{
    width: 100%;
    min-width: 0;
  }

  .topbar-right{
    width: 100%;
    justify-content: flex-start;
  }

  body:not([data-area="admin"]) .main{
    padding-top: 140px;
  }

  .dashboard-hero{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-hero .pill{
    width: 100%;
    justify-content: space-between;
  }

  .voice-widget{
    flex-direction: column;
    align-items: flex-start;
  }

  .voice-widget .d-flex{
    width: 100%;
    flex-wrap: wrap;
  }

  .voice-widget .btn{
    flex: 1 1 100%;
  }

  .main{
    padding: 20px;
  }

  .card-neo,
  .metric-card{
    padding: 16px;
  }

  .list-item{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .list-item .d-flex{
    width: 100%;
    flex-wrap: wrap;
  }

  .list-item .btn,
  .list-item .status-badge{
    width: 100%;
    text-align: center;
  }

  .list-item .badge{
    width: 100%;
    text-align: center;
  }
}
