/* ═══════════════════════════════════════════
   AGILITY PROSPECT WEB — Design System
   Premium Dark Theme + Glassmorphism
   ═══════════════════════════════════════════ */

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

:root {
  --bg: #060810;
  --surface: #0d1117;
  --surface2: #161b22;
  --surface3: #1c2333;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #e6edf3;
  --text2: #7d8590;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --accent-glow: rgba(108,92,231,0.3);
  --green: #00b894;
  --green-glow: rgba(0,184,148,0.2);
  --red: #e17055;
  --blue: #74b9ff;
  --pink: #e056a0;
  --yellow: #fdcb6e;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3), 0 0 1px rgba(255,255,255,0.05);
  --glass: rgba(13,17,23,0.8);
  --glass-border: rgba(255,255,255,0.08);
}

:root.light-theme {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface2: #f1f3f5;
  --surface3: #e9ecef;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  --text: #212529;
  --text2: #495057;
  --accent: #6c5ce7;
  --accent2: #5f3dc4;
  --accent-glow: rgba(108,92,231,0.15);
  --shadow-card: 0 4px 12px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --glass: rgba(255,255,255,0.85);
  --glass-border: rgba(0,0,0,0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar ─────────────────────────────── */
#topbar {
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}
.topbar-title {
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-subtitle {
  font-size: 10px;
  color: var(--text2);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: 6px;
  padding: 2px;
}
.lang-switch button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
}
.lang-switch button.act {
  background: var(--accent);
  color: #fff;
}

.theme-toggle-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hover);
  color: var(--accent);
}
.theme-toggle-btn .theme-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
:root.light-theme .theme-toggle-btn .moon-icon {
  display: block;
}
:root.light-theme .theme-toggle-btn .sun-icon {
  display: none;
}
.theme-toggle-btn .moon-icon {
  display: none;
}
.theme-toggle-btn .sun-icon {
  display: block;
}

/* ─── Layout ─────────────────────────────── */
#appContent {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────── */
#sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
  position: relative;
}
#sidebar.collapsed {
  width: 56px;
}
#sidebar.collapsed .nav-label,
#sidebar.collapsed .nb {
  display: none;
}
.sidebar-header {
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
  overflow: hidden;
}
.sidebar-logo {
  width: 170px;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}
/* Controle de visibilidade do logotipo com base no tema ativo */
.light-logo-img {
  display: none !important;
}
.dark-logo-img {
  display: block !important;
}

.light-theme .light-logo-img,
:root.light-theme .light-logo-img {
  display: block !important;
}
.light-theme .dark-logo-img,
:root.light-theme .dark-logo-img {
  display: none !important;
}
#sidebar.collapsed .sidebar-header {
  padding: 16px 6px;
}
#sidebar.collapsed .sidebar-logo {
  width: 44px;
}
.sidebar-collapse-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.sidebar-collapse-btn:hover {
  color: var(--text);
  background: var(--surface3);
}
#sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
#sidebar nav .ni {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text2);
  font-size: 13px;
  transition: var(--transition);
  border-left: 3px solid transparent;
  min-height: 42px;
  min-width: 0;
  position: relative;
}
#sidebar nav .ni .nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
#sidebar nav .ni .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sidebar nav .ni .search-acronym {
  background: rgba(108,92,231,0.14);
  border: 1px solid rgba(162,155,254,0.24);
  color: var(--accent2);
  font-size: 10px;
  font-weight: 800;
}
#sidebar nav .ni:hover {
  color: var(--text);
  background: var(--surface2);
}
#sidebar nav .ni.act {
  color: var(--accent2);
  border-left-color: var(--accent);
  background: rgba(108,92,231,0.08);
}
#sidebar nav .ni .nb {
  margin-left: auto;
  font-size: 10px;
  color: var(--text2);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 10px;
}
#sidebar nav .ni.all {
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 12px;
}

/* ─── Main ───────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ─── Search bar ─────────────────────────── */
#searchBar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
#searchFields {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#searchFields input, #searchFields select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  min-width: 0;
}
#searchFields input:focus, #searchFields select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
#searchFields .in-niche { flex: 2; }
#searchFields .in-state { flex: 2; }
#searchFields .in-city { flex: 1; }
#searchFields .in-max { width: 70px; text-align: center; }
#searchActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Buttons ────────────────────────────── */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn1 {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn1:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn2 {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn2:hover {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border-hover);
}
.btn3 {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(225,112,85,0.3);
}
.btn3:hover {
  background: rgba(225,112,85,0.1);
}
.sp {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Queue ──────────────────────────────── */
#queuePanel {
  display: none;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
#queuePanel h4 {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
}
#queueList {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}
.q-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.q-item span { flex: 1; }
.q-item button {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}
.q-item button:hover {
  color: var(--red);
  background: rgba(225,112,85,0.1);
}

