/* ═══════════════════════════════════════════════════════
   BOT ABORDAGEM — TEMA VERDE HyperCash
   Design System: Industrial-Organic Premium Dark
   Stack: HTML + CSS + Vanilla JS (Flask Templates)
   ═══════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════════════════ */
:root {
  /* FUNDOS — 5 camadas de profundidade */
  --bg-page:     #0D0F0E;
  --bg-sidebar:  #0F1210;
  --bg-card:     #161A17;
  --bg-card-2:   #1C211E;
  --bg-input:    #181D1A;

  /* BORDAS */
  --border:      #1F2820;
  --border-up:   #243029;
  --border-focus:#3DDC84;

  /* ACENTOS — família amarelo-verde EXCLUSIVA */
  --accent:      #C8F04A;
  --accent-soft: #A8D870;
  --accent-green:#3DDC84;

  /* TEXTO — 5 níveis hierárquicos */
  --text-1:      #F0F0F0;
  --text-white:  #FFFFFF;
  --text-2:      #8A9A8E;
  --text-3:      #6A7A6E;
  --text-4:      #6B7C6F;
  --muted:       #6A7A6E;

  /* STATUS / FEEDBACK */
  --status-ok:   #3DDC84;
  --status-ok-bg:#0D2A1A;
  --status-warn: #F5C842;
  --status-warn-bg:#2A2210;
  --status-err:  #E53935;
  --status-err-bg:#2A1010;
  --status-info: #5BA4A4;
  --status-info-bg:#0D1F1F;

  /* SOMBRAS */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(200,240,74,0.15);

  /* DIMENSÕES */
  --radius-card: 12px;
  --radius-btn:  8px;
  --radius-pill: 20px;
  --radius-input:8px;
  --sidebar-w:   190px;
}

/* ═══════════════════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-page);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: rgba(200,240,74,0.2); color: var(--text-1); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-up); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-soft); }

/* ═══════════════════════════════════════════════════════
   3. LAYOUT
   ═══════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════════════
   4. SIDEBAR
   ═══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.logo-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  display: block;
}
.logo-sub {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-4);
  display: block;
}

.sidebar-nav {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-2);
}
.nav-item.active {
  background: rgba(200,240,74,0.08);
  color: var(--accent);
  border-left: 2px solid var(--accent);
  font-weight: 600;
}
.nav-item.nav-secondary {
  opacity: 0.6;
  font-size: 13px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}
.nav-item.nav-secondary:hover {
  opacity: 1;
  background: transparent;
  color: var(--text-2);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.dash-submenu { padding-left: 12px; }
.dash-chevron { transition: transform 0.2s ease; }
.funil-submenu { padding-left: 12px; }
.funil-chevron { transition: transform 0.2s ease; }

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(61,220,132,0.08);
  border: 1px solid rgba(61,220,132,0.2);
  border-radius: var(--radius-btn);
  font-size: 12px;
  color: var(--text-2);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
  animation: statusPulse 2s ease-in-out infinite;
}
.sidebar-version {
  text-align: center;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-4);
  margin-top: 8px;
}
.status-dot-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  margin-left: auto;
  flex-shrink: 0;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(61,220,132,0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 4px rgba(61,220,132,0); }
}

/* ═══════════════════════════════════════════════════════
   5. MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 25px;
  overflow-y: auto;
  height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   6. TOPBAR
   ═══════════════════════════════════════════════════════ */
.topbar {
  height: 56px;
  background: rgba(13,15,14,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .page-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-1);
  margin-bottom: 0;
}
.topbar-breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-4);
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(200,240,74,0.1);
  border: 1.5px solid rgba(200,240,74,0.3);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.page-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 5px;
}
.page-subtitle {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-3);
  font-size: 14px;
}
.header-actions { display: flex; gap: 10px; }

/* ═══════════════════════════════════════════════════════
   7. CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 20px;
}
.card-hover {
  cursor: pointer;
}
.card-hover:hover {
  border-color: var(--border-up);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}
.card-body { padding: 20px; }

/* ═══════════════════════════════════════════════════════
   8. BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-btn);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #0D1000;
  font-weight: 700;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-up);
  color: var(--text-2);
}
.btn-secondary:hover {
  border-color: var(--accent-soft);
  color: var(--text-1);
}
.btn-danger {
  background: transparent;
  border: 1px solid var(--status-err);
  color: var(--status-err);
}
.btn-danger:hover {
  background: var(--status-err-bg);
}
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-3);
}
.btn-ghost:hover {
  color: var(--text-1);
  background: var(--bg-card-2);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  border-color: var(--accent-soft);
  color: var(--text-1);
}
.btn-icon svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════════
   9. FORMS
   ═══════════════════════════════════════════════════════ */
