:root {
  --ink: #152744;
  --text: #253858;
  --text-strong: #10233f;
  --muted: #62728b;
  --line: #dce5ef;
  --border: #dce5ef;
  --bg-color: #f3f7fa;
  --bg: #f6f9fc;
  --card-bg: #ffffff;
  --surface: #ffffff;
  --primary: #08aab5;
  --accent: #078f9a;
  --accent-hover: #06727c;
  --navy: #10233f;
  --lime: #9acb2f;
  --danger: #ef4444;
  --danger-hover: #b91c1c;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 8px 24px rgb(17 40 71 / 0.07);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  font-family: var(--font-family);
  color: var(--ink);
  line-height: 1.5;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

header {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 34px 36px 0;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(118deg, #10233f 0%, #17325b 63%, #087f89 125%);
  box-shadow: 0 18px 40px rgb(16 35 63 / 0.17);
}

header::after {
  position: absolute;
  z-index: 0;
  top: -110px;
  right: -65px;
  width: 330px;
  height: 330px;
  border: 1px solid rgb(255 255 255 / 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgb(255 255 255 / 0.04), 0 0 0 84px rgb(255 255 255 / 0.025);
  content: '';
  pointer-events: none;
}

.eyebrow {
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
  color: #78e3e6;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 16px 0;
  position: relative;
  z-index: 1;
  color: #fff;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 12px 0;
}

p {
  color: var(--muted);
  margin-top: 0;
}

header > p:not(.eyebrow):not(.mode) {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: rgb(231 243 248 / 0.86);
}

.mode {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 22px;
  padding: 7px 11px;
  border: 1px solid rgb(121 229 222 / 0.34);
  border-radius: 999px;
  color: #d9fffb;
  background: rgb(5 14 34 / 0.2);
  font-size: .82rem;
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.card:hover { border-color: #ccdbe7; }

.search form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
}

input, textarea, select {
  font-family: var(--font-family);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 16px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(8 170 181 / 0.14);
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-family);
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(16 35 63 / 0.12);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgb(154 203 47 / 0.45);
  outline-offset: 2px;
}

button.secondary {
  border: 1px solid #d5e1ea;
  background: #fff;
  color: #31445e;
  box-shadow: none;
}

button.secondary:hover {
  border-color: #9bbbc5;
  background: #f1f8fa;
}

button.danger {
  background: var(--danger);
  color: white;
}

button.danger:hover {
  background: var(--danger-hover);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title h2 {
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th, td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.95rem;
}

th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f1f6fa;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.85rem;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hint {
  font-size: 0.85rem;
  margin: 4px 0 16px;
}

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #0f172a;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.good { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef9c3; color: #854d0e; }
.badge.off { background: #f1f5f9; color: #475569; }
.badge.danger { background: #fee2e2; color: #991b1b; }

.accounts-grid, .agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.account-card:hover { border-color: #9cc7d0; box-shadow: 0 8px 18px rgb(17 40 71 / .07); transform: translateY(-1px); }

.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 16px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 85%;
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-bubble.me {
  background: linear-gradient(135deg, #078f9a, #06747f);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-bubble.them {
  background: #f1f5f9;
  color: #0f172a;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.chat-bubble small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 6px;
}

.chat-bubble.them small {
  color: var(--muted);
}

/* Toggle Switch Styles */
.ai-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #f1f8fa;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.ai-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

@media (max-width: 768px) {
  .search form > div {
    flex-direction: column;
  }
}

/* Commercial workspace: performance, action queue and 360-degree lead context. */
.overview-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 8px 4px 20px; }
.overview-intro h2 { margin: 2px 0 6px; color: var(--text-strong); font-size: clamp(1.45rem, 2vw, 2rem); letter-spacing: -.035em; }
.overview-intro p { margin-bottom: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; padding: 20px; border: 1px solid #dce6ee; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgb(17 40 71 / .055); }
.metric-card::after { position: absolute; right: -22px; bottom: -25px; width: 92px; height: 92px; border: 14px solid rgb(16 35 63 / .035); border-radius: 50%; content: ''; }
.metric-card span, .metric-card small { position: relative; z-index: 1; display: block; color: var(--muted); font-size: .77rem; font-weight: 650; letter-spacing: .02em; }
.metric-card strong { position: relative; z-index: 1; display: block; margin: 6px 0 4px; color: var(--navy); font-size: 2rem; letter-spacing: -.06em; line-height: 1; }
.metric-card.accent { border-top: 3px solid #16a6b0; }.metric-card.success { border-top: 3px solid #48b28b; }.metric-card.lime { border-top: 3px solid #9acb2f; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 18px; align-items: start; }
.overview-grid .card { margin-bottom: 0; }
.next-actions { display: grid; gap: 8px; }
.next-action, .recent-lead { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: #f7fafc; color: var(--text); box-shadow: none; text-align: left; }
.next-action:hover, .recent-lead:hover { border-color: #c4d9de; background: #fff; box-shadow: 0 7px 16px rgb(17 40 71 / .07); transform: translateY(-1px); }
.next-action > span:nth-child(2), .recent-lead > span:nth-child(2) { min-width: 0; flex: 1; }
.next-action strong, .recent-lead strong { display: block; overflow: hidden; color: var(--text-strong); font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.next-action small, .recent-lead small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.next-action > b { color: #0b929c; font-size: 1.15rem; }
.action-icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; background: #dff5f4; }.action-icon.appointment { background: #eff8d7; }.action-icon.conversation { background: #e2f1fb; }.action-icon.lead { background: #fff0dc; }
.rate-pill { padding: 7px 10px; border: 1px solid #cde9e9; border-radius: 999px; color: #087b84; background: #eefafa; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.recent-leads { display: grid; gap: 8px; }.recent-lead { padding: 10px; }
.lead-avatar { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: #e8f0f7; color: #244263; font-size: .8rem; font-weight: 800; }
.stage-dot { width: 9px; height: 9px; border-radius: 99px; background: #96a6b9; }.stage-dot.em_atendimento { background: #eab308; }.stage-dot.agendado { background: #8dc93e; }.stage-dot.fechado { background: #10b981; }
.empty-state { display: grid; justify-items: start; gap: 4px; padding: 24px 6px; color: var(--muted); font-size: .9rem; }.empty-state strong { color: var(--text-strong); }
.profile-overlay { position: fixed; z-index: 1200; inset: 0; display: flex; justify-content: flex-end; background: rgb(11 27 49 / .38); backdrop-filter: blur(3px); }.profile-overlay[hidden] { display: none; }
.lead-profile-drawer { width: min(465px, 100%); min-height: 100%; padding: 28px; overflow-y: auto; border-left: 1px solid #dce6ee; background: #fff; box-shadow: -24px 0 52px rgb(14 31 56 / .18); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }.drawer-header h2 { margin: 2px 0 4px; color: var(--text-strong); font-size: 1.6rem; letter-spacing: -.04em; }.drawer-header p { margin: 0; }.drawer-close { width: 38px; height: 38px; padding: 0; font-size: 1.6rem; line-height: 1; }
.profile-details { padding: 20px 0; }.profile-status { display: flex; gap: 8px; align-items: center; }.stage-chip, .profile-message-status { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: #eef4f8; color: #51647d; font-size: .72rem; font-weight: 700; text-transform: capitalize; }.stage-chip.agendado { background: #edf8d4; color: #567b11; }.stage-chip.fechado { background: #dff8ec; color: #08754d; }.stage-chip.em_atendimento { background: #fff4d7; color: #9a6700; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }.profile-facts div { padding: 13px; border: 1px solid #e1e9ef; border-radius: 11px; background: #f8fbfc; }.profile-facts dt { color: var(--muted); font-size: .72rem; font-weight: 700; }.profile-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--text-strong); font-size: .86rem; font-weight: 650; }
.profile-timeline { padding: 16px; border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; background: #f1f9fa; }.profile-timeline h3 { margin: 0 0 7px; color: var(--text-strong); font-size: .9rem; }.profile-timeline p { margin: 5px 0; font-size: .84rem; }.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 20px; border-top: 1px solid var(--border); }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.overview-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .overview-intro { align-items: stretch; flex-direction: column; }.overview-intro button { width: 100%; }.metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.metric-card { min-height: 112px; padding: 15px; }.metric-card strong { font-size: 1.65rem; }.lead-profile-drawer { padding: 21px; }.profile-facts { grid-template-columns: 1fr; }.profile-actions { grid-template-columns: 1fr; } }

/* Kanban Board Styles */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 400px;
}
.kanban-column {
  flex: 1;
  min-width: 250px;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.kanban-column-header {
  padding: 1rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f1f6fa;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.kanban-column .badge {
  background: var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text);
}
.kanban-cards {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100px;
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
}

/* Navigation is intentionally calm: operational screens need a clear active state. */
.tabs {
  position: relative;
  z-index: 1;
  margin: 0 -36px !important;
  padding: 0 24px;
  border-color: rgb(255 255 255 / .18) !important;
  gap: 4px !important;
}
.tab-btn {
  position: relative;
  padding: 14px 14px !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  color: rgb(230 241 247 / .74) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: .9rem;
}
.tab-btn:hover { color: #fff !important; transform: none; background: rgb(255 255 255 / .06) !important; }
.tab-btn.active { border-bottom-color: var(--lime) !important; color: #fff !important; }

.campaign-tools, .send-settings {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin: 18px 0;
}
.send-settings { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.send { background: linear-gradient(135deg, #089ba5, #067781); }
.send:hover { background: linear-gradient(135deg, #067f88, #055f69); }
.status { min-height: 1.25rem; font-size: .88rem; }
.confirm { flex-direction: row; align-items: center; padding: 12px 14px; border: 1px solid #dbe7eb; border-radius: 10px; background: #f5fafb; font-size: .84rem; font-weight: 500; }
.confirm input { width: 17px; height: 17px; padding: 0; accent-color: var(--accent); }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

@media (max-width: 768px) {
  main { padding: 14px 14px 32px; }
  header { padding: 28px 22px 0; border-radius: 16px; }
  .tabs { margin: 0 -22px !important; padding: 0 12px; }
  .tab-btn { padding: 13px 12px !important; font-size: .84rem; }
  .card { padding: 20px; border-radius: 12px; }
  .section-title { flex-direction: column; }
  .campaign-tools { grid-template-columns: 1fr; align-items: stretch; }
  .campaign-tools button, .actions button { width: 100%; }
  .actions { align-items: stretch; flex-direction: column; }
  #atendimento-tab { height: calc(100vh - 116px) !important; flex-direction: column !important; }
  #atendimento-tab aside { width: 100% !important; max-height: 34%; }
}
.kanban-card:hover {
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card.dragging {
  opacity: 0.5;
  box-shadow: none;
}
.kanban-column.drag-over {
  background-color: rgba(37, 99, 235, 0.05);
  border-color: var(--primary);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  word-break: break-word;
}
.ai-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.ai-status-indicator.active {
  background-color: #10B981; /* Green */
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
}
.ai-status-indicator.paused {
  background-color: #F59E0B; /* Orange */
}
.card-body {
  font-size: 0.85rem;
  color: var(--muted);
}
.card-footer {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.chat-sidebar-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background-color 0.2s ease;
}
.chat-sidebar-item:hover {
  background-color: var(--bg);
}
.chat-sidebar-item.active {
  background-color: var(--bg);
  border-left: 4px solid var(--primary);
}
.chat-sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-sidebar-item-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sidebar-item-time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.chat-sidebar-item-msg {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chatAttachmentBtn:hover, #chatMicBtn:hover {
  background-color: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}
#chatMicBtn.recording {
  background-color: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Premium product layer: a calm workspace with an unmistakable brand signature. */
.product-bar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid rgb(140 244 238 / .56); border-radius: 10px; background: linear-gradient(145deg, #15bdc2, #087e8a); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 7px 16px rgb(0 0 0 / .16); color: #fff; font-size: .88rem; font-weight: 900; }
.brand-name { color: rgb(237 249 250 / .8); font-size: .76rem; font-weight: 700; letter-spacing: .14em; }
.brand-name strong { color: #fff; font-weight: 800; }
.workspace-state { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgb(255 255 255 / .13); border-radius: 999px; background: rgb(1 14 31 / .16); color: rgb(233 247 249 / .88); font-size: .77rem; font-weight: 600; }
.workspace-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgb(154 203 47 / .13); }
.product-signals { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 -12px 20px; }
.product-signals > div { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 12px; border: 1px solid rgb(255 255 255 / .1); border-radius: 12px; background: linear-gradient(135deg, rgb(255 255 255 / .1), rgb(255 255 255 / .035)); }
.product-signals b, .product-signals small { display: block; }
.product-signals b { color: #fff; font-size: .8rem; letter-spacing: .01em; }
.product-signals small { margin-top: 1px; overflow: hidden; color: rgb(226 241 248 / .68); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.signal-icon { position: relative; display: inline-block; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 8px; background: rgb(6 16 35 / .32); }
.signal-icon::before, .signal-icon::after { position: absolute; content: ''; }
.signal-search::before { top: 6px; left: 6px; width: 9px; height: 9px; border: 2px solid #89e4e2; border-radius: 50%; }
.signal-search::after { width: 7px; height: 2px; right: 4px; bottom: 5px; background: #89e4e2; transform: rotate(45deg); transform-origin: center; }
.signal-chat::before { top: 6px; left: 5px; width: 14px; height: 10px; border: 2px solid #89e4e2; border-radius: 5px; }
.signal-chat::after { bottom: 5px; left: 8px; width: 5px; height: 5px; border-bottom: 2px solid #89e4e2; border-left: 2px solid #89e4e2; transform: skewY(-30deg); }
.signal-calendar::before { top: 6px; left: 6px; width: 12px; height: 12px; border: 2px solid #b6de61; border-radius: 3px; }
.signal-calendar::after { top: 10px; left: 6px; width: 12px; height: 2px; background: #b6de61; }
#leads-tab > .card:first-child { border-top: 3px solid #12aeb6; }
#leads-tab > .card:nth-of-type(2) { border-top: 3px solid #d9e6ec; }
#leads-tab > .card:nth-of-type(3) { border-top: 3px solid #9acb2f; }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background: #f5fafb; }
.kanban-column[data-stage="novo"] .kanban-column-header { box-shadow: inset 3px 0 #38bdf8; }
.kanban-column[data-stage="quente"] .kanban-column-header { box-shadow: inset 3px 0 #ef4444; color: #b91c1c; }
.kanban-column[data-stage="em_atendimento"] .kanban-column-header { box-shadow: inset 3px 0 #eab308; }
.kanban-column[data-stage="agendado"] .kanban-column-header { box-shadow: inset 3px 0 #8bcf34; }
.kanban-column[data-stage="fechado"] .kanban-column-header { box-shadow: inset 3px 0 #10b981; }
@media (max-width: 768px) {
  .product-bar { margin-bottom: 22px; }
  .workspace-state { font-size: .7rem; }
  .product-signals { grid-template-columns: 1fr; margin: 0 0 18px; gap: 7px; }
  .product-signals > div { padding: 9px 10px; }
}


/* ══════════════════════════════════════════════════
   SAAS MULTI-TENANT & LOGIN STYLING
   ══════════════════════════════════════════════════ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
}

.login-brand {
  margin-bottom: 0.5rem;
}

.login-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-card h2 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem 0;
  color: #ffffff;
}

.login-sub {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.login-form label, .saas-modal-card label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.login-form input, .saas-modal-card input, .saas-modal-card select, .saas-modal-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-form input:focus, .saas-modal-card input:focus, .saas-modal-card textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary-saas {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary-saas:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary-saas:active {
  transform: scale(0.98);
}

.login-error {
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: #64748b;
}

/* User Session Bar in Header */
.user-session-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.user-profile-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.user-name-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.user-role-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #3b82f6;
  color: white;
}

.user-role-badge.admin-badge {
  background: #f59e0b;
}

.btn-logout-saas {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-saas:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Admin SaaS Management Styles */
.btn-create-tenant {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
}

.btn-create-tenant:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.badge-status-active {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-status-suspended {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tenant-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-tenant-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tenant-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-tenant-action.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* SaaS Modals */
.saas-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.saas-modal-card {
  width: 100%;
  max-width: 520px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
}

.saas-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.saas-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #ffffff;
}

.saas-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
}

.saas-modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.tenant-success-box {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.tenant-success-box textarea {
  width: 100%;
  margin: 0.5rem 0;
  background: rgba(15, 23, 42, 0.8);
  font-family: monospace;
  font-size: 0.85rem;
}

/* ─── AI TOGGLE SWITCH ─── */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s ease-in-out;
  border-radius: 28px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.25s ease-in-out;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch-toggle input:checked + .switch-slider {
  background-color: #22c55e;
}
.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* ─── IMPORT CONTACTS MODAL & DROPZONE ─── */
.import-dropzone {
  border: 2px dashed rgba(59, 130, 246, 0.5);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}
.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.dropzone-title {
  font-weight: 700;
  font-size: 1rem;
  color: #f8fafc;
  margin: 0 0 0.25rem 0;
}
.dropzone-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
}
.import-counter-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.import-counter-card .count-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}
.import-counter-card .count-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
}