/* ─── Filter ─────────────────────────────── */
#filterBar {
  padding: 10px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#filterBar input,
#filterBar select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
#filterBar input { flex: 1; }
#filterBar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
#filterBar select { min-width: 140px; cursor: pointer; }

/* ─── Stats ──────────────────────────────── */
#statsRow {
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.mstat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex: 1;
  min-width: 100px;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}
.mstat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.mstat:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.mstat:hover::before { opacity: 1; }
.mstat .lb {
  font-size: 10px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.mstat .vl {
  font-size: 22px;
  font-weight: 800;
  margin: 2px 0;
}
.mstat .sb {
  font-size: 10px;
  color: var(--text2);
}

/* ─── Table ──────────────────────────────── */
#tableSection {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 24px 14px;
}
#tableHdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}
#tableHdr h2 { font-size: 14px; font-weight: 600; }
#tableHdr .tact { display: flex; gap: 6px; }
#tableWrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
#dataTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* Larguras específicas para cada coluna da tabela de leads */
#dataTable th:nth-child(1), #dataTable td:nth-child(1) {
  width: 45px;
  min-width: 45px;
  text-align: center;
}
#dataTable th:nth-child(2), #dataTable td:nth-child(2) {
  width: 110px;
  min-width: 110px;
  text-align: center;
}
#dataTable th:nth-child(3), #dataTable td:nth-child(3) {
  width: 45px;
  min-width: 45px;
  text-align: center;
}
#dataTable th:nth-child(4), #dataTable td:nth-child(4) {
  min-width: 160px;
}
#dataTable th:nth-child(5), #dataTable td:nth-child(5) {
  min-width: 130px;
}
#dataTable th:nth-child(6), #dataTable td:nth-child(6) {
  width: 65px;
  min-width: 65px;
  text-align: center;
}
#dataTable th:nth-child(7), #dataTable td:nth-child(7) {
  width: 65px;
  min-width: 65px;
  text-align: center;
}
#dataTable th:nth-child(8), #dataTable td:nth-child(8) {
  width: 130px;
  min-width: 130px;
  white-space: nowrap;
}
#dataTable th:nth-child(9), #dataTable td:nth-child(9) {
  width: 50px;
  min-width: 50px;
  text-align: center;
}
#dataTable th:nth-child(10), #dataTable td:nth-child(10) {
  width: 60px;
  min-width: 60px;
  text-align: center;
}
#dataTable th:nth-child(11), #dataTable td:nth-child(11) {
  width: 80px;
  min-width: 80px;
  text-align: center;
}
#dataTable th:nth-child(12), #dataTable td:nth-child(12) {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#dataTable th:nth-child(13), #dataTable td:nth-child(13) {
  min-width: 260px;
  white-space: normal;
  line-height: 1.4;
}

#dataTable thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
#dataTable th {
  background: var(--surface2);
  color: var(--text2);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}
#dataTable td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
#dataTable tbody tr {
  transition: var(--transition);
}
#dataTable tbody tr:hover {
  background: var(--surface2);
}
#dataTable a {
  color: var(--accent2);
  text-decoration: none;
  transition: var(--transition);
}
#dataTable a:hover { color: var(--accent); }
#dataTable .rate {
  color: var(--yellow);
  font-weight: 700;
}

/* ─── Terminal ───────────────────────────── */
#tdr {
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
#tdr .tog {
  padding: 8px 24px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
#tdr .tog:hover { color: var(--text); }
#tdr .cnt {
  max-height: 160px;
  overflow-y: auto;
  padding: 0 24px 10px;
  display: none;
}
#tdr .cnt.v { display: block; }
#tdr pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #00ff9d;
  line-height: 1.6;
  white-space: pre-wrap;
}

.light-theme #tdr pre {
  color: #0a5c36;
}