input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 9px 12px;
  color: var(--text-1);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
::placeholder { color: var(--text-4); }
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(61,220,132,0.12);
}

label {
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: block;
}
.form-group { margin-bottom: 15px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.form-input, .form-select { width: 100%; }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-4); margin-top: 5px; }
.form-title { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 15px; }
.form-actions { display: flex; gap: 12px; margin-top: 15px; }
.delay-inputs { display: flex; gap: 12px; }
.delay-field { display: flex; align-items: center; gap: 8px; }
.delay-field input { width: 80px; }
.delay-label { font-size: 13px; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   10. BADGES & PILLS
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
}
.badge.ok, .badge-ok, .badge.active {
  background: rgba(61,220,132,0.12);
  color: var(--status-ok);
  border-color: rgba(61,220,132,0.25);
}
.badge.warn, .badge-warn {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border-color: rgba(245,200,66,0.3);
}
.badge.err, .badge-err, .badge.inactive {
  background: var(--status-err-bg);
  color: var(--status-err);
  border-color: rgba(229,57,53,0.3);
}
.badge.info, .badge-info {
  background: var(--status-info-bg);
  color: var(--status-info);
  border-color: rgba(91,164,164,0.3);
}
.badge-accent {
  background: rgba(200,240,74,0.12);
  color: var(--accent);
  border-color: rgba(200,240,74,0.25);
}
.badge-muted {
  background: var(--bg-card-2);
  color: var(--text-3);
  border-color: var(--border);
}

/* ═══════════════════════════════════════════════════════
   11. TAGS (palavras-chave)
   ═══════════════════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-up);
  color: var(--text-3);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin: 2px;
}

/* ═══════════════════════════════════════════════════════
   12. PROGRESS BARS
   ═══════════════════════════════════════════════════════ */
.progress {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.progress-green  { background: var(--accent-green); }
.progress-accent { background: var(--accent); }
.progress-warn   { background: var(--status-warn); }
.progress-err    { background: var(--status-err); }

/* ═══════════════════════════════════════════════════════
   13. TABLES
   ═══════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: transparent; }
th {
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
td {
  padding: 12px 14px;
  color: var(--text-2);
  font-size: 13px;
  border-bottom: 1px solid rgba(31,40,32,0.5);
  vertical-align: middle;
}
tbody tr:hover td {
  background: rgba(200,240,74,0.03);
  color: var(--text-1);
}
tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════
   14. TOGGLES
   ═══════════════════════════════════════════════════════ */
.toggle {
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-up);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-4);
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}
.toggle.active, .toggle.on {
  background: rgba(61,220,132,0.2);
  border-color: var(--accent-green);
}
.toggle.active::after, .toggle.on::after {
  left: 20px;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(61,220,132,0.4);
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.toggle-label input { width: auto; margin-right: 8px; }

/* ═══════════════════════════════════════════════════════
   15. ICON CIRCLES
   ═══════════════════════════════════════════════════════ */
.ic-accent {
  background: rgba(200,240,74,0.12);
  border: 1px solid rgba(200,240,74,0.2);
  color: var(--accent);
}
.ic-green {
  background: rgba(61,220,132,0.12);
  border: 1px solid rgba(61,220,132,0.2);
  color: var(--accent-green);
}
.ic-warn {
  background: rgba(245,200,66,0.12);
  border: 1px solid rgba(245,200,66,0.2);
  color: var(--status-warn);
}
.ic-info {
  background: rgba(91,164,164,0.12);
  border: 1px solid rgba(91,164,164,0.2);
  color: var(--status-info);
}

/* ═══════════════════════════════════════════════════════
   16. METRICS
   ═══════════════════════════════════════════════════════ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.metric-card:hover {
  border-color: var(--border-up);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 20px;
  flex-shrink: 0;
}
.metric-icon svg { width: 18px; height: 18px; }
.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 5px;
  display: block;
}
.metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
}

/* ═══════════════════════════════════════════════════════
   17. QUICK LINKS (Dashboard)
   ═══════════════════════════════════════════════════════ */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 25px;
}
.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quick-card:hover {
  border-color: var(--border-up);
  background: var(--bg-card-2);
  transform: translateY(-1px);
}
.quick-card svg { width: 24px; height: 24px; color: var(--accent-soft); }
.quick-card span {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  display: block;
}
.quick-card small {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
}

