:root {
  /* Marca F4cil */
  --primary:       #27ae60;
  --primary-light: #2ecc71;
  --primary-dark:  #1e8449;
  --accent:        #6c3fc5;
  --accent-light:  #8b5cf6;
  --accent-dark:   #4c2a8a;

  /* Legado (mantidos para compatibilidade) */
  --purple:        #6c3fc5;
  --purple-light:  #8b5cf6;
  --purple-dark:   #4c2a8a;
  --orange:        #F06423;
  --green:         #27ae60;
  --green-dark:    #1e8449;

  --bg:            #f0f4f2;
  --sidebar-bg:    #1a3d2b;
  --sidebar-text:  #b8d4c4;
  --sidebar-hover: rgba(255,255,255,0.08);
  --white:         #ffffff;
  --gray-100:      #f8f9fa;
  --gray-200:      #e9ecef;
  --gray-300:      #dee2e6;
  --gray-400:      #ced4da;
  --gray-500:      #adb5bd;
  --gray-600:      #6c757d;
  --gray-700:      #495057;
  --gray-800:      #343a40;
  --danger:        #dc3545;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --radius:        12px;
  --font:          'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--gray-800); font-size: 14px; }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: var(--font); font-size: 14px; outline: none; }

/* ====== LOGIN ====== */
/* ====== LOGIN SPLIT LAYOUT ====== */
.login-page {
  min-height: 100vh;
  display: flex;
}
.login-split-left {
  flex: 1;
  background: linear-gradient(160deg, #1a3d2b 0%, #0f2a1d 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  color: var(--white);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}
.login-brand i { font-size: 28px; color: var(--primary-light); }
.login-brand span { font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; }
.login-hero-text h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.login-hero-text h1 span { color: var(--primary-light); }
.login-hero-text p {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 40px;
}
.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}
.login-feature i { color: var(--primary-light); font-size: 12px; }
.login-split-right {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  padding: 40px;
}
.login-card {
  width: 100%;
  max-width: 360px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo i { font-size: 32px; color: var(--primary); }
.login-logo span { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.login-card h2 { margin-bottom: 28px; color: var(--gray-800); font-size: 18px; font-weight: 600; }
.login-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-500);
}
.login-footer-text a { color: var(--primary); text-decoration: none; font-weight: 500; }
.login-footer-text a:hover { text-decoration: underline; }
.login-forgot-wrap { text-align: center; margin: .75rem 0 0; }
.login-forgot-link { font-size: .85rem; color: #1e8449; text-decoration: none; }
.login-dev-credit { text-align: center; font-size: .72rem; color: #adb5bd; margin-top: 16px; }
.login-dev-link { color: #868e96; font-weight: 600; text-decoration: none; }
.login-lang-switcher { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.login-lang-btn { font-size: .8rem; color: var(--gray-500); text-decoration: none; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--gray-200); transition: background .15s, color .15s; }
.login-lang-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.login-lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.login-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 24px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.login-stat {
  padding: 20px 22px;
  background: rgba(255,255,255,0.05);
  transition: background .15s;
}
.login-stat:hover { background: rgba(255,255,255,0.09); }
.login-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 5px;
}
.login-stat-label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.login-stats-mobile { display: none; }
.login-header-mobile { display: none; }
@media (max-width: 768px) {
  .login-split-left { display: none; }
  .login-header-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1a3d2b 0%, #0f2a1d 100%);
    padding: 20px 24px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10;
  }
  .login-header-mobile span {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
  }
  .login-logo { display: none; }
  .login-split-right {
    width: 100%;
    min-height: 100vh;
    padding: 110px 32px 180px;
  }
  .login-footer-text { font-size: 15px; margin-top: 16px; }
  .login-forgot-wrap { text-align: center; margin: .75rem 0 0; }
  .login-forgot-link { font-size: 15px; color: #1e8449; text-decoration: none; }
  .login-dev-credit { text-align: center; font-size: 13px; color: #adb5bd; margin-top: 16px; }
  .login-dev-link { color: #868e96; font-weight: 600; text-decoration: none; }
  .login-stats-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(0,0,0,0.2);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
  }
  .login-stat-m {
    padding: 14px 18px;
    background: #1a3d2b;
  }
  .login-stat-m-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 3px;
  }
  .login-stat-m-label {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .4px;
  }
}

/* ====== BROADCAST ====== */
.bc-shell {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  padding: 24px;
  height: calc(100vh - 52px);
  overflow: hidden;
  box-sizing: border-box;
}
.bc-form-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}
.bc-step {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.bc-step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.bc-step-num {
  width: 28px; height: 28px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.bc-step-head strong { display: block; font-size: 14px; font-weight: 700; color: var(--gray-800); }
.bc-step-head span   { font-size: 12px; color: var(--gray-500); }
.bc-cards { display: flex; flex-direction: column; gap: 8px; }
.bc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.bc-card:hover { border-color: var(--primary); background: #f0faf4; }
.bc-card.active { border-color: var(--primary); background: #f0faf4; box-shadow: 0 0 0 3px rgba(39,174,96,0.12); }
.bc-card input[type="radio"] { position: absolute; opacity: 0; width: 0; }
.bc-card-icon { font-size: 18px; color: var(--gray-400); width: 24px; text-align: center; flex-shrink: 0; transition: color 0.15s; }
.bc-card.active .bc-card-icon { color: var(--primary); }
.bc-card-text { flex: 1; min-width: 0; }
.bc-card-text strong { display: block; font-size: 13px; font-weight: 600; color: var(--gray-800); }
.bc-card-text span   { font-size: 12px; color: var(--gray-500); }
.bc-card-check { color: var(--primary); opacity: 0; transition: opacity 0.15s; font-size: 14px; }
.bc-card.active .bc-card-check { opacity: 1; }
.bc-var-row {
  padding: 14px;
  background: var(--gray-100);
  border-radius: 10px;
  margin-bottom: 8px;
}
.bc-var-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bc-var-toggle { display: flex; gap: 8px; margin-bottom: 8px; }
.bc-toggle-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.15s;
}
.bc-toggle-opt:has(input:checked) { border-color: var(--primary); color: var(--primary-dark); background: rgba(39,174,96,0.06); }
.bc-toggle-opt input { display: none; }
.bc-var-select, .bc-var-text {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
}
.bc-var-select:focus, .bc-var-text:focus { border-color: var(--primary); outline: none; }
.bc-send-btn { border-radius: 12px !important; }
/* Preview */
.bc-preview-col { display: flex; flex-direction: column; }
.bc-preview-box {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.bc-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-dark);
}
.bc-preview-header i { font-size: 18px; color: var(--primary); }
.bc-phone-frame {
  flex: 1;
  background: #e5ddd5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  min-height: 200px;
}
.bc-bubble {
  background: var(--white);
  border-radius: 0 10px 10px 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  color: var(--gray-800);
  white-space: pre-wrap;
}
.bc-bubble-empty {
  background: none;
  box-shadow: none;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  width: 100%;
  padding: 24px 16px;
}
.bc-preview-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
}
.bc-preview-contact i { color: var(--primary); }

/* ====== TEMPLATE BADGES & PREVIEW ====== */
.tpl-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tpl-badge-pending  { background: #fff8e1; color: #b8860b; }
.tpl-badge-approved { background: #e8f5e9; color: var(--primary-dark); }
.tpl-badge-rejected { background: #ffebee; color: var(--danger); }
.tpl-preview-box {
  background: #e8f5e9;
  border: 1px solid rgba(39,174,96,0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 4px;
}
.tpl-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-preview-bubble {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  max-width: 340px;
}
.tpl-var-chip {
  display: inline-block;
  background: rgba(39,174,96,0.15);
  color: var(--primary-dark);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
  font-size: 13px;
}
.tpl-delete-btn { color: var(--danger) !important; border-color: rgba(220,53,69,0.3) !important; }
.tpl-delete-btn:hover { background: rgba(220,53,69,0.08) !important; border-color: rgba(220,53,69,0.6) !important; }
.tpl-btn-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  background: var(--gray-100);
  border-radius: 8px;
  flex-wrap: wrap;
}

/* ====== SELECT COMPANY ====== */
.sc-card { max-width: 400px; }
.sc-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}
.sc-avatar {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  flex-shrink: 0;
}
.sc-greeting-text { display: flex; flex-direction: column; gap: 2px; }
.sc-greeting-name { font-weight: 700; font-size: 15px; color: var(--gray-800); }
.sc-greeting-sub  { font-size: 12px; color: var(--gray-500); }
.sc-companies { display: flex; flex-direction: column; gap: 10px; }
.sc-company-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
  position: relative;
}
.sc-company-card:hover { border-color: var(--primary); background: #f0faf4; }
.sc-company-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.sc-company-card:has(input:checked) {
  border-color: var(--primary);
  background: #f0faf4;
  box-shadow: 0 0 0 3px rgba(39,174,96,0.15);
}
.sc-company-icon {
  width: 38px; height: 38px;
  background: var(--gray-100);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.sc-company-card:has(input:checked) .sc-company-icon {
  background: var(--primary);
  color: var(--white);
}
.sc-company-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--gray-800); }
.sc-company-check {
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 14px;
}
.sc-company-card:has(input:checked) .sc-company-check { opacity: 1; }
.sc-new-company {
  margin-top: 16px;
  text-align: center;
}
.sc-new-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.sc-new-btn:hover { background: rgba(39,174,96,0.08); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--gray-800); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  transition: border-color 0.2s;
  background: var(--gray-100);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  background: var(--white);
  outline: none;
}
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fff0f0; color: var(--danger); border: 1px solid #ffcdd2; }

/* ====== BUTTONS ====== */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }
@keyframes btn-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.btn-primary.btn-loading {
  background: linear-gradient(90deg, #1e8449 0%, #27ae60 40%, #2ecc71 50%, #27ae60 60%, #1e8449 100%);
  background-size: 300% auto;
  animation: btn-shimmer 1.4s linear infinite;
  cursor: wait;
  pointer-events: none;
  opacity: .9;
}
.btn-full { width: 100%; }
.btn-resolve-phone {
  margin-top: 6px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--green);
  background: #e8f5e9;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-resolve-phone:hover { background: #d5efda; }
.btn-resolve-phone:disabled { opacity: 0.6; cursor: default; }
.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--gray-400); }
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
}
.btn-icon {
  background: none;
  border: 1.5px solid var(--gray-400);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-icon.btn-danger:hover { background: var(--danger); color: var(--white); }

/* ====== APP LAYOUT ====== */
.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns .2s ease;
}
.app-layout.no-info-panel                       { grid-template-columns: 300px 1fr; }
.app-layout.sidebar-collapsed                   { grid-template-columns: 0px 1fr 280px; }
.app-layout.no-info-panel.sidebar-collapsed     { grid-template-columns: 0px 1fr; }
.app-layout.info-collapsed                      { grid-template-columns: 300px 1fr 0px; }
.app-layout.sidebar-collapsed.info-collapsed    { grid-template-columns: 0px 1fr 0px; }

/* Botões de colapso dos painéis */
.panel-edge-toggle {
  position: fixed;
  z-index: 120;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 52px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: left .2s ease, right .2s ease, background .15s, opacity .15s;
  opacity: .55;
}
.panel-edge-toggle:hover { opacity: 1; }
.sidebar-edge-toggle {
  left: 300px;
  background: var(--purple);
  color: #fff;
  border-radius: 0 6px 6px 0;
}
.app-layout.sidebar-collapsed .sidebar-edge-toggle { left: 0px; }
.info-edge-toggle {
  right: 280px;
  background: var(--purple);
  color: #fff;
  border-radius: 6px 0 0 6px;
}
.app-layout.info-collapsed .info-edge-toggle { right: 0px; }

/* ====== SIDEBAR ====== */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.brand i { font-size: 24px; color: var(--green); }
.brand span { font-size: 18px; font-weight: 700; color: var(--white); }
.agent-info { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 36px; height: 36px;
  background: var(--purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--white);
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.agent-details { flex: 1; min-width: 0; }
.agent-name { display: block; font-weight: 600; color: var(--white); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--sidebar-text);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  width: 100%;
  margin-top: 3px;
}
.sidebar-section { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.section-title {
  padding: 12px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge {
  background: var(--orange);
  color: var(--white);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}
.badge-green { background: var(--green-dark); }
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.conversation-list::-webkit-scrollbar { width: 4px; }
.conversation-list::-webkit-scrollbar-track { background: transparent; }
.conversation-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.conv-item:hover, .conv-item.active { background: var(--sidebar-hover); }
.conv-item.active { background: rgba(39,174,96,0.25); }
.conv-avatar {
  width: 38px; height: 38px;
  background: var(--purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--white);
  font-size: 15px;
  flex-shrink: 0;
}
.conv-avatar-green { background: var(--green-dark); }
.conv-avatar-large { width: 44px; height: 44px; font-size: 18px; }
.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.conv-avatar-wrap .conv-avatar { flex-shrink: 0; }
.channel-badge { position: absolute; bottom: -2px; right: -2px; width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 8px; border: 2px solid var(--sidebar-bg); color: #fff; line-height: 1; }
.channel-badge-whatsapp { background: #25D366; }
.channel-badge-instagram { background: #C13584; }
.channel-badge-facebook { background: #0084FF; }
.contact-channel-label { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 12px; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-owner {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
}
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time { font-size: 11px; color: rgba(255,255,255,0.3); }
.unread-badge { background: var(--green); color: var(--white); border-radius: 10px; padding: 1px 6px; font-size: 11px; font-weight: 700; }
.btn-assign {
  background: var(--orange);
  border: none;
  color: var(--white);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.btn-assign:hover { background: #d4561f; }
.empty-state { text-align: center; padding: 20px; color: rgba(255,255,255,0.2); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state i { font-size: 20px; }
.btn-new-conv {
  background: var(--orange);
  border: none;
  color: var(--white);
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 8px;
  transition: background 0.15s;
}
.btn-new-conv:hover { background: #d4561f; }
.btn-new-contact {
  background: var(--primary);
  border: none;
  color: var(--white);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.15s;
}
.btn-new-contact:hover { background: var(--primary-dark); }

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-box-lg {
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
}
.contact-modal-section {
  border-top: 1px solid var(--gray-200);
  margin-top: 20px;
  padding-top: 16px;
}
.contact-modal-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header h3 i { color: var(--green); font-size: 20px; }
.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--danger); }
.contact-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.suggestion-item:hover { background: var(--gray-100); }
.suggestion-avatar {
  width: 34px; height: 34px;
  background: var(--purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.suggestion-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.suggestion-phone { font-size: 12px; color: var(--gray-600); }
.meta-api-banner {
  background: #e8f4fd;
  border: 1px solid #b3d9f5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1a5f8a;
  line-height: 1.4;
}
.meta-api-banner i { margin-right: 6px; color: #25d366; }
.meta-window-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff7e6;
  border: 1px solid #f5c56f;
  color: #6f4b05;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.meta-direct-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff1f1;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.meta-direct-notice strong {
  display: block;
  color: #6b1a1a;
  margin-bottom: 2px;
}
.meta-direct-notice span {
  display: block;
  line-height: 1.35;
}
.meta-human-agent-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.meta-human-agent-notice strong {
  display: block;
  color: #6b2d00;
  margin-bottom: 2px;
}
.meta-human-agent-notice span {
  display: block;
  line-height: 1.35;
}
.meta-window-notice strong {
  display: block;
  color: #4f3500;
  margin-bottom: 2px;
}
.meta-window-notice span {
  display: block;
  line-height: 1.35;
}
.btn-meta-template {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  padding: 8px 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.btn-meta-template:hover { background: var(--purple-light); }
.template-preview-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-top: -4px;
  margin-bottom: 8px;
}

/* ====== SIDEBAR TABS ====== */
.sidebar-tabs {
  display: flex;
  padding: 8px 8px 0;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sidebar-tab.active {
  color: var(--white);
  border-bottom-color: var(--orange);
}
.active-filter-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  padding: 5px 0;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.active-filter-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
  font-weight: 600;
}
.sidebar-tab-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-tab-content.hidden { display: none; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--white); }
.sidebar-link-danger:hover { background: rgba(220,53,69,0.15); color: var(--danger); }

/* ====== CHAT AREA ====== */
.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.chat-topbar {
  min-height: 52px;
  padding: 10px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-topbar-company {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-800);
  font-weight: 600;
}
.chat-topbar-company i { color: var(--primary); }
.chat-topbar-company span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-topbar-change {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(39,174,96,0.3);
  transition: all 0.2s;
}
.chat-topbar-change:hover {
  background: rgba(39,174,96,0.08);
  border-color: rgba(39,174,96,0.5);
}
.chat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(39,174,96,0.3);
  transition: all 0.2s;
  white-space: nowrap;
}
.topbar-btn:hover {
  background: rgba(39,174,96,0.08);
  border-color: rgba(39,174,96,0.5);
}
.topbar-btn.active {
  background: rgba(39,174,96,0.12);
  border-color: rgba(39,174,96,0.5);
}
.topbar-btn-danger {
  color: var(--danger);
  border-color: rgba(220,53,69,0.25);
}
.topbar-lang-switcher { display: flex; align-items: center; gap: 2px; }
.topbar-lang-btn { font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 10px; border: 1px solid var(--gray-200); background: transparent; color: var(--gray-500); cursor: pointer; transition: background .15s, color .15s; line-height: 1.4; }
.topbar-lang-btn:hover { background: rgba(39,174,96,0.08); color: var(--gray-700); border-color: rgba(39,174,96,0.3); }
.topbar-lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.topbar-btn-danger:hover {
  background: rgba(220,53,69,0.08);
  border-color: rgba(220,53,69,0.45);
}
.topbar-company-clickable { cursor: pointer; }
.topbar-company-clickable:hover { opacity: .8; }
.topbar-company-select {
  border: none; outline: none; background: transparent;
  color: inherit; font-weight: inherit; font-size: inherit;
  cursor: pointer; min-width: 0;
  font-family: inherit;
}
.topbar-menu {
  position: relative;
  flex-shrink: 0;
}
/* Ponte invisível que cobre o gap entre o botão e o painel, evitando que o
   hover se perca quando o mouse transita do trigger para o dropdown */
.topbar-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
}
.topbar-menu-trigger {
  background: var(--white);
}
.topbar-menu-trigger .fa-chevron-down {
  font-size: 10px;
  margin-left: 2px;
}
.topbar-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1200;
  width: 230px;
  padding: 6px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(18,19,38,0.16);
  display: none;
}
.topbar-menu:hover .topbar-menu-panel,
.topbar-menu:focus-within .topbar-menu-panel {
  display: block;
}
.topbar-menu-panel a,
.topbar-menu-muted {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar-menu-panel a:hover {
  background: #f0faf4;
  color: var(--primary-dark);
}
.topbar-menu-panel i {
  width: 16px;
  text-align: center;
  color: var(--primary);
}
.topbar-menu-muted {
  color: var(--gray-500);
  opacity: 0.75;
  cursor: default;
}
.topbar-menu-muted i {
  color: var(--gray-500);
}
.chat-header {
  background: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  z-index: 1;
}
.observer-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #7c5b00;
}
.observer-banner i { color: #f57f17; }
.observer-takeover-btn {
  padding: 8px 12px;
  font-size: 12px;
}
.chat-contact { display: flex; align-items: center; gap: 12px; }
.contact-name { font-weight: 700; font-size: 16px; }
.contact-phone { font-size: 12px; color: var(--gray-600); }
.chat-actions { display: flex; gap: 8px; }
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.messages-container::-webkit-scrollbar { width: 5px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }

.message { display: flex; margin-bottom: 4px; }
.message-contact { justify-content: flex-start; }
.message-agent   { justify-content: flex-end; }
.message-bot     { justify-content: flex-end; }
.message-system  { justify-content: center; }
.system-message {
  background: rgba(0,0,0,0.05);
  color: var(--gray-600);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-style: italic;
}
.message        { margin-bottom: 6px; }
.message-bubble {
  min-width: 90px;
  padding: 8px 12px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
}
.message-contact .message-bubble {
  background: var(--white);
  border-bottom-left-radius: 4px;
}
.message-agent .message-bubble {
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}
.message-bot .message-bubble {
  background: #ede7ff;
  border-bottom-right-radius: 4px;
}
.message-sender { font-size: 11px; font-weight: 700; color: var(--purple); margin-bottom: 3px; }
.message-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; }
.msg-contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}
.msg-contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.msg-contact-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.msg-contact-info strong {
  color: var(--gray-800);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.msg-contact-info span {
  color: var(--gray-600);
  font-size: 12px;
}
.msg-contact-info i {
  font-size: 10px;
  margin-right: 4px;
}

/* ── Agrupamento: mesmo remetente < 2 min ───────────────────────────────── */
.msg-grouped                              { margin-top: -3px !important; }
.message-contact.msg-grouped .message-bubble { border-top-left-radius:  4px; }
.message-agent.msg-grouped   .message-bubble { border-top-right-radius: 4px; }
.message-bot.msg-grouped     .message-bubble { border-top-right-radius: 4px; }
.message-time { font-size: 11px; color: var(--gray-600); text-align: right; margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.msg-delivery { font-size: 11px; color: var(--gray-500); }
.msg-delivery-read { color: #2b8cff; }
.msg-delivery-failed { color: #e53935; }
.msg-delivery-pending { color: var(--gray-400); }

/* ── Wrapper para burbuja + botão de resposta ───────────────────────── */
.msg-row { display: flex; align-items: center; gap: 4px; max-width: 65%; }
.message-agent .msg-row,
.message-bot   .msg-row { flex-direction: row-reverse; }

/* Botão de responder (aparece no hover da linha) */
.btn-reply-msg {
  display: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--gray-600);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: all .15s;
  padding: 0;
}
.msg-row:hover .btn-reply-msg { display: flex; }
.btn-reply-msg:hover { border-color: var(--purple); color: var(--purple); background: #f3eeff; }

.btn-edit-msg, .btn-delete-msg {
  display: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: var(--gray-600);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  transition: all .15s;
  padding: 0;
}
.msg-row:hover .btn-edit-msg,
.msg-row:hover .btn-delete-msg { display: flex; }
.btn-edit-msg:hover { border-color: var(--primary); color: var(--primary); background: #eafaf1; }
.btn-delete-msg:hover { border-color: #e74c3c; color: #e74c3c; background: #fef2f2; }

.msg-deleted-text { font-style: italic; color: var(--gray-500); font-size: .88em; }
.msg-deleted-text .fa-ban { margin-right: 4px; }
.msg-edited-badge { font-size: .72em; color: var(--gray-400); font-style: italic; margin-right: 4px; }

.msg-edit-textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--primary);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: .9em;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: var(--white);
  color: var(--gray-800);
  min-height: 56px;
}
.msg-edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.btn-msg-edit-confirm, .btn-msg-edit-cancel {
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: .82em;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.btn-msg-edit-confirm { background: var(--primary); color: #fff; }
.btn-msg-edit-confirm:hover { background: var(--primary-dark); }
.btn-msg-edit-cancel { background: var(--gray-200); color: var(--gray-700); }
.btn-msg-edit-cancel:hover { background: var(--gray-300); }

/* Bloco de citação dentro da bolha */
.quoted-msg {
  background: rgba(0,0,0,.05);
  border-left: 3px solid var(--purple);
  border-radius: 6px;
  padding: 5px 9px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background .15s;
  overflow: hidden;
}
.quoted-msg:hover { background: rgba(0,0,0,.09); }
.message-agent .quoted-msg { border-left-color: #25a244; }
.quoted-sender { font-size: 11px; font-weight: 700; color: var(--purple); margin-bottom: 1px; }
.message-agent .quoted-sender { color: #25a244; }
.quoted-text { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Barra de resposta acima do input */
.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f0ebfa;
  border-left: 3px solid var(--purple);
  border-radius: 8px;
  padding: 7px 12px;
  margin-bottom: 8px;
}
.reply-bar-preview { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.reply-bar-icon { color: var(--purple); font-size: 13px; flex-shrink: 0; }
.reply-bar-sender { font-size: 11px; font-weight: 700; color: var(--purple); }
.reply-bar-text { font-size: 12px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-cancel-reply { background: none; border: none; color: #999; cursor: pointer; font-size: 14px; padding: 3px; flex-shrink: 0; }
.btn-cancel-reply:hover { color: #333; }

/* Flash de destaque ao navegar para mensagem citada */
@keyframes msgHighlight {
  0%, 100% { background: transparent; }
  50% { background: rgba(90,45,145,.14); }
}
.msg-highlight .message-bubble { animation: msgHighlight .55s ease-in-out 3; border-radius: 16px; }
/* ====== QUICK REPLIES ====== */
.qr-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}
.qr-popup-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}
.qr-popup-item:last-child { border-bottom: none; }
.qr-popup-item:hover { background: #f3eeff; }
.qr-popup-title { font-size: 13px; font-weight: 700; color: var(--purple); margin-bottom: 3px; }
.qr-popup-title i { color: var(--orange); margin-right: 4px; }
.qr-popup-preview { font-size: 12px; color: var(--gray-600); }

/* Quick replies settings */
.quick-replies-list { display: flex; flex-direction: column; gap: 10px; }
.qr-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.qr-info { flex: 1; min-width: 0; }
.qr-title { font-size: 14px; font-weight: 700; color: var(--purple); margin-bottom: 4px; }
.qr-title i { color: var(--orange); margin-right: 6px; }
.qr-content { font-size: 13px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty-card {
  text-align: center;
  padding: 48px 20px;
  background: var(--white);
  border-radius: var(--radius);
  color: var(--gray-400);
  box-shadow: var(--shadow);
}
.empty-card i { font-size: 36px; margin-bottom: 12px; display: block; }
.empty-card p { font-size: 15px; font-weight: 600; color: var(--gray-600); }
.empty-card small { font-size: 13px; }

.msg-image { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; cursor: pointer; }
.msg-sticker { max-width: 160px; max-height: 160px; display: block; background: transparent; }
.msg-video { max-width: 260px; border-radius: 8px; display: block; }
.msg-audio { width: 220px; max-width: 100%; margin: 4px 0; display: block; }
.msg-media-unavailable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  color: var(--gray-600);
  font-size: 13px;
  font-style: italic;
}
.msg-media-unavailable i { font-size: 16px; opacity: 0.7; }
.msg-document { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.06); border-radius: 8px; padding: 10px 14px; color: var(--purple); font-weight: 600; text-decoration: none; }
.msg-document:hover { background: rgba(0,0,0,0.1); }
.message-caption { font-size: 13px; margin-top: 6px; color: var(--gray-800); }

/* Cards de produto e catálogo no chat */
.msg-product-card { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.06); max-width: 280px; }
.msg-product-img { width: 80px; height: 80px; object-fit: cover; flex-shrink: 0; }
.msg-product-body { padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg-product-name { font-weight: 700; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-product-price { font-size: 12.5px; color: #27ae60; font-weight: 700; }
.msg-product-link { font-size: 11.5px; color: #2980b9; text-decoration: none; margin-top: 4px; white-space: nowrap; }
.msg-product-link:hover { text-decoration: underline; }
.msg-catalog-card { border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.06); max-width: 280px; }
.msg-catalog-banner { width: 100%; max-height: 110px; object-fit: cover; display: block; }
.msg-catalog-icon { background: linear-gradient(135deg,#27ae60,#2ecc71); color: #fff; display: flex; align-items: center; justify-content: center; height: 56px; font-size: 22px; }
.msg-catalog-body { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.msg-catalog-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Botão enviar catálogo no painel de produtos */
.btn-send-catalog { width: 100%; padding: 9px 14px; margin-bottom: 8px; background: #eafaf1; border: 1px solid #a9dfbf; border-radius: 8px; color: #1e8449; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; justify-content: center; transition: background .15s; }
.btn-send-catalog:hover { background: #d5f5e3; }
.btn-send-catalog:disabled { opacity: .5; cursor: default; }

.chat-input-area {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 16px 24px;
  position: relative;
}
.chat-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.15s;
}
.tab-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.tab-content.hidden { display: none; }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-row textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  resize: none;
  transition: border-color 0.2s;
  background: var(--gray-100);
  line-height: 1.5;
}
.input-row textarea:focus { border-color: var(--primary); background: var(--white); }
.btn-attach {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 16px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-attach:hover { border-color: var(--primary); color: var(--primary); }
.btn-mic { color: var(--gray-600); }
.btn-mic:hover { border-color: #e53935; color: #e53935; }

/* Barra de gravação de áudio */
.audio-record-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff0f0;
  border-radius: 12px;
  border: 1.5px solid #ffcdd2;
  margin-bottom: 6px;
}
.audio-record-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #e53935;
  animation: recordPulse 1s infinite;
  flex-shrink: 0;
}
@keyframes recordPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.audio-record-timer {
  font-weight: 700;
  font-size: 15px;
  color: #e53935;
  min-width: 36px;
}
.audio-record-label {
  flex: 1;
  font-size: 13px;
  color: var(--gray-700);
}
.btn-cancel-record {
  background: none;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 13px;
}
.btn-cancel-record:hover { border-color: #e53935; color: #e53935; }
.btn-stop-record {
  background: var(--purple);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-stop-record:hover { background: var(--purple-light); }
.btn-stop-record:disabled { opacity: 0.6; cursor: default; }
.attach-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--gray-800);
}
.attach-preview span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-remove-attach {
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-remove-attach:hover { color: var(--danger); }
.btn-send {
  background: var(--purple);
  border: none;
  color: var(--white);
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.btn-send:hover { background: var(--purple-light); }
.btn-send.btn-note { background: var(--orange); }
.btn-send.btn-note:hover { background: #d4561f; }

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  gap: 12px;
}
.chat-empty i { font-size: 64px; color: var(--green); opacity: 0.4; }
.chat-empty h3 { font-size: 20px; color: var(--gray-600); }
.chat-empty p { color: var(--gray-400); }

/* ====== INFO PANEL ====== */
.info-panel {
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 0;
}
.info-panel::-webkit-scrollbar { width: 4px; }
.info-panel::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
.info-section {
  padding: 20px;
  border-bottom: 1px solid var(--gray-100);
}
.info-section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
}
.info-row label { color: var(--gray-600); font-weight: 500; }
.info-row span { color: var(--gray-800); font-weight: 600; text-align: right; }
.transfer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 0;
  color: var(--gray-600);
}
.transfer-item i { color: var(--orange); }
.note-item {
  background: #fffde7;
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.note-author { font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 4px; }
.note-content { font-size: 13px; line-height: 1.4; }
.note-time { font-size: 11px; color: var(--gray-600); margin-top: 4px; }
.empty-text { font-size: 12px; color: var(--gray-400); font-style: italic; }
.btn-edit-contact {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 11px;
  margin-left: auto;
  transition: all 0.15s;
}
.btn-edit-contact:hover { border-color: var(--purple); color: var(--purple); }
.agent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.agent-mini-avatar {
  width: 30px; height: 30px;
  background: var(--purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.btn-transfer-agent {
  background: var(--purple);
  color: var(--white);
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-left: auto;
  transition: background 0.15s;
}
.btn-transfer-agent:hover { background: var(--purple-light); }
.btn-transfer-sector {
  background: var(--orange);
  color: var(--white);
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-left: auto;
}
.btn-transfer-sector:hover { background: #d4561f; }
.transfer-subtitle {
  font-size: 11px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 6px 0;
}
/* Popover de transferência */
.transfer-popover {
  position: fixed;
  z-index: 1200;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  width: 300px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  animation: popover-in .12s ease;
}
@keyframes popover-in {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.transfer-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: var(--purple);
  color: var(--white);
  font-weight: 600;
  font-size: 13px;
}
.transfer-popover-close {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  opacity: .7;
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 4px;
  transition: all .15s;
  line-height: 1;
}
.transfer-popover-close:hover { opacity: 1; background: rgba(255,255,255,.2); }
.transfer-popover-body {
  padding: 12px 16px;
  max-height: 340px;
  overflow-y: auto;
}

/* ====== STATUS DOTS ====== */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-online { background: var(--green); }
.status-busy { background: var(--orange); }
.status-offline { background: var(--gray-400); }

/* ====== ADMIN ====== */
.admin-page { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h2 { font-size: 22px; font-weight: 700; color: var(--purple); display: flex; align-items: center; gap: 10px; }
.admin-grid { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: var(--gray-800); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); }
.table td { padding: 12px 12px; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.badge-role { padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-role-admin { background: #ede7f6; color: var(--purple); }
.badge-role-supervisor { background: #e3f2fd; color: #1565c0; }
.badge-role-agent { background: var(--gray-100); color: var(--gray-600); }
.mt-2 { margin-top: 12px; }

/* ====== SETTINGS ====== */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}
.settings-nav {
  background: var(--sidebar-bg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.settings-brand i { font-size: 22px; color: var(--green); }
.settings-brand span { font-size: 17px; font-weight: 700; color: var(--white); }
.settings-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.15s;
}
.settings-back:hover { background: var(--sidebar-hover); color: var(--white); }
.settings-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.settings-link:hover, .settings-link.active {
  background: rgba(90,45,145,0.4);
  color: var(--white);
}
.settings-link--sub {
  padding-left: 32px;
  font-size: 12px;
  color: var(--sidebar-text);
  opacity: .85;
  position: relative;
}
.settings-link--sub::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(255,255,255,.35);
}
.settings-link--sub:hover, .settings-link--sub.active {
  opacity: 1;
}
.settings-content {
  overflow-y: auto;
  padding: 36px 40px;
  background: var(--bg);
  width: 100%;
  min-width: 0;
}
.settings-topbar {
  min-height: 52px;
  padding: 10px 18px;
  margin: -36px -40px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-topbar-company {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-800);
  font-weight: 600;
}
.settings-topbar-company i { color: var(--primary); }
.settings-topbar-company span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-topbar-change {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(39,174,96,0.3);
  transition: all 0.2s;
}
.settings-topbar-change:hover {
  background: rgba(39,174,96,0.08);
  border-color: rgba(39,174,96,0.5);
}
.settings-section {
  max-width: none;
  width: 100%;
  min-width: 0;
}
.settings-section.hidden { display: none; }
.dashboard-period {
  color: var(--gray-600);
  font-size: 13px;
  margin-bottom: 14px;
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.kpi-label {
  color: var(--gray-600);
  font-size: 12px;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: var(--purple);
}
.kpi-card--wide {
  flex: 1;
  min-width: 200px;
}
.kpi-hint {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
}
.settings-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 10px;
}
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.agent-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.agent-card-avatar {
  width: 44px; height: 44px;
  background: var(--purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: var(--white);
  flex-shrink: 0;
}
.agent-card-info { flex: 1; min-width: 0; }
.agent-card-name { font-weight: 700; font-size: 14px; color: var(--gray-800); }
.agent-card-email { font-size: 12px; color: var(--gray-600); margin: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-card-meta { display: flex; align-items: center; gap: 6px; }
.agent-card-status { font-size: 11px; color: var(--gray-600); }
.agent-card-actions { flex-shrink: 0; }
.agent-card--inactive { opacity: 0.55; }
.agents-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.agent-filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--surface);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.agent-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.agent-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.agents-filter-empty { display: none; padding: 32px; text-align: center; color: var(--gray-500); font-size: 13px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 8px 10px;
}
.checkbox-item input { width: auto; }
.sector-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.sector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sector-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  overflow: hidden;
}
.sector-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.sector-name-input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
}
.sector-labels-block {
  border-top: 1px solid var(--gray-100);
  padding: 12px 14px;
  background: var(--gray-100);
}
.sector-labels-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
}
.sector-labels-header i { color: var(--purple); }
.sector-labels-hint {
  margin-left: 4px;
  font-weight: 400;
  color: var(--gray-500);
  font-size: 11px;
}
.sector-labels-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sector-label-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.sector-label-check:has(input:checked) {
  border-color: var(--purple);
  background: #f0ebfa;
  color: var(--purple);
}
.sector-label-check input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--purple);
  flex-shrink: 0;
}
.sl-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sector-labels-empty { font-size: 12px; color: var(--gray-500); }
.sector-actions {
  display: flex;
  gap: 8px;
}

/* ====== ETIQUETAS & STATUS ====== */
.ls-help {
  font-size: 13px;
  color: var(--gray-600);
  background: #f5f1ff;
  border: 1px solid #e7ddff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.ls-help i { color: var(--purple); margin-right: 4px; }

/* Linha de criar etiqueta */
.ls-create {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.ls-create-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  background: #f5f1ff;
  color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.ls-create input[type="text"] {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
}
.ls-create input[type="text"]:focus { border-color: var(--purple); outline: none; }

/* Campo de cor compacto */
.ls-color-field {
  width: 40px; height: 38px;
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  cursor: pointer;
  position: relative;
}
.ls-color-field input[type="color"] {
  width: 150%; height: 150%;
  margin: -25%;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* Lista de etiquetas */
.ls-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.ls-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ls-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.ls-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}
.ls-name {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  background: transparent;
  transition: all 0.15s;
}
.ls-name:hover { background: var(--gray-100); }
.ls-name:focus { background: var(--white); border-color: var(--purple); outline: none; }
.ls-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ls-head-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Bloco de status */
.ls-status-block {
  background: #fafbff;
  border-top: 1px solid var(--gray-100);
  padding: 12px 16px 14px;
}
.status-list { display: flex; flex-direction: column; gap: 8px; }
.ls-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  padding: 6px 10px;
}
.ls-grip { color: var(--gray-400); font-size: 12px; cursor: grab; flex-shrink: 0; }
.ls-status-row .ls-name { font-weight: 500; }

/* Setas de reordenação de status */
.ls-move {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.btn-move {
  width: 22px; height: 17px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  border-radius: 5px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  padding: 0;
  transition: all 0.15s;
}
.btn-move:hover { border-color: var(--purple); color: var(--purple); background: #f5f1ff; }
.btn-move:active { transform: scale(0.92); }
.ls-order {
  width: 64px;
  flex-shrink: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  text-align: center;
}
.ls-order:focus { border-color: var(--purple); outline: none; }
.ls-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ls-empty {
  font-size: 13px;
  color: var(--gray-400);
  font-style: italic;
  padding: 6px 2px 10px;
}

/* Adicionar status */
.ls-add-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--gray-200);
}
.ls-add-icon { color: var(--green); font-size: 12px; flex-shrink: 0; }
.ls-add-status input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.ls-add-status input[type="text"]:focus { border-color: var(--purple); outline: none; }

/* ── Etiquetas master-detail (ls2) ──────────────────────────────────────────── */
.ls2-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 680px) {
  .ls2-layout { grid-template-columns: 1fr; }
}

/* Sidebar (lista) */
.ls2-sidebar {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.ls2-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--gray-200);
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--gray-100);
}
.ls2-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s;
}
.ls2-item:last-child { border-bottom: none; }
.ls2-item:hover  { background: #f5f0ff; }
.ls2-item.active { background: #ede6fa; }
.ls2-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ls2-iname { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ls2-badge { font-size: 10px; background: var(--gray-200); color: var(--gray-600); padding: 1px 7px; border-radius: 100px; flex-shrink: 0; white-space: nowrap; }
.ls2-item.active .ls2-badge { background: #d5c8f0; color: var(--purple); }
.ls2-ibtns { display: none; gap: 4px; flex-shrink: 0; }
.ls2-item:hover .ls2-ibtns { display: flex; }
.ls2-list-empty { padding: 24px 16px; text-align: center; font-size: 12px; color: #aaa; line-height: 1.6; }

/* Painel de detalhe */
.ls2-detail-panel {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
  min-height: 380px;
}
.ls2-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--gray-500);
  text-align: center;
  gap: 14px;
}
.ls2-placeholder i { font-size: 40px; opacity: .2; }
.ls2-placeholder p { font-size: 14px; line-height: 1.6; }
.ls2-pane-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-100);
}
.ls2-fields-row { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 14px; }
.ls2-color-pick {
  width: 52px; height: 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  padding: 3px;
  background: var(--white);
}

/* Sub-níveis */
.ls2-sub-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--gray-100);
}
.ls2-sub-title { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.ls2-sub-hint  { font-size: 11px; color: #bbb; }
.ls2-sub-list  { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-height: 10px; }
.ls2-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: 8px;
  transition: background .15s;
  border: 1.5px solid transparent;
}
.ls2-sub-row:hover { background: #f0ebfa; border-color: #d5c8f0; }
.ls2-sub-order { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.ls2-sub-inp {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 13px;
  transition: all .15s;
}
.ls2-sub-inp:focus { border-color: var(--purple); background: var(--white); outline: none; }
.ls2-sub-row-btns { display: flex; gap: 4px; flex-shrink: 0; }
.ls2-subs-empty { font-size: 12px; color: #bbb; padding: 10px 0; text-align: center; }
.ls2-sub-add-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.ls2-sub-add-row input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 13px;
  background: var(--gray-100);
  transition: all .15s;
}
.ls2-sub-add-row input:focus { border-color: var(--purple); background: var(--white); outline: none; }

.qr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.qr-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qr-filters input,
.qr-filters select {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 220px;
}
.qr-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow-x: hidden;
  overflow-y: hidden;
  width: 100%;
}
.qr-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.qr-table th {
  text-align: left;
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.qr-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.qr-row:last-child td { border-bottom: none; }
.qr-name { font-weight: 700; color: var(--gray-800); }
.qr-text {
  color: var(--gray-800);
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qr-dept { color: var(--gray-600); }
.qr-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #ede7f6;
  color: var(--purple);
}
.qr-col-actions { width: 140px; min-width: 140px; }
.qr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qr-table th:nth-child(1), .qr-table td:nth-child(1) { width: 15%; }
.qr-table th:nth-child(2), .qr-table td:nth-child(2) { width: 33%; }
.qr-table th:nth-child(3), .qr-table td:nth-child(3) { width: 16%; }
.qr-table th:nth-child(4), .qr-table td:nth-child(4) { width: 13%; }
.qr-table th:nth-child(5), .qr-table td:nth-child(5) { width: 10%; }
.qr-table th:nth-child(6), .qr-table td:nth-child(6) { width: 8%; }
.qr-table th:nth-child(7), .qr-table td:nth-child(7) { width: 95px; }
/* ── Provider selector ─────────────────────────────────────────────────────── */
.provider-option { display:block; cursor:pointer; }
.provider-option input[type="radio"] { display:none; }
.provider-card {
  display:flex; align-items:flex-start; gap:14px;
  border:2px solid #e2e8f0; border-radius:12px; padding:16px 20px;
  background:#fff; transition:border-color .15s, box-shadow .15s;
  min-width:220px; max-width:340px;
}
.provider-card p { margin:4px 0 0; font-size:0.83em; color:#666; }
.provider-icon { font-size:28px; color:#25d366; flex-shrink:0; margin-top:2px; }
.provider-option input:checked + .provider-card {
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}
.settings-card {
  background:#fff; border-radius:var(--radius); padding:28px;
  box-shadow:var(--shadow); max-width:680px;
}

.wa-status-card, .profile-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 500px;
}
.profile-form .form-group { margin-bottom: 10px; }
.btn-profile-save {
  padding: 6px 18px;
  border-radius: 6px;
  border: none;
  font-size: .875rem;
  font-weight: 600;
  background: var(--gray-300, #dee2e6);
  color: var(--gray-500, #adb5bd);
  cursor: not-allowed;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.btn-profile-save.dirty {
  background: #27ae60;
  color: #fff;
  cursor: pointer;
}
.btn-profile-save.dirty:hover { background: #219653; }
/* ── Avatar de perfil na página de configurações ── */
.profile-avatar-wrap {
  position: relative;
  width: 80px;
  margin: 0 auto 24px;
}
.profile-avatar {
  width: 80px; height: 80px;
  background: var(--purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--white);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.btn-avatar-cam {
  position: absolute;
  bottom: 0; right: 0;
  width: 26px; height: 26px;
  background: var(--purple);
  border: 2px solid var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--white);
  font-size: 11px;
  transition: background .15s;
}
.btn-avatar-cam:hover { background: var(--purple-dark, #5a2fc2); }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* ====== TOAST ====== */
.toast-wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  font-size: 14px;
  font-weight: 600;
  border-left: 4px solid var(--gray-400);
  opacity: 0;
  transform: translateX(120%);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast i { font-size: 18px; }
.toast-ok { border-left-color: #2e9e5b; color: #1e6b3e; }
.toast-ok i { color: #2e9e5b; }
.toast-err { border-left-color: var(--danger); color: #a52834; }
.toast-err i { color: var(--danger); }

/* ====== KANBAN ====== */
.kanban-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #eceef8;
  overflow: hidden;
}
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.kanban-toolbar label { font-weight: 600; color: var(--gray-700); font-size: 14px; }
.kanban-toolbar label i { color: var(--purple); margin-right: 4px; }
.kanban-toolbar select {
  border: 1px solid var(--gray-300);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 260px;
  background: var(--white);
}
.kanban-toolbar select:focus { border-color: var(--purple); outline: none; }
.kanban-hint { color: var(--gray-500); font-size: 13px; }

.kanban-board {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}
.kanban-loading, .kanban-empty {
  margin: 30px auto;
  color: var(--gray-500);
  font-size: 14px;
}
.kanban-empty i { color: var(--purple); margin-right: 6px; }

.kanban-col {
  flex: 0 0 272px;
  width: 272px;
  max-height: 100%;
  background: var(--white);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(90,45,145,0.06);
  transition: border-color 0.15s;
  overflow: hidden;
}
.kanban-col.drag-over { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(90,45,145,0.1); }
.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.kanban-col-title { font-size: 14px; font-weight: 700; color: var(--gray-800); flex: 1; }
.kanban-col-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
}
.kanban-col-count:empty { display: none; }
.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-card {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 12px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.kanban-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.11); border-color: var(--gray-300); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; transform: translateY(0); }
.kanban-card.dragging { opacity: 0.45; transform: scale(1.02); }
.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kanban-card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #ede5f9;
  color: var(--purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.kanban-card-open {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border: 0;
  border-radius: 7px;
  background: #e8f5e9;
  color: var(--green-dark);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  margin-left: auto;
}
.kanban-card-open:hover { background: #d5efda; }
.kanban-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-card-avatar {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.kanban-card-info { flex: 1; min-width: 0; }
.kanban-card-name { font-weight: 600; font-size: 13px; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-phone { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.kanban-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 19, 38, 0.55);
}
.kanban-modal-card {
  position: relative;
  width: min(440px, 100%);
  padding: 26px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
}
.kanban-modal-card h3 { margin: 0 0 18px; color: var(--purple); }
.kanban-modal-card h3 i { margin-right: 8px; }
.kanban-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}
.kanban-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ====== WHATSAPP STATUS ====== */
.whatsapp-card { max-width: 500px; margin: 0 auto; text-align: center; }
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 24px;
}
.status-indicator i { font-size: 28px; }
.status-indicator.status-connected { background: #1a9e4a !important; color: #fff !important; }
.status-indicator.status-qr_pending { background: #fff8e1 !important; color: #f57f17 !important; }
.status-indicator.status-disconnected { background: var(--gray-100) !important; color: var(--gray-600) !important; }
.wa-actions { display: flex; justify-content: center; gap: 12px; }

/* ====== LANDING ====== */
.landing-page {
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(1000px 500px at 80% 15%, rgba(240, 100, 35, 0.22), transparent 60%),
    radial-gradient(700px 400px at 10% 90%, rgba(37, 211, 102, 0.18), transparent 60%),
    linear-gradient(135deg, #121326 0%, #1a1a2e 45%, #25163f 100%);
  padding: 24px 36px 40px;
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 42px;
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
}
.landing-brand i { color: var(--green); }
.landing-login-btn {
  padding: 10px 18px;
  border-radius: 10px;
}
.landing-hero {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.landing-hero-content {
  padding: 28px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}
.landing-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  color: #fef3e9;
  background: rgba(240, 100, 35, 0.26);
  border: 1px solid rgba(240, 100, 35, 0.5);
}
.landing-hero-content h1 {
  font-size: 44px;
  line-height: 1.08;
  margin-bottom: 16px;
}
.landing-hero-content p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 22px;
}
.landing-cta {
  display: flex;
  gap: 12px;
}
.landing-card {
  padding: 28px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
}
.landing-card h3 {
  font-size: 24px;
  margin-bottom: 16px;
}
.landing-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.landing-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.92);
}
.landing-card li i { color: var(--green); }

@media (max-width: 920px) {
  .landing-page { padding: 16px; }
  .landing-brand { font-size: 26px; }
  .landing-hero {
    grid-template-columns: 1fr;
  }
  .landing-hero-content h1 {
    font-size: 30px;
  }
  .landing-cta {
    flex-direction: column;
  }
}

/* ── Chatbot admin — Drawflow visual editor ─────────────────────────────────── */

/* ── Lista de fluxos ────────────────────────────────────────── */
.cb-flows-header  { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cb-flows-title   { font-weight:700; font-size:14px; color:var(--gray-700); }
.cb-btn-new-flow  { padding:5px 12px; font-size:13px; }
.cb-flows-list    { display:flex; flex-wrap:wrap; gap:10px; min-height:44px; }
.cb-flows-empty,
.cb-flows-loading { color:#aaa; font-size:13px; padding:10px 0; }

.cb-flow-card {
  display:flex; align-items:center; gap:12px;
  background:#fff; border:1.5px solid #e5e7eb; border-radius:10px;
  padding:10px 14px; min-width:200px; max-width:320px;
  box-shadow:0 1px 3px rgba(0,0,0,.05); transition:border-color .15s, box-shadow .15s;
}
.cb-flow-card:hover         { border-color:var(--purple); box-shadow:0 2px 8px rgba(99,40,200,.1); }
.cb-flow-card.cb-flow-card-active { border-color:var(--purple); background:#f8f5ff; }
.cb-flow-card-body  { flex:1; min-width:0; }
.cb-flow-card-name  { font-weight:600; font-size:14px; color:var(--gray-800); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cb-flow-card-badges { display:flex; gap:6px; align-items:center; margin-top:4px; flex-wrap:wrap; }
.cb-flow-badge-active   { background:#dcf8c6; color:#176b37; font-size:11px; font-weight:700; padding:1px 7px; border-radius:20px; }
.cb-flow-badge-inactive { background:#f3f4f6; color:#9ca3af; font-size:11px; font-weight:600; padding:1px 7px; border-radius:20px; }
.cb-flow-meta       { font-size:11px; color:#aaa; }
.cb-flow-card-btns  { display:flex; gap:6px; align-items:center; flex-shrink:0; }
.cb-btn-xs          { padding:4px 10px !important; font-size:12px !important; }
.cb-editing-badge   { font-size:12px; color:var(--purple); font-weight:600; white-space:nowrap; }

/* Config bar */
.cb-config-bar { margin-bottom:10px; padding:14px 16px; }
.cb-config-row  { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.cb-toggle-label { display:flex; align-items:center; gap:7px; cursor:pointer; white-space:nowrap; font-size:13px; user-select:none; }

/* Paleta de nós */
.cb-palette     { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.cb-pal-label   { font-size:12px; color:#888; font-weight:600; white-space:nowrap; }
.cb-pal-btn     { font-size:12px; padding:5px 11px; background:#fff; border:1.5px solid #e0e0e0; border-radius:20px; cursor:pointer; transition:all .15s; white-space:nowrap; }
.cb-pal-btn:hover { background:var(--purple); color:#fff; border-color:var(--purple); }

/* Canvas Drawflow */
.cb-canvas-wrap {
  width:100%; height:780px;
  border:1.5px solid #e0e0e0; border-radius:10px;
  overflow:hidden; background:#f8f8fb;
  position:relative; margin-bottom:16px;
}
#cbDrawflow { width:100%; height:100%; }

.cb-canvas-hint {
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; pointer-events:none;
  color:#aaa; font-size:13px; text-align:center;
}

/* ── Nós no canvas ─────────────────────────────────────────────────────────── */
#cbDrawflow .drawflow-node {
  padding:0 !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  border-radius:10px !important;
  overflow:visible !important;
  min-height:unset !important;
  width:auto !important;
}
#cbDrawflow .drawflow_content_node { padding:0 !important; }

#cbDrawflow .drawflow-node .input,
#cbDrawflow .drawflow-node .output {
  background:var(--purple) !important;
  border:2px solid #fff !important;
  box-shadow:0 0 0 2px var(--purple) !important;
  width:12px !important; height:12px !important;
}
/* Input: sempre centralizado verticalmente no nó */
#cbDrawflow .drawflow-node .input {
  top:50% !important; transform:translateY(-50%) !important;
}
/* Output de nó de menu: posicionado via JS (repositionMenuPorts) */
#cbDrawflow .drawflow-node:not(.cb-type-menu) .output {
  top:50% !important; transform:translateY(-50%) !important;
}

#cbDrawflow .connection .main-path {
  stroke:var(--purple);
  stroke-width:2.5px;
}
#cbDrawflow .connection .point {
  fill:var(--purple);
}

/* Card do nó */
.cb-df-inner {
  background:#fff;
  border:1.5px solid #e4e4e7;
  border-radius:10px;
  width:220px;
  box-shadow:0 2px 8px rgba(0,0,0,.07);
  overflow:visible;
  cursor:default;
  transition:box-shadow .15s, border-color .15s;
}
#cbDrawflow .drawflow-node.selected .cb-df-inner {
  border-color:var(--purple) !important;
  box-shadow:0 0 0 3px rgba(101,31,255,.18) !important;
}
.cb-df-inner:hover {
  box-shadow:0 4px 14px rgba(0,0,0,.12);
}

/* Cabeçalho colorido do nó */
.cb-df-head {
  display:flex; align-items:center; gap:6px;
  padding:7px 10px; color:#fff;
  border-radius:9px 9px 0 0;
}
.cb-df-type {
  font-size:12px; font-weight:700; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cb-df-badge {
  background:rgba(255,255,255,.25); color:#fff;
  font-size:9px; font-weight:800; border-radius:4px;
  padding:1px 5px; white-space:nowrap; letter-spacing:.3px;
}
.cb-df-actions { display:flex; gap:3px; flex-shrink:0; }
.cb-df-btn {
  background:rgba(255,255,255,.15); border:none; cursor:pointer;
  color:#fff; width:22px; height:22px; border-radius:5px;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; transition:background .12s;
}
.cb-df-btn:hover     { background:rgba(255,255,255,.35); }
.cb-df-del:hover     { background:rgba(220,50,50,.7) !important; }

/* Corpo do nó */
.cb-df-body    { padding:8px 10px; }
.cb-df-preview { font-size:12px; color:#444; line-height:1.45; word-break:break-word; }
.cb-df-muted   { color:#bbb; font-style:italic; }
.cb-df-opts    { margin-top:6px; }
.cb-df-opt     { position:relative; font-size:11px; color:#666; padding:3px 0; border-top:1px solid #f3f3f3; line-height:16px; }
.cb-df-extra   { font-size:11px; color:#888; margin-top:5px; }

/* Dots de saída embutidos nos nós de menu — alinhados por CSS com cada opção */
#cbDrawflow .drawflow-node.cb-type-menu .cb-df-opt .output {
  position:absolute !important;
  right:-18px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  cursor:crosshair !important;
  margin-bottom:0 !important;
}

/* Modal — campos por tipo de nó (controlados por JS) */
.cb-opt-num  { font-weight:700; min-width:18px; color:var(--purple); }
.cb-opt-edit-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.cb-opt-edit-row input, .cb-opt-edit-row select { height:34px; font-size:13px; }
.cb-field-next, .cb-field-varname, .cb-field-options, .cb-field-transfer { /* shown/hidden by JS */ }

/* ====== HISTORY ====== */
.history-page {
  height: 100vh;
  overflow: hidden;
  background: #f4f6f8;
  display: flex;
  flex-direction: column;
}
@media (max-width: 760px) {
  .history-page { height: auto; overflow: visible; }
}
.history-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(320px, 430px) minmax(420px, 1fr);
  gap: 1px;
  background: var(--gray-300);
}
.history-shell.contact-selected,
.history-shell.conv-expanded {
  grid-template-columns: minmax(260px, 320px) 1fr;
}
.history-shell.contact-selected .history-conv-panel,
.history-shell.conv-expanded .history-conv-panel { display: none; }
.history-conv-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: .78rem;
  color: var(--gray-500);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  margin: 8px 0 4px;
}
.history-conv-sep:first-of-type { margin-top: 4px; }
.history-conv-sep span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
mark.history-search-mark {
  background: #ffe08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
mark.history-search-mark-active {
  background: #f39c12;
  color: #fff;
}
.history-panel {
  min-width: 0;
  min-height: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.history-panel-head {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-panel-head h2 {
  font-size: 16px;
  color: var(--gray-800);
  margin: 0 0 3px;
}
.history-panel-head p {
  color: var(--gray-600);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.history-action-btn {
  border: 1px solid var(--primary-dark);
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  height: 34px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.history-action-btn:hover { background: var(--primary-dark); }
.history-action-btn--secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.history-action-btn--secondary:hover { background: var(--gray-100); border-color: var(--gray-400); }
.history-filters {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-filter-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  min-width: 52px;
}
.history-filter-date, .history-filter-select {
  flex: 1;
  height: 34px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 0 8px;
  font-size: 13px;
  color: var(--dark);
  background: var(--white);
  outline: none;
}
.history-filter-date:focus, .history-filter-select:focus {
  border-color: var(--purple);
}
.history-search-divider {
  margin: 12px 14px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
}
.history-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius);
  background: #fde8e8;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.history-clear-btn:hover { background: #fbd0d0; }
.history-conv-contact {
  font-weight: 700;
  color: var(--purple);
  font-size: 13px;
  gap: 6px;
}
.history-conv-contact i { font-size: 11px; }
.history-conv-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  display: inline-block;
}
.history-search-box {
  margin: 14px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
}
.history-search-box i { color: var(--gray-500); }
.history-search-box input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--gray-800);
}
.history-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.history-empty {
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
  padding: 24px 14px;
}
.history-contact,
.history-conversation {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.history-contact {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}
.history-contact:hover,
.history-contact.active,
.history-conversation:hover,
.history-conversation.active {
  background: #f3eefb;
  border-color: #e0d4f2;
}
.history-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.history-contact-main { min-width: 0; }
.history-contact-main strong,
.history-contact-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-contact-main strong { color: var(--gray-800); font-size: 13px; }
.history-contact-main small { color: var(--gray-600); font-size: 12px; margin-top: 2px; }
.history-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.history-conversation {
  display: block;
  padding: 12px;
  margin-bottom: 8px;
  border-color: var(--gray-200);
  background: var(--white);
}
.history-conv-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  color: var(--gray-700);
  font-size: 12px;
  margin-bottom: 6px;
}
.history-conv-row strong {
  color: var(--gray-500);
  font-weight: 600;
}
.history-conv-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-conv-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--gray-600);
  font-size: 12px;
}
.history-conv-footer > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-status {
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 11px;
  background: var(--gray-200);
  color: var(--gray-700);
}
.history-status-active { background: #d9f5e5; color: #116b3a; }
.history-status-waiting { background: #fff3cd; color: #7a5b00; }
.history-status-closed { background: #e8eaf0; color: #495057; }
.history-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #efeae2;
}
.history-contact-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.history-contact-banner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.history-contact-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.history-contact-banner-info strong {
  font-size: .95rem;
  color: var(--gray-800);
}
.history-contact-banner-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--gray-600);
}
.history-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 2px 4px;
  font-size: .8rem;
  opacity: .7;
  transition: opacity .15s;
}
.history-copy-btn:hover { opacity: 1; }
.btn-edit-contact {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  font-size: .8rem;
  transition: color .15s, border-color .15s;
}
.btn-edit-contact:hover { color: var(--primary); border-color: var(--primary); }
.history-msg {
  display: flex;
  margin-bottom: 10px;
}
.history-msg-contact { justify-content: flex-start; }
.history-msg-agent,
.history-msg-bot { justify-content: flex-end; }
.history-msg-system { justify-content: center; }
.history-msg-bubble {
  max-width: min(680px, 78%);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.history-msg-agent .history-msg-bubble { background: #dcf8c6; }
.history-msg-bot .history-msg-bubble { background: #e7f1ff; }
.history-msg-system .history-msg-bubble {
  background: rgba(255,255,255,0.75);
  color: var(--gray-600);
  text-align: center;
}
.history-msg-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 4px;
}
.history-msg-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: var(--gray-800);
}
.history-msg-time {
  color: var(--gray-600);
  font-size: 10px;
  text-align: right;
  margin-top: 5px;
}
.history-media,
.history-video {
  display: block;
  max-width: 280px;
  max-height: 260px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.history-audio { width: 260px; max-width: 100%; display: block; }
.history-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 6px;
}
.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 19, 38, 0.55);
}
.history-modal-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--white);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
}
.history-modal-card h3 {
  color: var(--purple);
  margin: 0 0 16px;
  font-size: 17px;
}
.history-modal-card h3 i { margin-right: 8px; }
.history-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}
.history-modal-client {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-100);
}
.history-modal-client strong { color: var(--gray-800); }
.history-modal-client span { color: var(--gray-600); font-size: 12px; }
.history-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ====== NOTICE LISTS ====== */
.notice-page {
  min-height: 100vh;
  background: #f4f6f8;
  display: flex;
  flex-direction: column;
}
.notice-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 1px;
  background: var(--gray-300);
}
.notice-panel {
  min-width: 0;
  min-height: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.notice-panel-head {
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notice-panel-head h2 {
  margin: 0 0 3px;
  color: var(--gray-800);
  font-size: 16px;
}
.notice-panel-head p {
  margin: 0;
  color: var(--gray-600);
  font-size: 12px;
}
.notice-icon-btn,
.notice-action-btn {
  border: 1px solid #d7c6ef;
  background: #f7f2ff;
  color: var(--purple);
  border-radius: 8px;
  height: 34px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.notice-icon-btn { width: 34px; padding: 0; }
.notice-icon-btn:hover,
.notice-action-btn:hover { background: #efe6fb; }
.notice-list,
.notice-contact-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}
.notice-list-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.notice-list-item:hover,
.notice-list-item.active {
  background: #f3eefb;
  border-color: #e0d4f2;
}
.notice-list-icon,
.notice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.notice-list-main,
.notice-contact-main {
  min-width: 0;
}
.notice-list-main strong,
.notice-list-main span,
.notice-contact-main strong,
.notice-contact-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-list-main strong,
.notice-contact-main strong {
  color: var(--gray-800);
  font-size: 13px;
}
.notice-list-main span,
.notice-contact-main span {
  margin-top: 2px;
  color: var(--gray-600);
  font-size: 12px;
}
.notice-list-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.notice-empty {
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
  padding: 24px 14px;
}
.notice-detail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.notice-add-box {
  padding: 14px;
  border-bottom: 1px solid var(--gray-200);
  position: relative;
}
.notice-search-box {
  height: 42px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
}
.notice-search-box i { color: var(--gray-500); }
.notice-search-box input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
}
.notice-suggestions {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 58px;
  z-index: 30;
  max-height: 280px;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.notice-suggestion,
.notice-contact-item {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px;
}
.notice-suggestion {
  cursor: pointer;
  grid-template-columns: 34px 1fr;
}
.notice-suggestion:hover { background: var(--gray-100); }
.notice-suggestion div:last-child { min-width: 0; }
.notice-suggestion strong,
.notice-suggestion span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-suggestion span { color: var(--gray-600); font-size: 12px; margin-top: 2px; }
.notice-suggestion-empty {
  padding: 12px;
  color: var(--gray-500);
  font-size: 13px;
  text-align: center;
}
.notice-contact-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--white);
}
.notice-contact-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.notice-edit-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(108,117,125,0.25);
  background: #f8f9fa;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  margin-right: 4px;
}
.notice-edit-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.notice-remove-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(220,53,69,0.25);
  background: #fff5f5;
  color: var(--danger);
  border-radius: 8px;
  cursor: pointer;
}
.notice-remove-btn:hover {
  background: var(--danger);
  color: var(--white);
}
.notice-active-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.contact-list-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
  padding: 9px 12px;
}
.contact-list-checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.contact-list-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  user-select: none;
}
.contact-list-check-item:hover { background: #f3eefb; }
.contact-list-check-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
  flex-shrink: 0;
  cursor: pointer;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ── Changelog / Novidades modal ─────────────────────────────────────────── */
.changelog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: clFadeIn .25s ease;
}
.changelog-overlay.changelog-hiding {
  animation: clFadeOut .28s ease forwards;
}
@keyframes clFadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes clFadeOut { from { opacity:1; } to { opacity:0; } }

.changelog-card {
  background: #fff;
  border-radius: 14px;
  width: min(540px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  animation: clSlideUp .25s ease;
}
@keyframes clSlideUp {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.changelog-header {
  padding: 28px 28px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.changelog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eafaf1;
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.changelog-header h2 {
  font-size: 1.15rem;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.35;
}

.changelog-list {
  list-style: none;
  margin: 0;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.changelog-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.changelog-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eafaf1;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.changelog-item strong {
  display: block;
  font-size: .9rem;
  color: var(--gray-800);
  margin-bottom: 3px;
}
.changelog-item p {
  margin: 0;
  font-size: .83rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.changelog-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
}
.changelog-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
}
.changelog-btn:hover { background: var(--primary-dark); }

@media (max-width: 1100px) {
  .history-shell {
    grid-template-columns: 280px 1fr;
    grid-template-rows: minmax(260px, 40vh) 1fr;
  }
  .history-detail-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .history-shell {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .history-panel { min-height: 320px; }
  .history-detail-panel { min-height: 520px; }
  .history-msg-bubble { max-width: 92%; }
}

/* ── History — topbar e painel esquerdo em verde ── */
.history-page .chat-topbar {
  background: var(--primary-dark);
  border-bottom-color: rgba(0,0,0,0.12);
}
.history-page .chat-topbar-company {
  color: #fff;
}
.history-page .chat-topbar-company i { color: rgba(255,255,255,0.75); }
.history-page .topbar-btn {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.history-page .topbar-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.6);
}
.history-page .topbar-btn.active {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.65);
}
.history-page .topbar-btn-danger {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.history-page .topbar-btn-danger:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.6);
}
.history-search-panel {
  background: var(--primary-dark);
}
.history-search-panel .history-panel-head { border-bottom-color: rgba(255,255,255,0.15); }
.history-search-panel .history-panel-head h2 { color: #fff; }
.history-search-panel .history-panel-head p  { color: rgba(255,255,255,0.65); }
.history-search-panel .history-filter-row label { color: rgba(255,255,255,0.8); }
.history-search-panel .history-search-divider {
  color: rgba(255,255,255,0.55);
  letter-spacing: .6px;
}
.history-search-panel .history-search-box {
  background: #efeae2;
  border: 1px solid rgba(0,0,0,0.08);
}
.history-search-panel .history-search-box i { color: var(--gray-500); }
.history-search-panel .history-search-box input {
  color: var(--gray-800);
}
.history-search-panel .history-search-box input::placeholder { color: var(--gray-400); }
.history-search-panel .history-contact-main strong { color: #fff; }
.history-search-panel .history-contact-main small  { color: rgba(255,255,255,0.65); }
.history-search-panel .history-avatar { background: rgba(255,255,255,0.2); color: #fff; }
.history-search-panel .history-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.history-search-panel .history-empty { color: rgba(255,255,255,0.55); }
.history-search-panel .history-contact:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
.history-search-panel .history-contact.active {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
}
#conversationHint { font-weight: 600; color: var(--gray-700); }
#msgSearchBar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
}
#msgSearchBar > div {
  width: 40%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--white);
}
#msgSearchBar i { color: var(--gray-400); font-size: .8rem; flex-shrink: 0; }
#msgSearch { color: var(--gray-800); }
#msgSearch::placeholder { color: var(--gray-400); }
#msgSearchCount { color: var(--gray-500); font-size: .75rem; white-space: nowrap; }
#msgSearchPrev, #msgSearchNext { color: var(--gray-500); }

/* ====== MANUAL DE OPERAÇÃO ====== */
.manual-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.manual-topbar-full {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 16px;
  height: 52px;
  flex-shrink: 0;
  gap: 12px;
}
.manual-body { display: flex; flex: 1; overflow: hidden; }
.manual-sidebar { position: relative; transition: width .22s ease; overflow: hidden; flex-shrink: 0; }
.manual-sidebar.sidebar--collapsed { width: 52px !important; }
.manual-sidebar.sidebar--collapsed .sidebar-full-only,
.manual-sidebar.sidebar--collapsed .sidebar-brand-label { display: none; }
.manual-sidebar.sidebar--collapsed .brand { justify-content: center; }
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 24px;
  height: 40px;
  border-radius: 0 6px 6px 0;
  background: #1a3d2b;
  border: 1px solid rgba(255,255,255,.18);
  border-left: none;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background .15s, color .15s;
  z-index: 10;
}
.sidebar-toggle-btn:hover { background: #27ae60; color: #fff; }
.manual-layout { display: flex; flex: 1; overflow: hidden; }
.manual-nav {
  width: 220px;
  min-width: 220px;
  background: linear-gradient(160deg, #1a3d2b 0%, #0f2a1d 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 0 24px;
  flex-shrink: 0;
}
.manual-search-wrap { position: relative; margin: 0 14px 16px; }
.manual-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.45); font-size: 12px; }
.manual-search { width: 100%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; color: #fff; padding: 8px 10px 8px 30px; font-size: 12.5px; outline: none; box-sizing: border-box; }
.manual-search::placeholder { color: rgba(255,255,255,.4); }
.manual-search:focus { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.15); }
.manual-index { list-style: none; padding: 0; margin: 0; }
.manual-index li { margin: 0; }
.manual-link { display: block; padding: 9px 18px; color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500; text-decoration: none; border-left: 3px solid transparent; transition: all .15s; }
.manual-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.manual-link.active { color: #fff; border-left-color: #5dde8a; background: rgba(255,255,255,.1); }
.manual-link--hit { color: #fff !important; background: rgba(93,222,138,.25) !important; border-left-color: #5dde8a !important; font-weight: 700 !important; }
.manual-link--miss { color: rgba(255,255,255,.28) !important; text-decoration: line-through; }
.manual-content { flex: 1; overflow-y: auto; padding: 32px 48px; background: #f8fdf9; color: #1a2e1a; scroll-behavior: smooth; }
.manual-section { max-width: 780px; margin-bottom: 48px; padding-bottom: 40px; border-bottom: 1px solid #d4edda; }
.manual-section:last-child { border-bottom: none; }
.manual-section h1 { font-size: 22px; font-weight: 800; color: #0f2a1d; margin-bottom: 16px; }
.manual-section h1 i { color: #27ae60; margin-right: 8px; }
.manual-section h2 { font-size: 18px; font-weight: 700; color: #1a3d2b; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid #c8e6c9; }
.manual-section h2 i { color: #27ae60; margin-right: 8px; }
.manual-section h3 { font-size: 14px; font-weight: 700; color: #1a3d2b; margin: 20px 0 8px; }
.manual-section p { font-size: 14px; line-height: 1.75; color: #2d4a2d; margin-bottom: 12px; }
.manual-section ul, .manual-section ol { padding-left: 20px; margin-bottom: 12px; }
.manual-section li { font-size: 14px; line-height: 1.75; color: #2d4a2d; margin-bottom: 4px; }
.manual-section a { color: #1a8449; text-decoration: none; font-weight: 500; }
.manual-section a:hover { text-decoration: underline; }
.manual-tip { background: #e8f5e9; border-left: 4px solid #27ae60; border-radius: 0 8px 8px 0; padding: 12px 16px; font-size: 13.5px; color: #1a3d2b; margin: 16px 0; line-height: 1.6; }
.manual-tip i { margin-right: 6px; }
.manual-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0 16px; }
.manual-table th { background: #1a3d2b; color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.manual-table td { padding: 9px 14px; border-bottom: 1px solid #d4edda; color: #2d4a2d; }
.manual-table tr:nth-child(even) td { background: #f0faf1; }
.manual-code { background: #1a2e1a; color: #5dde8a; border-radius: 6px; padding: 12px 16px; font-family: monospace; font-size: 13px; margin: 8px 0 14px; overflow-x: auto; }
.manual-section code { background: #e8f5e9; color: #1a3d2b; border-radius: 4px; padding: 2px 6px; font-family: monospace; font-size: 12.5px; }
.manual-tips-list { list-style: none; padding: 0; }
.manual-tips-list li { padding: 10px 14px 10px 36px; position: relative; border-radius: 8px; margin-bottom: 6px; background: #f0faf1; font-size: 14px; color: #2d4a2d; }
.manual-tips-list li::before { content: '✓'; position: absolute; left: 12px; color: #27ae60; font-weight: 700; }

/* ====== SIGNUP ====== */
.signup-card { max-width: 520px; width: 100%; }
.signup-subtitle { font-size: 13.5px; color: #666; margin: -4px 0 20px; }
.signup-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #27ae60; margin-bottom: 10px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.input-with-status { position: relative; }
.input-with-status input { padding-right: 110px; }
.field-status { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #888; white-space: nowrap; pointer-events: none; }
.field-status.ok { color: #27ae60; font-weight: 600; }
.field-status.err { color: #e74c3c; }
.field-hint { display: block; font-size: 12px; color: #888; margin-top: 4px; min-height: 16px; }
.field-hint.ok { color: #27ae60; font-weight: 600; }
.required { color: #e74c3c; }
.signup-login-link { text-align: center; font-size: 13px; color: #666; margin-top: 16px; }
.signup-login-link a { color: #27ae60; font-weight: 600; text-decoration: none; }
.signup-login-link a:hover { text-decoration: underline; }
.login-brand-version { font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: .06em; margin-top: 1px; }
.login-header-mobile-version { font-size: 12px; color: rgba(255,255,255,.55); margin-left: 4px; align-self: flex-end; padding-bottom: 3px; }
.btn-trial {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px; margin-top: 14px;
  background: transparent; border: 2px solid #27ae60; border-radius: 8px;
  color: #27ae60; font-size: 14px; font-weight: 700; text-decoration: none;
  transition: background .15s, color .15s;
}
.btn-trial:hover { background: #27ae60; color: #fff; }

/* ====== ONBOARDING ====== */
.onboarding-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(135deg, #0f2a1d 0%, #1a3d2b 100%);
}
.onboarding-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 32px; color: #fff; font-size: 18px; font-weight: 700;
}
.onboarding-body {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
}
.onboarding-card {
  background: #fff; border-radius: 16px; padding: 40px 44px;
  width: 100%; max-width: 600px; box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.onboarding-step { margin-bottom: 28px; }
.onboarding-step-badge {
  display: inline-block; background: #e8f5e9; color: #27ae60;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.onboarding-step h2 { font-size: 22px; font-weight: 800; color: #0f2a1d; margin-bottom: 6px; }
.onboarding-step p { font-size: 13.5px; color: #555; line-height: 1.6; }
.onboarding-actions { display: flex; align-items: center; gap: 20px; margin-top: 24px; flex-wrap: wrap; }
.onboarding-skip { font-size: 13px; color: #999; text-decoration: none; }
.onboarding-skip:hover { color: #555; text-decoration: underline; }

/* ====== TRIAL EXPIRED ====== */
.trial-expired-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #0f2a1d 0%, #1a3d2b 100%);
}
.trial-expired-card {
  background: #fff; border-radius: 16px; padding: 48px 52px;
  max-width: 580px; width: 100%; text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.trial-expired-card h1 { font-size: 22px; font-weight: 800; color: #0f2a1d; margin: 12px 0 16px; }
.trial-expired-card p { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 28px; }
.trial-expired-cta { margin-bottom: 32px; }
.btn-whatsapp { background: #25d366 !important; display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: 10px; color: #fff !important; font-weight: 700; text-decoration: none; font-size: 15px; transition: filter .15s; }
.btn-whatsapp:hover { filter: brightness(1.1); }
.trial-expired-benefits {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px;
  text-align: left; margin-bottom: 28px;
}
.teb-item { font-size: 13.5px; color: #2d4a2d; display: flex; align-items: center; gap: 8px; }
.teb-item i { color: #27ae60; }
.trial-expired-logout { font-size: 13px; color: #aaa; }
.trial-expired-logout a { color: #aaa; text-decoration: none; }
.trial-expired-logout a:hover { color: #555; text-decoration: underline; }

/* ── Enviar contato ────────────────────────────────────────────────────────── */
.send-contact-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  margin-bottom: 10px;
  overflow: hidden;
}
.send-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
}
.send-contact-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  background: var(--gray-50, #f9f9f9);
  box-sizing: border-box;
}
.send-contact-results {
  max-height: 240px;
  overflow-y: auto;
}
.sc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--gray-800);
  transition: background .12s;
}
.sc-item:hover { background: var(--gray-100); }
.sc-item i { font-size: 22px; color: var(--gray-400); flex-shrink: 0; }
.sc-item-info { min-width: 0; }
.sc-item-info strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item-info span { display: block; font-size: 11px; color: var(--gray-500); }
.sc-loading, .sc-empty { padding: 14px; font-size: 13px; color: var(--gray-500); text-align: center; }

/* ── Painel enviar produto ─────────────────────────────────────────────────── */
.send-product-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--gray-100);
}
.sp-cat-btn {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 12px;
  cursor: pointer;
  color: var(--gray-700);
}
.sp-cat-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