/* ─── Toast ──────────────────────────────── */
#toastContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  width: 100vw;
  max-width: 420px;
}
.toast {
  pointer-events: auto;
  background: var(--surface2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 18px 28px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: toastPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Tipos de Feedback com Toques de Neon Premium */
.toasts { 
  border: 1px solid rgba(46, 204, 113, 0.35) !important; 
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 25px rgba(46, 204, 113, 0.15);
}
.toaste { 
  border: 1px solid rgba(231, 76, 60, 0.35) !important; 
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 25px rgba(231, 76, 60, 0.15);
}
.toastw { 
  border: 1px solid rgba(241, 196, 15, 0.35) !important; 
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 25px rgba(241, 196, 15, 0.15);
}
.toasti { 
  border: 1px solid rgba(52, 152, 219, 0.35) !important; 
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 25px rgba(52, 152, 219, 0.15);
}

.toast-prospecting {
  border: 1px solid var(--accent-glow) !important;
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 30px var(--accent-glow);
  padding: 24px 32px;
}
.toast-prospecting strong {
  color: var(--accent2) !important;
}
.toast-link {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.toast-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastCenterIn {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes toastPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Empty State ────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text2);
}
.empty .ic {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.25;
}

/* ─── Splash ─────────────────────────────── */
#splash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash img {
  width: 180px;
  height: 180px;
  margin-bottom: 24px;
  animation: pulse 2.5s infinite;
  object-fit: contain;
  filter: drop-shadow(0 0 40px var(--accent-glow));
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}
#splash .loader {
  width: 80px;
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
#splash .loader::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  animation: loading 1.2s ease infinite;
}
@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
#splash .brand-text {
  color: var(--text2);
  font-size: 12px;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-top: -4px;
  margin-bottom: 24px;
  opacity: 0.4;
}

/* ─── Dashboard ──────────────────────────── */
#dashboardView {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
#dashboardView.v { display: block; }
#dashboardView .dg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
#dashboardView .dc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
#dashboardView .dc:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}
#dashboardView .dc h4 {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  font-weight: 600;
}
#dashboardView .dc .big {
  font-size: 36px;
  font-weight: 800;
}
#dashboardView .bar-wrap {
  background: var(--surface2);
  border-radius: 4px;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
}
#dashboardView .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
#dashboardView .cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
#dashboardView .cat-row .cat-name { flex: 1; }
#dashboardView .cat-row .cat-count { color: var(--text2); font-size: 12px; }
#dashboardView .cat-row .cat-bar { flex: 2; }
#dashboardView .hist-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

/* ─── Rename Modal ───────────────────────── */
#renameModal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
#renameModal.v { display: flex; }
#renameModal .rm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-width: 360px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
#renameModal .rm h3 { margin-bottom: 16px; font-size: 15px; }
#renameModal .rm input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
#renameModal .rm input:focus { border-color: var(--accent); }
#renameModal .rm .ra {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Edit Lead Modal ────────────────────── */
#editLeadModal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
#editLeadModal.v { display: flex; }
#editLeadModal .rm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-width: 360px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}
#editLeadModal .rm h3 { margin-bottom: 16px; font-size: 15px; }
#editLeadModal .rm input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
#editLeadModal .rm input:focus { border-color: var(--accent); }
#editLeadModal .rm .ra {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── WhatsApp ───────────────────────────── */
.wa-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.wa-tab:hover { color: var(--text); background: var(--surface2); }
.wa-tab.act { color: var(--accent2); border-bottom-color: var(--accent); }

.wa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 14px;
  transition: var(--transition);
}
.wa-card:hover { border-color: var(--border-hover); }
.wa-card h4 { font-size: 14px; margin-bottom: 14px; }
.wa-card label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.wa-card input:not([type="checkbox"]):not([type="radio"]),
.wa-card select,
.wa-card textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.wa-card input[type="checkbox"],
.wa-card input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}
.wa-card input:focus,
.wa-card select:focus,
.wa-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.wa-card textarea { resize: vertical; min-height: 100px; }

.wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.wa-status-badge.connected {
  background: rgba(0,184,148,0.12);
  color: var(--green);
  border: 1px solid rgba(0,184,148,0.3);
}
.wa-status-badge.disconnected {
  background: rgba(225,112,85,0.12);
  color: var(--red);
  border: 1px solid rgba(225,112,85,0.3);
}

