@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #080c14;
  --bg-card: #131e36;
  --bg-card-inner: #0f172a;
  --bg-card-hover: #172442;
  --bg-input: #090e1a;
  --border-color: #1e2e50;
  --border-glow: rgba(99, 102, 241, 0.35);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --purple-glow: rgba(139, 92, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --success: #10b981;
  --warning: #fbbf24;
  --danger: #ef4444;
  --info: #38bdf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============================================================
   SIDEBAR CLIENT AREA
============================================================ */
.sidebar {
  width: 240px;
  background: #080d19;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 16px;
  min-height: 100vh;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 0 8px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--primary-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.brand-text span {
  font-size: 10px;
  color: var(--text-muted);
}

.mobile-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding: 6px;
  border-radius: 6px;
}

.mobile-sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateX(3px);
  border-color: rgba(99, 102, 241, 0.2);
}

.nav-item.active {
  background: #18223c;
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.sidebar-ai-box {
  background: linear-gradient(145deg, #131b31 0%, #0d1322 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin-top: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sidebar-ai-box .ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #c7d2fe;
  margin-bottom: 6px;
}

.sidebar-ai-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

/* ============================================================
   MAIN WRAPPER & TOP HEADER BAR
============================================================ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 28px;
  gap: 20px;
}

.top-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-left-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.mobile-menu-toggle {
  display: none;
  background: #131e36;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 18px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-menu-toggle:hover {
  background: #1e2e50;
  color: #38bdf8;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: #131e36;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 14px;
  height: 40px;
  flex: 1;
  max-width: 440px;
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-input-wrap .search-icon {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 8px;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 12px;
  width: 100%;
}

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

.btn-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #131e36;
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 14px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header-pill:hover {
  background: #1e293b;
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.btn-header-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 16px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-header-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-icon-pill {
  position: relative;
  background: #131e36;
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-size: 14px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-pill:hover {
  background: #1e293b;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
}

.btn-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #131e36;
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 8px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-user-profile:hover {
  background: #1e293b;
  border-color: rgba(99, 102, 241, 0.4);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.user-plan {
  font-size: 9px;
  color: var(--text-muted);
}

/* ============================================================
   2. WELCOME BANNER & COPILOT
============================================================ */
.welcome-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.welcome-text-box .realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.pulsing-dot {
  font-size: 8px;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.welcome-text-box h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.welcome-text-box p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.copilot-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #181e36;
  border: 1px solid #2b2d5c;
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.2s;
}

.copilot-card:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-2px);
}