/* ═══════════════════════════════════════════════════════
   18. PRODUCT GRID
   ═══════════════════════════════════════════════════════ */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
  overflow: hidden;
}
.product-card:hover {
  border-color: var(--border-up);
  transform: translateY(-2px);
}
.product-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin: 10px 0 8px;
}
.product-card p { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.kw-label {
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-4);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tag {
  background: var(--bg-card-2);
  border: 1px solid var(--border-up);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
}
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════
   19. KANBAN
   ═══════════════════════════════════════════════════════ */
.kanban-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 300px;
}
.kanban-column {
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.column-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.column-count {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-card-2);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.kanban-cards { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: calc(200px); }
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.kanban-card:hover {
  border-color: var(--border-up);
  transform: translateY(-1px);
}
.kanban-card.priority-ALTA { border-left: 3px solid var(--status-err); }
.kanban-card.priority-MÉDIA { border-left: 3px solid var(--status-warn); }
.kanban-card.priority-BAIXA { border-left: 3px solid var(--text-4); }

.card-main { display: flex; gap: 10px; align-items: center; }
.card-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.card-avatar-small .initials { line-height: 1; }
.card-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
}
.card-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.card-expanded {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-expanded[style*="block"] { display: block; }
.card-detail-row {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 4px 0;
  color: var(--text-3);
}
.card-detail-row span:last-child { color: var(--text-1); font-weight: 500; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-card-action {
  flex: 1;
  padding: 6px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}
.btn-card-action:hover { border-color: var(--border-up); color: var(--text-1); }
.btn-move {
  background: var(--accent-green);
  color: #0D1000;
  border: none;
  font-weight: 600;
}
.btn-move:hover { filter: brightness(1.1); }
.column-warning {
  background: var(--status-warn);
  color: #0D1000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 8px;
  font-weight: 600;
}
.phone {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
}

/* Kanban metric bar */
.kanban-metrics-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 20px;
}
.kanban-metric-item {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  text-align: left;
}
.kanban-metric-item:last-child { border-right: none; }
.kanban-metric-item .metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  display: block;
  margin-bottom: 2px;
}
.kanban-metric-item .metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Kanban tabs */
.kanban-tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.kanban-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0;
}
.kanban-tab:hover { color: var(--text-2); }
.kanban-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   20. SEQUENCES
   ═══════════════════════════════════════════════════════ */
.sequence-list { display: flex; flex-direction: column; gap: 12px; }
.sequence-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
  display: flex;
  gap: 12px;
}
.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border-up);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-delay { display: flex; gap: 8px; margin-top: 10px; }
.step-delay input { width: 70px; }

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: grab;
  transition: border-color 0.15s;
}
.step-card:active { cursor: grabbing; }
.step-card.dragging {
  opacity: 0.5;
  border: 2px dashed var(--accent-soft);
}
.step-drag-handle {
  color: var(--text-4);
  font-size: 18px;
  cursor: grab;
  padding: 5px;
  user-select: none;
}
.step-drag-handle:hover { color: var(--accent-soft); }

.add-step-btn, .add-step-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  border: 2px dashed var(--border-up);
  border-radius: var(--radius-btn);
  color: var(--text-3);
  cursor: pointer;
  margin-top: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  transition: all 0.15s ease;
  background: transparent;
}
.add-step-btn:hover, .add-step-cta:hover {
  border-color: var(--accent-soft);
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════
   21. REMARKETING
   ═══════════════════════════════════════════════════════ */
.remarketing-list { display: flex; flex-direction: column; gap: 12px; }
.remarketing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
}
.remarketing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.remarketing-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--text-1);
}
.remarketing-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════
   22. MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 25px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-1);
}
.modal-close, .btn-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.modal-close:hover, .btn-close:hover {
  background: var(--bg-card-2);
  color: var(--text-1);
}
.modal-section { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-notes {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px;
  color: var(--text-1);
  width: 100%;
  min-height: 100px;
  font-family: 'DM Sans', sans-serif;
  resize: vertical;
}

/* ═══════════════════════════════════════════════════════
   23. MASS SEND
   ═══════════════════════════════════════════════════════ */
.mass-send-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}
.campaign-list { display: flex; flex-direction: column; gap: 12px; }
.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}
.campaign-card:hover { border-color: var(--border-up); }
.campaign-info h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.campaign-info p {
  font-size: 13px;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════
   25. FILTERS & SELECTOR
   ═══════════════════════════════════════════════════════ */
.filters-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.filters-bar select, .filters-bar input { width: auto; min-width: 150px; }
.selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 15px;
  margin-bottom: 20px;
}
.selector-group { display: flex; align-items: center; gap: 12px; }
.selector-actions { display: flex; gap: 12px; }