.wa-progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.wa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.mobile-menu-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--accent2);
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 900px) {
  #searchFields { flex-direction: column; }
  #searchFields .in-niche,
  #searchFields .in-state,
  #searchFields .in-city { flex: unset; }
  #statsRow { flex-wrap: wrap; }
  .mstat { min-width: 120px; }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  #sidebar {
    position: fixed;
    left: -240px;
    top: 48px;
    height: calc(100vh - 48px);
    z-index: 1000;
    width: 240px !important;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar.mobile-open {
    left: 0;
  }
  #sidebar .nav-label, #sidebar .nb {
    display: flex !important;
  }
  .sidebar-collapse-btn {
    display: none !important;
  }
  
  #main {
    overflow-y: auto;
  }
  #tableSection {
    flex: none;
    overflow: visible;
  }
  #tableWrapper {
    overflow: visible;
    overflow-x: auto;
  }
  
  /* Otimização da Tabela de Leads no Mobile */
  #dataTable th:nth-child(5), #dataTable td:nth-child(5),
  #dataTable th:nth-child(6), #dataTable td:nth-child(6),
  #dataTable th:nth-child(7), #dataTable td:nth-child(7),
  #dataTable th:nth-child(13), #dataTable td:nth-child(13) {
    display: none !important;
  }
}

@media (max-width: 600px) {
  #filterBar { flex-direction: column; gap: 8px; }
  #filterBar input, #filterBar select { width: 100%; }
  #statsRow { padding: 10px 12px; gap: 6px; }
  .mstat { padding: 10px; min-width: calc(50% - 3px); }
  .mstat .vl { font-size: 18px; }
  
  #searchBar { padding: 12px 16px; }
  .wa-card { padding: 16px; }
  
  #tableHdr {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #tableHdr .tact {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ─── Animations ─────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.35s ease; }

/* ─── Profile Dropdown ────────────────────── */
.user-profile {
  position: relative;
  display: inline-block;
}
.profile-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}
.profile-btn:hover {
  border-color: var(--accent2);
  box-shadow: 0 0 10px var(--accent-glow);
}
.profile-avatar {
  text-transform: uppercase;
}
.profile-dropdown {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: #141624 !important; /* Totalmente sólido e opaco para evitar vazamento */
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6) !important;
  z-index: 1000000 !important;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.profile-dropdown.v {
  display: block !important;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-info {
  font-size: 13.5px;
  color: #fff;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
}
.profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08) !important;
  margin: 14px 0 !important;
}
.profile-change-password h4 {
  font-size: 11px;
  color: #8a8d9f;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.profile-change-password input {
  width: 100%;
  background: #0b0d16 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  outline: none !important;
  margin-bottom: 10px !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.profile-change-password input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15) !important;
}
.profile-change-password button {
  width: 100%;
  justify-content: center;
  padding: 10px 12px !important;
}
.dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 10px 12px !important;
  text-align: left;
  font-size: 13px;
  border-radius: 8px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
.logout-item {
  color: #ff7675 !important;
  font-weight: 600;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  margin-top: 4px;
}
.logout-item:hover {
  background: rgba(255, 118, 117, 0.1) !important;
}

/* ─── Modern Icon System ─────────────────── */
.wa-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wa-tab svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wa-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}
.wa-icon-lg {
  width: 18px;
  height: 18px;
}
.wa-icon-sm {
  width: 12px;
  height: 12px;
}
#sidebar nav .ni .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── KANBAN STYLES ────────────────────────── */
#kanbanBoard {
  display: flex;
  gap: 20px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: stretch;
  scroll-behavior: smooth;
}

/* Colunas */
.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.kanban-column.drag-over {
  background: var(--surface2);
  border-color: var(--accent);
}
.kanban-column.dragging-column {
  opacity: 0.4;
  border: 2px dashed var(--accent);
}
.kanban-column.column-drag-over {
  border-left: 4px solid var(--accent);
  background: var(--surface2);
}
.kanban-column-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
  flex-shrink: 0;
  cursor: grab;
}
.kanban-column-header:active {
  cursor: grabbing;
}
.kanban-column-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.kanban-column-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--surface2);
  color: var(--text2);
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.kanban-column-actions {
  display: flex;
  gap: 4px;
}
.kanban-col-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.kanban-col-btn:hover {
  background: var(--surface3);
  color: var(--text);
}
.kanban-col-btn.delete:hover {
  color: var(--red);
}