.copilot-title {
  font-size: 12px;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-info p {
  font-size: 10px;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.3;
}

.btn-copilot {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copilot:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   3. TOP 5 KPI CARDS
============================================================ */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-stat-card {
  background: #131e36;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 14px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.kpi-stat-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.kpi-icon-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-card-body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.kpi-value.highlight-green {
  color: #10b981;
}

.kpi-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-green {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.kpi-sub-leads {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
}

.kpi-sparkline-wrap {
  width: 100%;
  height: 24px;
  margin-top: 4px;
}

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

/* ============================================================
   4. MIDDLE ROW: FUNIL + RECEITA & ROI
============================================================ */
.middle-dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
}

.dash-panel-card {
  background: #131e36;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
}

.dash-panel-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-link {
  font-size: 11px;
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.panel-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Funil Content Layout */
.funil-content-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.funil-stages-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.funil-stage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
}

.stage-label {
  font-size: 11px;
  color: #cbd5e1;
  width: 135px;
  flex-shrink: 0;
  white-space: nowrap;
}

.stage-bar-track {
  flex: 1;
  background: #0d1627;
  height: 22px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.stage-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  transition: width 0.6s ease;
}

.stage-bar-value {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.stage-fill-1 { background: linear-gradient(90deg, #4f46e5, #6366f1); }
.stage-fill-2 { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.stage-fill-3 { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.stage-fill-4 { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stage-fill-5 { background: linear-gradient(90deg, #059669, #10b981); }

.funil-sub-cards {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-card-box {
  background: #0d1627;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-card-title {
  font-size: 10px;
  color: var(--text-muted);
}

.sub-card-val-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-card-number {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
}

.sub-card-footnote {
  font-size: 9px;
  color: var(--text-dim);
}

.ai-tip-box {
  background: #1e1b4b;
  border-color: #3730a3;
}

.ai-tip-header {
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-tip-text {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.35;
}

.btn-ai-suggestions {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}

.btn-ai-suggestions:hover {
  background: var(--primary-hover);
}

/* Receita & ROI Panel */
.roi-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roi-label {
  font-size: 10px;
  color: var(--text-muted);
}

.roi-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.roi-big-value {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

.sales-count-pill {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
}

/* Chart */
.revenue-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
  background: #0d1627;
  border: 1px solid #1e2e50;
  border-radius: 8px;
  padding: 10px 14px 6px 10px;
  position: relative;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  font-size: 8px;
  color: var(--text-dim);
  padding-bottom: 18px;
}

.chart-bars-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  gap: 8px;
}

.bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  flex: 1;
  position: relative;
}

.bar-fill {
  width: 18px;
  border-radius: 3px 3px 0 0;
  background: #6366f1;
  transition: height 0.5s ease;
}

.bar-column.active .bar-fill {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.bar-label {
  font-size: 9px;
  color: var(--text-muted);
}

.bar-tooltip {
  position: absolute;
  top: 0;
  background: #0f172a;
  border: 1px solid #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.roi-footer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-pill-box {
  background: #0d1627;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pill-label {
  font-size: 9px;
  color: var(--text-muted);
}

.pill-value {
  font-size: 13px;
  font-weight: 700;
}

.val-green { color: #10b981; }
.val-blue { color: #38bdf8; }

/* ============================================================
   5. BOTTOM ROW (3 CARDS)
============================================================ */
.bottom-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Activities list */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(30, 46, 80, 0.5);
  font-size: 11px;
}

.activity-icon {
  font-size: 14px;
  width: 22px;
  text-align: center;
}

.activity-desc {
  flex: 1;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Campaigns list */
.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campaign-mini-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.c-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.c-mini-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
}

.c-mini-status {
  font-size: 9px;
  font-weight: 700;
}

.c-mini-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
}

.c-mini-leads {
  color: var(--text-muted);
}

.c-mini-conv {
  color: #38bdf8;
  font-weight: 700;
}

/* Segments list */
.segments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.segment-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.seg-name {
  color: #cbd5e1;
}

.seg-badge {
  font-weight: 700;
}

.seg-bar-track {
  background: #0f172a;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.seg-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ============================================================
   MODAIS
============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(6px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  gap: 12px;
  background: #131e36;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 11px;
}

.suggestion-item strong {
  display: block;
  color: #fff;
  margin-bottom: 2px;
}

.suggestion-item p {
  color: var(--text-muted);
  line-height: 1.35;
}

.suggestion-item .sug-icon {
  font-size: 18px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-close {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* ============================================================
   RESPONSIVIDADE MULTI-DISPOSITIVO
============================================================ */
/* 1. Laptops e Telas Médias (<= 1200px) */
@media (max-width: 1200px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .middle-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .bottom-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* 2. Tablets (<= 1024px) - Ativação do Drawer Lateral */
@media (max-width: 1024px) {
  body {
    flex-direction: column;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100vh;
    box-shadow: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 16px 0 50px rgba(0, 0, 0, 0.85);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .main-wrapper {
    padding: 16px 16px;
  }

  .top-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .header-left-actions {
    width: 100%;
    max-width: 100%;
  }

  .search-input-wrap {
    max-width: 100%;
  }

  .header-right-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .funil-content-layout {
    flex-direction: column;
  }

  .funil-sub-cards {
    width: 100%;
    flex-direction: row;
  }

  .funil-sub-cards .sub-card-box {
    flex: 1;
  }
}

/* 3. Tablets Retrato (<= 768px) */
@media (max-width: 768px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom-dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .copilot-card {
    width: 100%;
    justify-content: space-between;
  }

  .funil-sub-cards {
    flex-direction: column;
  }
}

/* 4. Smartphones (<= 520px) */
@media (max-width: 520px) {
  .main-wrapper {
    padding: 12px 10px;
    gap: 14px;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr;
  }

  .welcome-text-box h1 {
    font-size: 18px;
  }

  .header-right-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right-actions button {
    width: 100%;
    justify-content: center;
  }

  .funil-stage-row {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 4px;
    margin-bottom: 6px;
  }

  .stage-label {
    width: 100%;
    font-size: 10px;
  }

  .stage-bar-track {
    width: 100%;
  }

  .roi-footer-stats {
    grid-template-columns: 1fr;
  }
}