/* ═══════════════════════════════════════════════════════
   26. ALERTS & BANNERS
   ═══════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-btn);
  margin-bottom: 16px;
  font-size: 14px;
}
.info-banner {
  background: var(--status-info-bg);
  border: 1px solid rgba(91,164,164,0.25);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════
   27. EVENT BADGE
   ═══════════════════════════════════════════════════════ */
.event-badge {
  background: var(--accent-green);
  color: #0D1000;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   28. SECTION TITLE
   ═══════════════════════════════════════════════════════ */
.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-4);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header { cursor: pointer; margin-bottom: 15px; }
.section-desc { font-size: 13px; color: var(--text-3); }
.section-icon { font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   29. BACK BUTTON
   ═══════════════════════════════════════════════════════ */
.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-btn);
  background: var(--bg-card);
  color: var(--text-2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s ease;
}
.back-button:hover {
  border-color: var(--accent-soft);
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════
   30. DIVIDER
   ═══════════════════════════════════════════════════════ */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ═══════════════════════════════════════════════════════
   31. PAGINATION
   ═══════════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination button {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  transition: all 0.15s ease;
}
.pagination button:hover { border-color: var(--accent-soft); color: var(--text-1); }
.pagination button.active {
  background: var(--accent);
  color: #0D1000;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
   32. EMPTY STATE
   ═══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-3);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
  color: var(--text-4);
}
.empty-state h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════
   33. SKELETON LOADING
   ═══════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-2) 50%, var(--bg-card) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: -400px; }
  100% { background-position: 400px; }
}
.skeleton-line {
  height: 16px;
  background: var(--bg-card-2);
  border-radius: 4px;
  margin-bottom: 8px;
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ═══════════════════════════════════════════════════════
   34. LOADING OVERLAY
   ═══════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 14, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-card-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════
   35. SELECT HIGHLIGHT
   ═══════════════════════════════════════════════════════ */
.select-highlight { border-color: var(--accent-soft); }

/* ═══════════════════════════════════════════════════════
   36. GRID 2
   ═══════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* ═══════════════════════════════════════════════════════
   37. ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation: fadeSlideUp 0.3s ease 0ms both; }
.card:nth-child(2) { animation: fadeSlideUp 0.3s ease 60ms both; }
.card:nth-child(3) { animation: fadeSlideUp 0.3s ease 120ms both; }
.card:nth-child(4) { animation: fadeSlideUp 0.3s ease 180ms both; }

@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════
   38. UTILITY CLASSES
   ═══════════════════════════════════════════════════════ */
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.wrap { flex-wrap: wrap; }
.label-small { font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.list-col-8 { flex-direction: column; gap: 8px; }
.grid-auto-250 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.fs-16 { font-size: 16px; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--accent-green); }
.text-warn { color: var(--status-warn); }
.text-err { color: var(--status-err); }
.text-info { color: var(--status-info); }

/* ═══════════════════════════════════════════════════════
   39. WHATSAPP CONNECT
   ═══════════════════════════════════════════════════════ */
.wa-connected {
  color: var(--accent-green);
  font-family: 'JetBrains Mono', monospace;
}
.wa-pulsing {
  background: rgba(200,240,74,0.1);
  border: 1px solid rgba(200,240,74,0.25);
  color: var(--accent);
  animation: pulseBadge 1.5s ease-in-out infinite;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════
   40. FOCUS VISIBLE (Acessibilidade)
   ═══════════════════════════════════════════════════════ */
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 8px;
}
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-ghost:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: -1px;
}
.toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 50px;
}

/* ═══════════════════════════════════════════════════════
   41. RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* ── Tablet & Small Desktop ── */