/* Cores dinâmicas para as colunas do Kanban (Novo Lead, Follow-up, Qualificado, etc.) */
.kanban-column-header.color-stage-0 {
  background: linear-gradient(135deg, #1e90ff, #0072ff);
  border-bottom: none;
}
.kanban-column-header.color-stage-1 {
  background: linear-gradient(135deg, #ffc107, #f39c12);
  border-bottom: none;
}
.kanban-column-header.color-stage-2 {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  border-bottom: none;
}
.kanban-column-header.color-stage-3 {
  background: linear-gradient(135deg, #e17055, #d63031);
  border-bottom: none;
}
.kanban-column-header.color-stage-4 {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-bottom: none;
}

/* Estilo unificado para cabeçalhos com cores de fundo cheias */
.kanban-column-header.color-stage-0,
.kanban-column-header.color-stage-1,
.kanban-column-header.color-stage-2,
.kanban-column-header.color-stage-3,
.kanban-column-header.color-stage-4 {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  padding: 14px 16px;
}

/* Configuração geral de contraste de textos e contadores nos headers coloridos */
.kanban-column-header[class*="color-stage-"] .kanban-column-title {
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.kanban-column-header[class*="color-stage-"] .kanban-column-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.kanban-column-header[class*="color-stage-"] .kanban-col-btn {
  color: rgba(255, 255, 255, 0.85);
}

.kanban-column-header[class*="color-stage-"] .kanban-col-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Customizações específicas para o header amarelo (color-stage-1) para excelente contraste */
.kanban-column-header.color-stage-1 .kanban-column-title {
  color: #0f172a;
  text-shadow: none;
}

.kanban-column-header.color-stage-1 .kanban-column-count {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.kanban-column-header.color-stage-1 .kanban-col-btn {
  color: rgba(15, 23, 42, 0.7);
}

.kanban-column-header.color-stage-1 .kanban-col-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #000000;
}

.kanban-column-header.color-stage-1 .kanban-col-btn.delete:hover {
  color: #b91c1c;
}

.kanban-cards-container {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
}

/* Cartões */
.kanban-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: grab;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent2);
  box-shadow: 0 6px 16px var(--accent-glow);
}
.kanban-card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition), background var(--transition);
  z-index: 10;
}
.kanban-card:hover .kanban-card-delete-btn {
  opacity: 1;
}
.kanban-card-delete-btn:hover {
  color: var(--red);
  background: rgba(225, 112, 85, 0.1);
}
.kanban-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.kanban-card-company {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.kanban-card-contacts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.kanban-card-contact-item {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card-contact-item svg {
  color: var(--accent2);
  opacity: 0.8;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.kanban-card-date {
  font-size: 9px;
  color: var(--text2);
}
.kanban-card-indicators {
  display: flex;
  gap: 6px;
}
.kanban-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text2);
  opacity: 0.6;
}
.kanban-indicator.active {
  color: var(--accent2);
  opacity: 1;
}

/* Abas de Detalhes do Card */
.card-tab-btn {
  background: none;
  border: none;
  color: var(--text2);
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.card-tab-btn.act {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}
.card-tab-btn:hover:not(.act) {
  color: var(--text);
}

/* Notas / Lembretes / Documentos */
.kanban-note-item {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.kanban-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-note-date {
  font-size: 10px;
  color: var(--text2);
}
.kanban-note-content {
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.4;
}

.kanban-reminder-item {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kanban-reminder-item.done {
  border-left-color: var(--green);
  opacity: 0.6;
}
.kanban-reminder-item.done .kanban-reminder-text {
  text-decoration: line-through;
  color: var(--text2);
}
.kanban-reminder-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.kanban-reminder-time {
  font-size: 10px;
  color: var(--yellow);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kanban-reminder-item.done .kanban-reminder-time {
  color: var(--green);
}
.kanban-reminder-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

.kanban-doc-item {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kanban-doc-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.kanban-doc-icon {
  color: var(--accent2);
}
.kanban-doc-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-doc-meta {
  font-size: 10px;
  color: var(--text2);
}

/* Área de DropZone */
#kanbanDropZone {
  border: 2px dashed var(--border);
  padding: 20px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#kanbanDropZone.drag-over {
  border-color: var(--accent);
  background: var(--surface2);
}


/* Modais do Kanban */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal.v {
  display: flex !important;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  animation: modal-appear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
@keyframes modal-appear {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Paywall Premium para o Plano Free */
.paywall-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.paywall-card {
  max-width: 440px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: paywall-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.paywall-icon {
  font-size: 56px;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent2), #ff7a45);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lock-pulse 2s infinite ease-in-out;
}
.paywall-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--text), var(--text2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.paywall-card p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin: 0;
}
.paywall-cta-btn {
  margin-top: 10px;
  padding: 12px 32px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@keyframes paywall-appear {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes lock-pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--accent2)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(235, 94, 40, 0.4)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--accent2)); }
}

/* Suporte ao Tema Claro */
.light-theme .paywall-overlay {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.light-theme .paywall-card {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
  background: var(--surface);
}

/* Badge de Uso de Limites */
.usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}
.usage-badge strong {
  color: var(--accent2);
  font-weight: 700;
}

/* Dropdown Pesquisável (Combobox com Busca) */
.searchable-dropdown {
  position: relative;
}
.dropdown-trigger {
  position: relative;
  display: flex;
  width: 100%;
}
.dropdown-trigger input {
  width: 100%;
  padding-right: 34px !important; /* Espaço para a seta */
}
.dropdown-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 9px;
  color: var(--text2);
  opacity: 0.6;
  transition: transform 0.2s ease;
}
.searchable-dropdown.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: none;
}
.searchable-dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--surface2);
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.dropdown-item:last-child {
  border-bottom: none;
}
.dropdown-item:hover {
  background: var(--accent);
  color: #fff !important;
}
.dropdown-item.no-results {
  color: var(--text2);
  font-style: italic;
  cursor: default;
  background: transparent !important;
}
.light-theme .dropdown-menu {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ─── SaaS Profile Elements ─────────────────── */
.profile-header-saas {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.profile-avatar-big {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}
.profile-details-saas {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.profile-email-saas {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.profile-role-saas {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.profile-saas-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.saas-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.saas-label {
  color: var(--text2);
  font-weight: 500;
}
.saas-value {
  color: var(--text);
  font-weight: 600;
}
.saas-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.saas-badge.free {
  background: rgba(120, 120, 120, 0.15);
  color: var(--text2);
}
.saas-badge.starter {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}
.saas-badge.pro {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}
.saas-badge.enterprise {
  background: rgba(230, 126, 34, 0.15);
  color: #e67e22;
}
.upgrade-saas-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.saas-plan-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.saas-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.saas-plan-card.recommended:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(155, 89, 182, 0.3);
}

/* ─── Viewport Height Fixes (e.g. smaller screens, laptops, zoom) ─── */
@media (max-height: 840px) {
  #main {
    overflow-y: auto;
  }
  #tableSection {
    flex: none;
    overflow: visible;
  }
  #tableWrapper {
    overflow: visible;
    overflow-x: auto;
  }
  #dashboardView {
    overflow-y: visible;
  }
  #adminView {
    overflow-y: visible;
  }
  #searchesView {
    overflow-y: visible;
  }
}