@media (max-width: 1024px) {
  .nav-item { font-size: 13px; padding: 9px 14px; }
  .funil-stats { grid-template-columns: repeat(2, 1fr); }
  .etapas-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal-content { max-width: 90vw; }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    flex-direction: row;
    padding: 6px;
    justify-content: space-around;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 100;
  }
  .sidebar-logo, .sidebar-footer { display: none; }
  .sidebar-nav { flex-direction: row; padding: 0; overflow-x: auto; gap: 2px; }
  .nav-item { font-size: 10px; padding: 6px 8px; white-space: nowrap; flex-shrink: 0; }
  .nav-icon { width: 16px; height: 16px; }
  .nav-secondary { display: none; }
  .dash-submenu, .kanban-submenu, .funil-submenu { display: none !important; }
  .main-content {
    margin-left: 0;
    margin-bottom: 56px;
    padding: 12px;
  }

  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title { font-size: 18px; }
  .page-subtitle { font-size: 12px; }
  .header-actions, .page-actions, .page-header-actions { width: 100%; flex-wrap: wrap; }
  .btn { font-size: 12px; padding: 8px 14px; }

  .card { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-body { padding: 16px; }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 20px; }

  .product-grid { grid-template-columns: 1fr; }

  .quick-links-grid { grid-template-columns: 1fr; }

  .funil-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .funil-card { padding: 12px; }

  .etapas-grid { grid-template-columns: 1fr; }

  .grid-2 { grid-template-columns: 1fr; }

  .form-row { flex-direction: column; gap: 8px; }
  .selector-bar { flex-direction: column; gap: 8px; }
  .selector-group { width: 100%; }
  .selector-actions { width: 100%; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions .btn { width: 100%; }

  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filters-bar { flex-direction: column; gap: 8px; }

  .modal-overlay { align-items: flex-end; }
  .modal-content {
    max-width: 100vw;
    width: 100%;
    max-height: 85vh;
    border-radius: 12px 12px 0 0;
    margin: 0;
    padding: 20px;
  }

  .kanban-container { flex-direction: column; gap: 12px; }
  .kanban-column { min-width: 100%; max-height: none; }
  .kanban-cards { max-height: none; }

  .funil-container { flex-direction: column; }
  .funil-step { flex-direction: row; gap: 10px; min-width: 0; }
  .funil-bar-wrapper { width: 100%; }
  .gargalos-list { grid-template-columns: 1fr; }

  .whatsapp-page { flex-direction: column; }
  .whatsapp-card { width: 100%; }
  .qr-container { width: 200px; height: 200px; }

  .assistente-wrapper { flex-direction: column; }
  .audit-panel { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .chat-area { height: 50vh; }

  .tabs { flex-wrap: wrap; gap: 4px; }
  .tab { font-size: 12px; padding: 8px 12px; }

  .bloco-header { padding: 10px 12px; }
  .bloco-body { padding: 12px; }

  .heat-cell { min-width: 0; font-size: 11px; }
  .hour-label { font-size: 10px; }

  .test-item { flex-direction: column; }
  .vs-row { flex-direction: column; }
  .vs-box { width: 100%; }

  .obj-item { flex-direction: column; }
  .obj-item .form-group { width: 100%; }

  .delay-inputs { flex-direction: column; gap: 6px; }

  .keyword-input-group { flex-direction: column; gap: 6px; }

  .empty-state { padding: 30px 16px; }
  .empty-icon { width: 40px; height: 40px; }

  .sequence-list { padding: 0; }
  .add-step-cta { flex-direction: column; }
  .remarketing-section { flex-direction: column; }
  .remarketing-content, .remarketing-form-container { width: 100%; }

  .instances-section { grid-template-columns: 1fr; }
  .instance-card { padding: 12px; }

  .step-card { padding: 12px; }
  .step-card .form-group { width: 100%; }

  .phone-row { flex-direction: column; gap: 6px; }
  .btn-copy-phone { align-self: flex-start; }

  .alerts-panel { position: static; width: 100%; }
  .bell-btn { position: static; }
  .bell-badge { top: 0; right: 0; }

  .chart-container { overflow-x: auto; }

  .card-actions { flex-direction: column; gap: 6px; }
  .card-actions .btn { width: 100%; }
}

/* ── Small Phones (≤480px) ── */
@media (max-width: 480px) {
  .main-content { padding: 8px; }
  .card { padding: 12px; }
  .card-body { padding: 12px; }
  .page-title { font-size: 16px; }

  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 10px; }
  .metric-icon { width: 28px; height: 28px; }
  .metric-value { font-size: 17px; }

  .funil-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .funil-card { padding: 10px; }

  .modal-content { padding: 16px; border-radius: 8px 8px 0 0; }
  .modal-title { font-size: 16px; }

  .kanban-card { padding: 10px; }
  .kanban-card .card-main { flex-direction: column; gap: 6px; }

  .grid-2 { grid-template-columns: 1fr; gap: 8px; }

  .sidebar { padding: 4px; }
  .nav-item { font-size: 9px; padding: 4px 6px; }
  .nav-icon { width: 14px; height: 14px; }

  .tabs { flex-direction: column; }
  .tab { width: 100%; text-align: center; }

  .table-wrapper { font-size: 12px; }
  .table-wrapper th, .table-wrapper td { padding: 6px; }
}

/* ── Very Small (≤360px) ── */
@media (max-width: 360px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .funil-stats { grid-template-columns: 1fr; }
  .nav-item { font-size: 8px; padding: 3px 4px; }
  .nav-icon { width: 12px; height: 12px; }
  .main-content { padding: 6px; }
  .page-title { font-size: 14px; }
}