/* ─── Kanban Stage Archived Special Styles ─── */
.kanban-column-archived {
  background: rgba(0, 0, 0, 0.15) !important;
  border: 1px dashed var(--border) !important;
}
.light-theme .kanban-column-archived {
  background: rgba(0, 0, 0, 0.03) !important;
}
.kanban-column-archived.collapsed {
  width: 52px !important;
  min-width: 52px !important;
  flex: none !important;
  padding: 10px 4px !important;
}
.color-stage-archived {
  background: var(--surface2) !important;
  border-bottom: 2px solid var(--border) !important;
}
.vertical-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 12px 0 0 0 !important;
  white-space: nowrap;
  font-size: 13px !important;
  letter-spacing: 0.5px;
  text-align: center;
  align-self: center;
  font-weight: 700;
  color: var(--text2);
}
.kanban-column-archived.collapsed .kanban-column-count {
  margin-top: 6px;
  font-size: 11px;
}
.kanban-column-archived.collapsed .toggle-archive {
  margin-bottom: 6px;
}
.kanban-column-archived.collapsed:hover {
  background: rgba(108, 92, 231, 0.05) !important;
  border-color: var(--accent) !important;
}
.kanban-column-archived.drag-over {
  border-color: var(--accent) !important;
  background: rgba(108, 92, 231, 0.08) !important;
}



