/* Vabion AD CRM + visual bridge to Vabion System */
:root {
  --bg: #0a0a0a;
  --sidebar-bg: #0a0a0a;
  --card-bg: #121212;
  --input-bg: #121212;
  --border: #212121;
  --input-border: #2a2a2a;
  --accent: #e60023;
  --accent-red: #e60023;
  --accent-hover: #c9001f;
  --accent-dim: rgba(230, 0, 35, .10);
  --text-main: #ffffff;
  --text-sec: #a8a8a8;
  --text-tert: #737373;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif !important;
  background: var(--bg) !important;
}

aside.sidebar {
  width: 232px !important;
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border) !important;
}

.sidebar-header {
  min-height: 80px;
  padding: 0 16px !important;
  border-bottom: 0 !important;
}

.brand-title {
  font-family: inherit !important;
  font-size: 15px !important;
  letter-spacing: -.02em !important;
}

.sidebar-scroll {
  padding: 10px 12px 18px !important;
}

.menu-label {
  padding: 14px 10px 7px !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
}

.nav-item,
.nav-sub-item {
  min-height: 40px;
  border-radius: 9px !important;
  font-size: 13px !important;
  transition: background-color .18s ease, color .18s ease !important;
}

.nav-item.active,
.nav-sub-item.active {
  background: #1b1b1b !important;
  color: #fff !important;
  box-shadow: none !important;
}

.nav-item.active svg,
.nav-sub-item.active svg {
  color: var(--accent-red) !important;
}

.sidebar-user-card,
.user-profile-badge {
  box-shadow: none !important;
}

.top-header {
  min-height: 72px !important;
  padding: 14px 24px !important;
  background: rgba(10, 10, 10, .94) !important;
  border-bottom: 1px solid var(--border) !important;
  backdrop-filter: blur(16px);
}

.top-header-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: rgba(230, 0, 35, .08) !important;
  border: 1px solid rgba(230, 0, 35, .18) !important;
  color: var(--accent-red) !important;
}

.page-title {
  font-family: inherit !important;
  font-size: 16px !important;
  letter-spacing: -.02em !important;
}

.content-area {
  padding: 24px !important;
  background: var(--bg) !important;
}

.card,
.kpi-card,
.custom-modal-content {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  box-shadow: none !important;
}

.btn-primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

input,
select,
textarea,
.input-control {
  box-shadow: none !important;
}

#crmRoot {
  width: 100%;
  color: var(--text-main);
}

.crm-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.crm-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f0f0f;
}

.crm-view-tab {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-sec);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.crm-view-tab:hover {
  color: #fff;
  background: #171717;
}

.crm-view-tab.active {
  color: #fff;
  background: #202020;
}

.crm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-btn {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #141414;
  color: #e5e5e5;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.crm-btn:hover {
  background: #1b1b1b;
  border-color: #303030;
}

.crm-btn.primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

.crm-btn.primary:hover {
  background: var(--accent-hover);
}

.crm-btn.danger {
  color: var(--text-main);
  border-color: rgba(230, 0, 35, .3);
  background: var(--accent-dim);
}

.crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.crm-kpi {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.crm-kpi-label {
  color: var(--text-sec);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.crm-kpi-value {
  margin-top: 14px;
  color: #fff;
  font-size: 25px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.crm-kpi-foot {
  margin-top: 9px;
  color: var(--text-tert);
  font-size: 11px;
}

.crm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 14px;
}

.crm-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  overflow: hidden;
}

.crm-panel-head {
  min-height: 50px;
  padding: 0 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crm-panel-title {
  font-size: 13px;
  font-weight: 650;
  color: #fff;
}

.crm-panel-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-tert);
}

.crm-empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--text-tert);
  font-size: 12px;
}

.crm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.crm-table th {
  height: 42px;
  padding: 0 14px;
  text-align: left;
  color: var(--text-tert);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  background: #101010;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.crm-table td {
  min-height: 48px;
  padding: 11px 14px;
  border-bottom: 1px solid #1d1d1d;
  color: #d7d7d7;
  font-size: 12px;
  vertical-align: middle;
}

.crm-table tbody tr {
  cursor: pointer;
  transition: background-color .16s ease;
}

.crm-table tbody tr:hover {
  background: #171717;
}

.crm-table tbody tr:last-child td {
  border-bottom: 0;
}

.crm-contact-name {
  color: #fff;
  font-weight: 620;
}

.crm-muted {
  color: var(--text-tert);
}

.crm-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid #2b2b2b;
  border-radius: 6px;
  background: #171717;
  color: #bdbdbd;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.crm-badge.red {
  border-color: rgba(230, 0, 35, .28);
  background: rgba(230, 0, 35, .08);
  color: var(--text-main);
}

.crm-badge.green {
  border-color: rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .08);
  color: #7ee2a8;
}

.crm-filterbar {
  padding: 12px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.crm-input,
.crm-select,
.crm-textarea {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #0f0f0f;
  color: #fff;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.crm-textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
}

.crm-input:focus,
.crm-select:focus,
.crm-textarea:focus {
  border-color: rgba(230, 0, 35, .65);
  box-shadow: 0 0 0 2px rgba(230, 0, 35, .08) !important;
}

.crm-search {
  flex: 1 1 260px;
}

.crm-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(255px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  align-items: start;
}

.crm-stage {
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f0f0f;
  overflow: hidden;
}

.crm-stage-head {
  min-height: 48px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-stage-name {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}

.crm-stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
}

.crm-stage-meta {
  color: var(--text-tert);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.crm-stage-body {
  min-height: 365px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-stage-body.drag-over {
  background: rgba(230, 0, 35, .035);
}

.crm-deal {
  padding: 11px;
  border: 1px solid #252525;
  border-radius: 9px;
  background: #151515;
  cursor: grab;
}

.crm-deal:hover {
  border-color: #333;
  background: #181818;
}

.crm-deal-title {
  color: #f4f4f4;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.35;
}

.crm-deal-contact {
  margin-top: 6px;
  color: var(--text-tert);
  font-size: 10.5px;
}

.crm-deal-value {
  margin-top: 10px;
  color: #d8d8d8;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.crm-list-item {
  min-height: 58px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #1d1d1d;
}

.crm-list-item:last-child {
  border-bottom: 0;
}

.crm-check {
  width: 18px;
  height: 18px;
  border: 1px solid #363636;
  border-radius: 5px;
  background: #101010;
  cursor: pointer;
  flex: 0 0 auto;
}

.crm-list-main {
  min-width: 0;
  flex: 1;
}

.crm-list-title {
  color: #ededed;
  font-size: 12px;
  font-weight: 600;
}

.crm-list-meta {
  margin-top: 4px;
  color: var(--text-tert);
  font-size: 10.5px;
}

.crm-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, .56);
  display: flex;
  justify-content: flex-end;
}

.crm-drawer {
  width: min(560px, 100vw);
  height: 100%;
  overflow-y: auto;
  background: #0c0c0c;
  border-left: 1px solid #242424;
  box-shadow: -20px 0 50px rgba(0, 0, 0, .35);
}

.crm-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 12, .96);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.crm-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #191919;
  border: 1px solid #292929;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.crm-drawer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crm-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
  overflow: hidden;
}

.crm-section-head {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}

.crm-section-body {
  padding: 12px;
}

.crm-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.crm-detail-label {
  color: var(--text-tert);
  font-size: 10px;
}

.crm-detail-value {
  margin-top: 3px;
  color: #e2e2e2;
  font-size: 12px;
  word-break: break-word;
}

.crm-timeline {
  display: flex;
  flex-direction: column;
}

.crm-timeline-item {
  position: relative;
  padding: 0 0 16px 22px;
}

.crm-timeline-item:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: -4px;
  width: 1px;
  background: #292929;
}

.crm-timeline-item:last-child:before {
  display: none;
}

.crm-timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2b2b2b;
  border: 2px solid #0f0f0f;
}

.crm-timeline-item.outbound .crm-timeline-dot {
  background: var(--accent-red);
}

.crm-timeline-body {
  color: #d1d1d1;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.crm-timeline-meta {
  margin-top: 4px;
  color: var(--text-tert);
  font-size: 10px;
}

.crm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(0,0,0,.62);
  display: grid;
  place-items: center;
  padding: 20px;
}

.crm-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #292929;
  border-radius: 13px;
  background: #101010;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.crm-modal-head {
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-modal-title {
  font-size: 14px;
  font-weight: 650;
  color: #fff;
}

.crm-modal-body {
  padding: 16px;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.crm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-field.full {
  grid-column: 1 / -1;
}

.crm-label {
  color: #b2b2b2;
  font-size: 10.5px;
  font-weight: 600;
}

.crm-modal-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.crm-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #282828;
  border-radius: 8px;
  background: #151515;
  color: #bdbdbd;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.crm-icon-btn:hover {
  color: #fff;
  background: #1d1d1d;
}

@media (max-width: 1100px) {
  .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .content-area { padding: 16px !important; }
  .crm-kpis { grid-template-columns: 1fr; }
  .crm-toolbar { align-items: stretch; }
  .crm-view-tabs { width: 100%; overflow-x: auto; }
  .crm-view-tab { flex: 1 0 auto; }
  .crm-actions { width: 100%; }
  .crm-actions .crm-btn { flex: 1; justify-content: center; }
  .crm-form-grid,
  .crm-detail-grid { grid-template-columns: 1fr; }
  .crm-drawer { width: 100%; }
}

/* Mobile navigation bridge for the legacy Vabion AD shell */
.mobile-nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #111;
  color: #e6e6e6;
  cursor: pointer;
  flex: 0 0 auto;
}
.mobile-nav-toggle svg { width: 18px; height: 18px; }
.mobile-nav-backdrop { display: none; }

@media (max-width: 760px) {
  body { overflow: hidden !important; }
  aside.sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 2200 !important;
    width: 232px !important;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 18px 0 50px rgba(0,0,0,.35) !important;
  }
  body.mobile-nav-open aside.sidebar { transform: translateX(0); }
  .mobile-nav-toggle { display: inline-flex; }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0 0 0 232px;
    z-index: 2100;
    background: rgba(0,0,0,.52);
  }
  body.mobile-nav-open .mobile-nav-backdrop { display: block; }
  .main-wrapper { width: 100% !important; min-width: 0 !important; }
  .top-header { min-height: 64px !important; padding: 12px 14px !important; }
  .top-header-left { min-width: 0; }
  .top-header-icon { display: none !important; }
  .page-title { font-size: 15px !important; }
  .page-subtitle { max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .user-profile-badge { padding-right: 4px !important; }
  .user-profile-info { display: none !important; }
  .content-area { width: 100%; padding: 14px !important; }
  .crm-table { min-width: 680px; }
}

/* CRM Professional Pack */
.crm-pro-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.crm-pro-head h2{margin:0;color:#fff;font-size:20px;font-weight:700;letter-spacing:-.03em}
.crm-pro-head p{margin:5px 0 0;color:var(--text-tert);font-size:12px}
.crm-pro-inbox{display:grid;grid-template-columns:minmax(300px,.38fr) minmax(0,.62fr);gap:14px;min-height:610px}
.crm-pro-thread-list{display:flex;flex-direction:column;min-height:610px}
.crm-pro-scroll{overflow:auto;max-height:650px}
.crm-pro-thread{width:100%;display:flex;align-items:center;gap:10px;padding:11px 12px;border:0;border-bottom:1px solid var(--border);background:transparent;color:#fff;text-align:left;cursor:pointer}
.crm-pro-thread:hover{background:#171717}
.crm-pro-thread-main{flex:1;min-width:0}
.crm-pro-thread-main .crm-list-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-pro-thread-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;color:var(--text-tert);font-size:11px;min-width:70px}
.crm-pro-thread-side span{min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#202020;color:#ddd;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
.crm-pro-chat{padding:18px;display:flex;flex-direction:column;gap:9px;max-height:650px;overflow:auto;background:#0d0d0d}
.crm-pro-message{align-self:flex-start;max-width:min(76%,620px);padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#151515;color:#ececec;font-size:12.5px;line-height:1.5}
.crm-pro-message.out{align-self:flex-end;background:#1c1114;border-color:rgba(230,0,35,.24)}
.crm-pro-message small{display:block;margin-top:6px;color:var(--text-tert);font-size:10.5px}
.crm-pro-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.crm-pro-setting-body{padding:14px}
.crm-pro-setting-list{display:flex;flex-direction:column;margin-bottom:12px}
.crm-pro-setting-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.crm-pro-setting-row:first-child{padding-top:0}
.crm-pro-setting-row:last-child{border-bottom:0}
.crm-pro-setting-row>div{min-width:0}
.crm-pro-setting-row strong{display:block;color:#fff;font-size:12.5px}
.crm-pro-setting-row span:not(.crm-badge){display:block;margin-top:3px;color:var(--text-tert);font-size:11px}
.crm-pro-small-scroll{max-height:280px;overflow:auto}
.crm-pro-data-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
.crm-pro-data-stats span{padding:10px;border:1px solid var(--border);border-radius:8px;background:#101010;color:var(--text-sec);font-size:11px}
.crm-pro-data-stats b{display:block;margin-top:5px;color:#fff;font-size:16px}
.crm-pro-metrics{padding:12px 15px}
.crm-pro-metric-row{display:grid;grid-template-columns:minmax(120px,.7fr) minmax(150px,1.4fr) auto;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--border)}
.crm-pro-metric-row:last-child{border-bottom:0}
.crm-pro-metric-row strong{display:block;color:#fff;font-size:12px}
.crm-pro-metric-row span{display:block;color:var(--text-tert);font-size:10.5px;margin-top:2px}
.crm-pro-metric-row b{font-size:11.5px;color:#e5e5e5;font-variant-numeric:tabular-nums}
.crm-pro-bar{height:7px;border-radius:999px;background:#202020;overflow:hidden}
.crm-pro-bar i{display:block;height:100%;border-radius:999px;background:var(--accent-red)}
.crm-pro-search-group{margin-bottom:16px}
.crm-pro-search-group:last-child{margin-bottom:0}
.crm-pro-search-hit{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border:0;border-bottom:1px solid var(--border);background:transparent;color:#fff;text-align:left}
button.crm-pro-search-hit{cursor:pointer}
button.crm-pro-search-hit:hover{color:#fff;background:#151515}
.crm-pro-search-hit strong{font-size:12.5px}
.crm-pro-search-hit span{color:var(--text-tert);font-size:11px;text-align:right}
@media(max-width:980px){
  .crm-pro-inbox,.crm-pro-settings-grid{grid-template-columns:1fr}
  .crm-pro-inbox{min-height:0}
  .crm-pro-thread-list{min-height:360px}
}
@media(max-width:640px){
  .crm-pro-data-stats{grid-template-columns:1fr}
  .crm-pro-metric-row{grid-template-columns:1fr}
  .crm-pro-head{align-items:stretch}
}

.crm-pro-conversation-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.crm-pro-compact{min-width:130px;height:34px;padding-top:0!important;padding-bottom:0!important;font-size:11px!important}
.crm-pro-unread{background:rgba(230,0,35,.12)!important;color:#ff9cac!important;border:1px solid rgba(230,0,35,.2)}
.crm-pro-unread:empty{display:none}
@media(max-width:640px){.crm-pro-conversation-actions{width:100%}.crm-pro-compact{flex:1;min-width:0}}


/* Atendimento-first CRM */
.crm-service-layout{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);
  gap:14px;
}
.crm-service-queue{min-height:420px}
.crm-queue-list{display:flex;flex-direction:column}
.crm-queue-item{
  width:100%;
  min-height:68px;
  padding:10px 14px;
  display:flex;
  align-items:center;
  gap:11px;
  border:0;
  border-bottom:1px solid var(--border);
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.crm-queue-item:last-child{border-bottom:0}
.crm-queue-item:hover{background:#161616}
.crm-queue-main{min-width:0;flex:1}
.crm-queue-main strong{display:block;color:#f4f4f4;font-size:12.5px;font-weight:650}
.crm-queue-main span{
  display:block;
  margin-top:4px;
  color:var(--text-tert);
  font-size:11px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.crm-queue-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px;min-width:150px}
.crm-queue-side small{color:var(--text-tert);font-size:10px}
.crm-unread-count{
  min-width:22px;height:22px;padding:0 6px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(230,0,35,.13);border:1px solid rgba(230,0,35,.24);
  color:var(--text-main);font-size:10px;
}
.crm-ticket-attention{min-height:64px}
.crm-priority-dot{width:8px;height:8px;border-radius:50%;background:#555;flex:0 0 auto}
.crm-priority-dot.high,.crm-priority-dot.urgent{background:var(--accent-red)}
.crm-priority-dot.low{background:#5f6670}
.crm-ticket-side{display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.crm-ticket-side small{color:var(--text-tert);font-size:10px}
.crm-compact-contacts{display:flex;flex-direction:column}
.crm-contact-compact{
  width:100%;min-height:60px;padding:9px 13px;display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;
  border:0;border-bottom:1px solid var(--border);background:transparent;color:inherit;text-align:left;cursor:pointer;
}
.crm-contact-compact:last-child{border-bottom:0}
.crm-contact-compact:hover{background:#161616}
.crm-contact-compact strong{display:block;color:#f1f1f1;font-size:12px}
.crm-contact-compact span{display:block;margin-top:3px;color:var(--text-tert);font-size:10.5px}
.crm-contact-compact small{color:var(--text-tert);font-size:10px;white-space:nowrap}
.crm-secondary-panel{opacity:.94}
.crm-inline-tags{display:flex;gap:4px;flex-wrap:wrap;margin-top:5px}
.crm-inline-tags span{padding:2px 5px;border-radius:5px;background:#181818;border:1px solid #262626;color:#8f8f8f;font-size:9px}
.crm-contact-channel{color:#dfdfdf;font-size:11.5px;font-weight:600}
.crm-opportunity-value{display:block;color:#f0f0f0;font-size:12px}
.crm-contact-table{min-width:1080px}
.crm-deal-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}
.crm-deal-top .crm-muted{font-size:9.5px;white-space:nowrap}
.crm-agenda-summary{display:grid;grid-template-columns:repeat(3,minmax(0,180px));gap:9px;margin-bottom:14px}
.crm-agenda-stat{
  padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:#101010;color:#fff;text-align:left;
}
.crm-agenda-stat strong{display:block;font-size:21px;letter-spacing:-.04em}
.crm-agenda-stat span{display:block;margin-top:3px;color:var(--text-tert);font-size:10.5px}
.crm-agenda-stat.danger{border-color:rgba(230,0,35,.22);background:rgba(230,0,35,.035)}
.crm-agenda-stat.danger strong{color:var(--text-main)}
.crm-agenda-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}
.crm-contact-actions{display:flex;gap:7px;flex-wrap:wrap}
.crm-contact-actions .crm-btn.primary{margin-right:auto}
.crm-section-kicker{
  margin:18px 0 9px;color:#8c8c8c;font-size:9.5px;font-weight:700;
  letter-spacing:.1em;text-transform:uppercase;
}
.crm-case-filters{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:8px;margin-bottom:14px}
.crm-case-filter{
  min-height:68px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#101010;color:#fff;text-align:left;cursor:pointer;
}
.crm-case-filter:hover{background:#151515}
.crm-case-filter.active{border-color:rgba(230,0,35,.35);background:rgba(230,0,35,.055)}
.crm-case-filter strong{display:block;font-size:19px;letter-spacing:-.03em}
.crm-case-filter span{display:block;margin-top:3px;color:var(--text-tert);font-size:10.5px}
.crm-pro-table-select{min-width:125px;min-height:31px!important;height:31px!important;font-size:10.5px!important;padding:0 7px!important}
.crm-text-danger{color:var(--text-main)}
.crm-pro-thread-title{display:flex;align-items:center;gap:7px;min-width:0}
.crm-pro-thread-title .crm-list-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-pro-thread-title small{color:#777;font-size:9px;white-space:nowrap}
.crm-pro-thread-owner{margin-top:4px;color:#707070;font-size:9.5px}
.crm-pro-conversation-head{align-items:flex-start!important}
.crm-pro-composer{
  position:sticky;bottom:0;padding:12px;border-top:1px solid var(--border);
  background:#0f0f0f;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end;
}
.crm-pro-composer .crm-textarea{min-height:54px;max-height:130px}
.crm-pro-composer .crm-btn{height:38px}
@media(max-width:1100px){
  .crm-service-layout,.crm-agenda-grid{grid-template-columns:1fr}
  .crm-case-filters{grid-template-columns:repeat(3,minmax(100px,1fr))}
}
@media(max-width:640px){
  .crm-agenda-summary{grid-template-columns:repeat(3,1fr)}
  .crm-case-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .crm-queue-side{min-width:90px}
  .crm-contact-compact{grid-template-columns:38px minmax(0,1fr)}
  .crm-contact-compact small{grid-column:2}
  .crm-pro-composer{grid-template-columns:1fr}
}


/* Bia — automação integrada ao CRM */
.bia-crm-setting{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:12px 0;border-bottom:1px solid var(--border);
}
.bia-crm-setting:first-child{padding-top:0}
.bia-crm-setting:last-child{border-bottom:0}
.bia-crm-setting strong{display:block;color:#f3f3f3;font-size:12.5px}
.bia-crm-setting span{display:block;margin-top:3px;color:var(--text-tert);font-size:10.5px}
.crm-switch{position:relative;width:38px;height:22px;flex:0 0 auto;cursor:pointer}
.crm-switch input{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important}
.crm-switch>span{
  position:absolute;inset:0;border-radius:999px;background:#242424;border:1px solid #353535;
  transition:.18s ease;
}
.crm-switch>span:after{
  content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;
  background:#8b8b8b;transition:.18s ease;
}
.crm-switch input:checked+span{background:rgba(230,0,35,.18);border-color:rgba(230,0,35,.5)}
.crm-switch input:checked+span:after{transform:translateX(16px);background:#ff4a64}
.crm-attention-note{
  margin-top:12px;padding:10px 11px;border:1px solid #252525;border-radius:8px;
  background:#0e0e0e;color:#858585;font-size:10.5px;line-height:1.45;
}
.crm-form-footer{display:flex;justify-content:flex-end;margin-top:12px}
.bia-knowledge-list{display:flex;flex-direction:column}
.bia-knowledge-item,.bia-learning-item{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:12px 14px;border-bottom:1px solid var(--border);
}
.bia-knowledge-item:last-child,.bia-learning-item:last-child{border-bottom:0}
.bia-knowledge-main{min-width:0;flex:1}
.bia-knowledge-main strong,.bia-learning-item strong{display:block;color:#f4f4f4;font-size:12.5px}
.bia-knowledge-main span,.bia-learning-item span{
  display:block;margin-top:3px;color:#8a8a8a;font-size:9.5px;text-transform:uppercase;letter-spacing:.05em;
}
.bia-knowledge-main p{margin:6px 0 0;color:#b8b8b8;font-size:11px;line-height:1.5;white-space:pre-wrap}
.bia-learning-actions{display:flex;gap:6px;flex:0 0 auto}

/* Contexto CRM nas telas legadas de canal/marketing */
.crm-channel-context{
  margin-bottom:14px;padding:11px 13px;border:1px solid #242424;border-radius:10px;
  background:#101010;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.crm-channel-context-main{display:flex;align-items:center;gap:10px;min-width:0}
.crm-channel-context-icon{
  width:32px;height:32px;border-radius:8px;background:rgba(230,0,35,.07);border:1px solid rgba(230,0,35,.16);
  color:#ff536b;display:grid;place-items:center;flex:0 0 auto;
}
.crm-channel-context strong{display:block;color:#eee;font-size:11.5px}
.crm-channel-context p{margin:2px 0 0;color:#777;font-size:10.5px}
.crm-channel-context-actions{display:flex;gap:6px;flex-wrap:wrap}

/* Atendimento é o primeiro fluxo operacional da sidebar */
.sidebar-scroll > .menu-label:first-child{order:0}
#navSubCrmDashboard{order:1}
#serviceNavGroup{order:2}
#relationshipNavGroup{order:3}
#salesNavGroup{order:4}
#marketingNavGroup{order:5}
#channelsNavGroup{order:6}
#automationNavGroup{order:7}
.sidebar-scroll > .menu-label[style]{order:8}
#navSubCrmReports{order:9}
#navSubCrmSettings{order:10}

@media(max-width:640px){
  .bia-knowledge-item,.bia-learning-item{align-items:flex-start;flex-direction:column}
  .bia-learning-actions{width:100%}
  .bia-learning-actions .crm-btn{flex:1}
  .crm-channel-context{align-items:flex-start}
}


/* Professional pages use the global header as the page title. */
.crm-pro-toolbar-context{
  min-width:0;
  color:#747474;
  font-size:10px;
  font-weight:650;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.crm-pro-conversation-head{
  align-items:center!important;
  min-height:66px;
}
.crm-pro-customer-summary{display:flex;align-items:center;gap:10px;min-width:0}
.crm-pro-conversation-state{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.crm-pro-customer-actions{
  display:flex;align-items:center;gap:7px;flex-wrap:wrap;
  padding:9px 12px;border-bottom:1px solid var(--border);background:#0f0f0f;
}
@media(max-width:760px){
  .crm-pro-conversation-head{align-items:flex-start!important;flex-direction:column}
  .crm-pro-conversation-state{width:100%;justify-content:stretch}
  .crm-pro-conversation-state .crm-select{flex:1}
  .crm-pro-customer-actions{overflow-x:auto;flex-wrap:nowrap}
  .crm-pro-customer-actions .crm-btn{flex:0 0 auto}
}


/* Account 360 and richer opportunity cards */
.crm-account-table tbody tr{cursor:pointer}
.crm-account-table tbody tr:hover{background:#151515}
.crm-account-people{padding:0!important}
.crm-account-person{
  width:100%;display:grid;grid-template-columns:38px minmax(0,1fr) auto;
  align-items:center;gap:10px;padding:10px 12px;border:0;border-bottom:1px solid var(--border);
  background:transparent;color:inherit;text-align:left;cursor:pointer;
}
.crm-account-person:last-child{border-bottom:0}
.crm-account-person:hover{background:#161616}
.crm-account-person strong{display:block;color:#f2f2f2;font-size:12px}
.crm-account-person span{display:block;margin-top:3px;color:var(--text-tert);font-size:10.5px}
.crm-account-person-side{display:flex;align-items:flex-end;flex-direction:column;gap:5px}
.crm-account-person-side small{color:var(--text-tert);font-size:9.5px}
.crm-deal-context{
  display:flex;flex-direction:column;gap:3px;margin:8px 0 10px;
  padding-top:8px;border-top:1px solid #242424;
}
.crm-deal-context span:first-child{font-size:10px;color:#a8a8a8;font-weight:600}
.crm-deal-context span:last-child{font-size:9.5px;color:#717171;line-height:1.35}
@media(max-width:640px){
  .crm-account-person{grid-template-columns:38px minmax(0,1fr)}
  .crm-account-person-side{grid-column:2;align-items:flex-start}
}


/* Atendimento CRM 360 — fila, conversa e contexto do cliente */
.crm-inbox-command{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.crm-inbox-filters{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.crm-inbox-filter{
  min-width:88px;
  height:42px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:#101010;
  color:#d7d7d7;
  text-align:left;
  cursor:pointer;
}
.crm-inbox-filter:hover{background:#151515}
.crm-inbox-filter.active{
  border-color:rgba(230,0,35,.34);
  background:rgba(230,0,35,.055);
}
.crm-inbox-filter strong{
  display:block;
  font-size:13px;
  line-height:1;
  color:#fff;
}
.crm-inbox-filter span{
  display:block;
  margin-top:4px;
  color:#777;
  font-size:9.5px;
}
.crm-inbox-search{width:min(360px,100%)}

.crm-pro-inbox-360{
  grid-template-columns:minmax(270px,.28fr) minmax(420px,.46fr) minmax(250px,.26fr);
  min-height:650px;
}
.crm-pro-conversation-panel{
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.crm-pro-conversation-panel .crm-pro-chat{
  flex:1;
  min-height:0;
}
.crm-pro-context{
  min-width:0;
  padding:0;
  overflow:auto;
}
.crm-context-profile{
  display:flex;
  align-items:center;
  gap:11px;
  padding:16px 16px 12px;
  border-bottom:1px solid var(--border);
}
.crm-context-avatar{
  width:42px!important;
  height:42px!important;
  border-radius:12px!important;
  font-size:12px!important;
}
.crm-context-profile h3{
  margin:0;
  color:#f4f4f4;
  font-size:14px;
  font-weight:700;
  letter-spacing:-.02em;
}
.crm-context-profile p{
  margin:3px 0 0;
  color:#767676;
  font-size:10.5px;
}
.crm-context-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:11px 16px 8px;
}
.crm-score{
  color:#8b8b8b;
  font-size:10px;
  font-weight:650;
}
.crm-context-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  padding:0 16px 12px;
}
.crm-context-tags span{
  padding:3px 6px;
  border:1px solid #292929;
  border-radius:6px;
  background:#141414;
  color:#929292;
  font-size:9px;
}
.crm-context-section{
  padding:13px 16px;
  border-top:1px solid var(--border);
}
.crm-context-section strong{
  display:block;
  color:#ededed;
  font-size:11.5px;
  font-weight:650;
}
.crm-context-section>span:not(.crm-context-label){
  display:block;
  margin-top:3px;
  color:#747474;
  font-size:10px;
}
.crm-context-section p{
  margin:5px 0 0;
  color:#a1a1a1;
  font-size:10.5px;
  line-height:1.5;
}
.crm-context-label{
  display:block;
  margin-bottom:7px;
  color:#646464;
  font-size:8.8px;
  font-weight:750;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.crm-context-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  padding:12px 16px;
  border-top:1px solid var(--border);
}
.crm-context-grid button{
  min-height:76px;
  padding:9px;
  border:1px solid #242424;
  border-radius:9px;
  background:#111;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.crm-context-grid button:hover{background:#161616}
.crm-context-grid strong{
  display:block;
  color:#fff;
  font-size:18px;
  letter-spacing:-.04em;
}
.crm-context-grid span{
  display:block;
  margin-top:3px;
  color:#a1a1a1;
  font-size:9.8px;
}
.crm-context-grid small{
  display:block;
  margin-top:5px;
  color:#666;
  font-size:9px;
}
.crm-context-next{
  background:rgba(230,0,35,.025);
}
.crm-context-next .crm-btn{
  width:100%;
  margin-top:10px;
}
.crm-context-footer{
  padding:14px 16px 16px;
  border-top:1px solid var(--border);
}
.crm-context-footer .crm-btn{width:100%}

@media(max-width:1180px){
  .crm-pro-inbox-360{
    grid-template-columns:minmax(260px,.34fr) minmax(0,.66fr);
  }
  .crm-pro-context{
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .crm-context-profile,.crm-context-status,.crm-context-tags,.crm-context-section,.crm-context-grid,.crm-context-footer{
    border-top:0;
    border-bottom:1px solid var(--border);
  }
}
@media(max-width:760px){
  .crm-inbox-command{align-items:stretch}
  .crm-inbox-search{width:100%}
  .crm-pro-inbox-360{grid-template-columns:1fr}
  .crm-pro-context{grid-column:auto;display:block}
  .crm-pro-thread-list{min-height:300px}
}


/* Caso/Ticket 360 */
.crm-ticket-detail-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.crm-ticket-detail-kpis>div{
  padding:10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#0d0d0d;
}
.crm-ticket-detail-kpis span{
  display:block;
  color:#676767;
  font-size:8.8px;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.crm-ticket-detail-kpis strong{
  display:block;
  margin-top:5px;
  color:#f0f0f0;
  font-size:11px;
}
.crm-ticket-description{
  margin:0;
  color:#b4b4b4;
  font-size:11.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
@media(max-width:520px){
  .crm-ticket-detail-kpis{grid-template-columns:1fr}
}


/* Composer profissional da Inbox */
.crm-chat-replies{
  display:flex;
  gap:6px;
  padding:8px 12px 0;
  overflow-x:auto;
  background:#0f0f0f;
  border-top:1px solid var(--border);
}
.crm-chat-replies button{
  flex:0 0 auto;
  height:28px;
  padding:0 9px;
  border:1px solid #292929;
  border-radius:7px;
  background:#141414;
  color:#9d9d9d;
  font-size:9.5px;
  cursor:pointer;
}
.crm-chat-replies button:hover{
  border-color:rgba(230,0,35,.34);
  color:#ededed;
  background:#181214;
}
.crm-chat-composer{
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:9px;
  padding-top:9px;
}
.crm-chat-channel{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:0 8px;
  border:1px solid #272727;
  border-radius:8px;
  background:#131313;
  color:#8c8c8c;
  font-size:9.5px;
  white-space:nowrap;
}
.crm-chat-channel-dot{
  width:7px;
  height:7px;
  border-radius:999px;
  background:#25d366;
  box-shadow:0 0 0 3px rgba(37,211,102,.09);
}
.crm-chat-input-wrap{
  min-width:0;
  border:1px solid #2a2a2a;
  border-radius:9px;
  background:#111;
  overflow:hidden;
}
.crm-chat-input-wrap:focus-within{
  border-color:rgba(230,0,35,.38);
  box-shadow:0 0 0 2px rgba(230,0,35,.045);
}
.crm-chat-input-wrap .crm-textarea{
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  min-height:46px!important;
  padding:10px 11px 6px!important;
  resize:none;
}
.crm-chat-input-meta{
  display:flex;
  justify-content:space-between;
  gap:8px;
  padding:0 10px 7px;
  color:#5f5f5f;
  font-size:8.8px;
}
.crm-chat-send{
  align-self:stretch;
  min-width:74px;
  height:auto!important;
}
.crm-pro-chat{
  scroll-behavior:smooth;
}
@media(max-width:760px){
  .crm-chat-composer{grid-template-columns:1fr}
  .crm-chat-channel{display:none}
  .crm-chat-send{min-height:38px}
}


/* CRM Universal — comércio, serviços e operações híbridas */
.crm-universal-template-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}
.crm-universal-modules{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.crm-universal-module{
  display:flex;
  align-items:flex-start;
  gap:9px;
  min-height:58px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:#111;
  cursor:pointer;
}
.crm-universal-module:hover{background:#151515}
.crm-universal-module input{margin-top:2px;accent-color:#e60023}
.crm-universal-module strong{
  display:block;
  color:#ededed;
  font-size:11px;
}
.crm-universal-module small{
  display:block;
  margin-top:3px;
  color:#707070;
  font-size:9.2px;
  line-height:1.35;
}
.crm-universal-settings-highlight{
  margin-bottom:12px;
  border-color:rgba(230,0,35,.2);
  background:linear-gradient(180deg,rgba(230,0,35,.025),rgba(255,255,255,0));
}
.crm-universal-setting-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.crm-quote-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid var(--border);
}
.crm-quote-item:last-child{border-bottom:0}
.crm-quote-item>div:first-child{min-width:0}
.crm-quote-item strong{
  display:block;
  color:#efefef;
  font-size:11.5px;
}
.crm-quote-item span{
  display:block;
  margin-top:3px;
  color:#6f6f6f;
  font-size:9.5px;
}
.crm-quote-item>div:last-child{
  display:flex;
  align-items:center;
  gap:7px;
  text-align:right;
}
.crm-universal-totals{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.crm-universal-totals span{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  color:#7f7f7f;
  font-size:10.5px;
}
.crm-universal-totals b{
  color:#e8e8e8;
  font-size:11.5px;
}
.crm-universal-totals .total{
  padding-top:10px;
  border-top:1px solid var(--border);
  color:#d6d6d6;
  font-weight:700;
}
.crm-universal-totals .total b{
  color:#fff;
  font-size:16px;
}
.crm-checklist-item{
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 0;
  border-bottom:1px solid var(--border);
  color:#b5b5b5;
  font-size:10.8px;
  cursor:pointer;
}
.crm-checklist-item:last-child{border-bottom:0}
.crm-checklist-item input{accent-color:#e60023}
.crm-checklist-item input:checked+span{
  color:#626262;
  text-decoration:line-through;
}
@media(max-width:700px){
  .crm-universal-template-row{grid-template-columns:1fr}
  .crm-universal-modules{grid-template-columns:1fr}
}

.crm-universal-checks{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:38px;
  flex-wrap:wrap;
}
.crm-universal-checks label{
  display:flex;
  align-items:center;
  gap:6px;
  color:#999;
  font-size:10px;
  cursor:pointer;
}
.crm-universal-checks input{
  accent-color:#e60023;
}


/* Visão geral adaptativa por segmento */
.crm-business-overview{margin-bottom:14px}
.crm-business-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  padding:0 14px 14px;
}
.crm-business-card{
  min-height:94px;
  padding:13px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#101010;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.crm-business-card:hover{background:#151515;border-color:#2d2d2d}
.crm-business-card span{
  display:block;
  color:#777;
  font-size:9.5px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.crm-business-card strong{
  display:block;
  margin-top:7px;
  color:#f7f7f7;
  font-size:23px;
  letter-spacing:-.04em;
}
.crm-business-card small{
  display:block;
  margin-top:5px;
  color:#727272;
  font-size:9.5px;
}
@media(max-width:1050px){
  .crm-business-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .crm-business-grid{grid-template-columns:1fr}
}
/* UI polish 2026-09-25 — refinamento visual sem mudar a identidade */
:root{
  --surface-0:#0a0a0a;
  --surface-1:#101010;
  --surface-2:#141414;
  --surface-3:#181818;
  --line-soft:#202020;
  --line-strong:#2a2a2a;
  --text-soft:#8d8d8d;
  --radius-sm:8px;
  --radius-md:11px;
  --radius-lg:14px;
}
.content-area{padding:26px 26px 34px!important}
.crm-shell{gap:16px}
.crm-toolbar{min-height:38px}
.crm-toolbar-actions-only{padding-bottom:2px}
.crm-actions{align-items:center}
.crm-btn{
  min-height:35px;
  padding:0 12px;
  border-radius:8px;
  background:#121212;
  border-color:#242424;
  transition:background-color .16s ease,border-color .16s ease,transform .16s ease;
}
.crm-btn:hover{background:#181818;border-color:#323232}
.crm-btn:active{transform:translateY(1px)}
.crm-btn.primary{box-shadow:0 0 0 1px rgba(255,255,255,.02) inset}
.crm-panel,.crm-kpi,.crm-stage,.crm-section{
  border-color:#222!important;
  background:#111!important;
}
.crm-panel{border-radius:13px}
.crm-panel-head{min-height:54px;padding:0 16px}
.crm-panel-title{font-size:13px;letter-spacing:-.012em}
.crm-panel-subtitle{color:#747474}
.crm-kpis{gap:10px}
.crm-kpi{
  min-height:104px;
  padding:15px 16px;
  border-radius:11px;
  background:linear-gradient(180deg,#121212 0%,#101010 100%)!important;
}
.crm-kpi-label{color:#9a9a9a;font-size:10.5px}
.crm-kpi-value{margin-top:12px;font-size:24px}
.crm-kpi-foot{margin-top:7px;color:#666}
.crm-grid,.crm-service-layout{gap:12px}
.crm-service-queue{min-height:380px}
.crm-secondary-panel{margin-top:-2px}
.crm-table-wrap{
  scrollbar-width:thin;
  scrollbar-color:#2a2a2a transparent;
}
.crm-table{min-width:720px}
.crm-table th{
  height:40px;
  padding:0 13px;
  color:#777;
  font-size:9.5px;
  letter-spacing:.075em;
  background:#0f0f0f;
}
.crm-table td{
  padding:12px 13px;
  color:#d9d9d9;
  font-size:11.5px;
}
.crm-table tbody tr:hover{background:#151515}
.crm-table tbody tr:focus-within{background:#161616}
.crm-filterbar{
  padding:11px 12px;
  gap:7px;
  background:#0f0f0f;
}
.crm-input,.crm-select,.crm-textarea{
  border-color:#272727;
  background:#0d0d0d;
}
.crm-input::placeholder,.crm-textarea::placeholder{color:#5f5f5f}
.crm-empty{
  min-height:126px;
  display:grid;
  place-items:center;
  padding:32px 20px;
  color:#666;
}
.crm-list-item{min-height:56px;padding:10px 14px}
.crm-list-title{font-size:11.8px}
.crm-list-meta{color:#707070}
.crm-badge{min-height:22px;border-radius:6px;background:#151515}
.crm-avatar{border-radius:9px;background:#171717;border-color:#262626}
.crm-contact-compact:hover,.crm-queue-item:hover{background:#151515}
.crm-queue-side{min-width:132px}
.crm-queue-side small{color:#696969}
.crm-kanban{
  grid-auto-columns:minmax(260px,300px);
  gap:9px;
  padding:0 1px 10px;
  scrollbar-width:thin;
  scrollbar-color:#2a2a2a transparent;
}
.crm-stage{
  min-height:390px;
  background:#0f0f0f!important;
}
.crm-stage-head{min-height:52px;padding:9px 12px}
.crm-stage-body{min-height:332px;padding:8px}
.crm-deal{
  padding:12px;
  border-color:#262626;
  border-radius:9px;
  background:#141414;
  transition:border-color .16s ease,background-color .16s ease,transform .16s ease;
}
.crm-deal:hover{transform:translateY(-1px);border-color:#343434;background:#171717}
.crm-deal-value{margin-top:11px;color:#f0f0f0}
.crm-pro-inbox-360{gap:10px!important}
.crm-pro-thread-list,.crm-pro-conversation-panel,.crm-pro-context{
  background:#101010!important;
}
.crm-pro-thread{
  min-height:68px;
  padding:10px 12px;
  transition:background-color .15s ease,border-color .15s ease;
}
.crm-pro-thread.active{
  background:#171214;
  box-shadow:inset 2px 0 0 var(--accent-red);
}
.crm-pro-thread.active .crm-list-title{color:#fff}
.crm-pro-chat{
  padding:18px 16px;
  gap:10px;
  background:#0c0c0c;
}
.crm-pro-message{border-radius:11px;padding:10px 12px}
.crm-pro-message.out{
  background:#1d1014;
  border-color:rgba(230,0,35,.28);
}
.crm-pro-message.visual{padding:7px!important;min-width:0!important;overflow:hidden}
.crm-visual-media{display:block;max-width:min(320px,70vw);padding:0;border:0;border-radius:8px;background:#090909;overflow:hidden;cursor:zoom-in}
.crm-visual-media img{display:block;max-width:100%;max-height:300px;object-fit:contain}
.crm-visual-media.sticker{background:transparent}
.crm-visual-media.sticker img{width:150px;height:150px;object-fit:contain}
.crm-media-viewer{position:fixed;inset:0;z-index:5000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.82)}
.crm-media-viewer-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:min(92vw,760px);max-height:92vh;padding:12px;border:1px solid #303030;border-radius:14px;background:#111;color:#bdbdbd;font-size:12px}
.crm-media-viewer-card img{display:block;max-width:calc(92vw - 24px);max-height:calc(92vh - 70px);object-fit:contain;border-radius:8px}
.crm-media-close{position:absolute;right:7px;top:7px;width:31px;height:31px;border:1px solid #3a3a3a;border-radius:50%;background:#171717;color:#fff;font-size:20px;line-height:1;cursor:pointer}
@media(max-width:620px){.crm-visual-media{max-width:68vw}.crm-visual-media img{max-height:240px}.crm-visual-media.sticker img{width:126px;height:126px}}

/* Kanban comercial */
.crm-kanban-board{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px;align-items:flex-start}
.crm-kanban-column{flex:0 0 270px;min-height:390px;border:1px solid #292929;border-radius:12px;background:#111;overflow:hidden}
.crm-kanban-column>header{display:flex;align-items:center;gap:8px;padding:12px;border-bottom:1px solid #272727;color:#f1f1f1;font-size:12px}
.crm-kanban-column>header small{margin-left:auto;display:grid;place-items:center;min-width:22px;height:22px;border-radius:999px;background:#242424;color:#bdbdbd}
.crm-stage-dot{width:8px;height:8px;border-radius:50%}
.crm-kanban-cards{display:flex;flex-direction:column;gap:8px;padding:9px}
.crm-kanban-card{display:flex;flex-direction:column;gap:6px;padding:11px;border:1px solid #303030;border-radius:9px;background:#181818;box-shadow:0 2px 8px rgba(0,0,0,.16)}
.crm-kanban-card strong{color:#f4f4f4;font-size:12px}.crm-kanban-card span{color:#999;font-size:10px}.crm-kanban-card b{color:#e4e4e4;font-size:12px}.crm-kanban-card .crm-select{width:100%;height:30px;font-size:10px}
.crm-link-btn{padding:0;border:0;background:transparent;color:#f5f5f5;font:inherit;font-weight:600;cursor:pointer;text-decoration:underline;text-decoration-color:#555;text-underline-offset:3px}.crm-link-btn:hover{color:#fff;text-decoration-color:var(--accent-red)}
/* Alertas seguem exatamente o card de notificação global do Vabion AD. */
.crm-alerts-panel{margin-top:12px;border-color:#232F48!important;background:#111827!important;box-shadow:0 16px 36px rgba(0,0,0,.28)!important}.crm-alerts-panel .crm-panel-title{color:#F8FAFC}.crm-alerts-panel .crm-panel-subtitle{color:#94A3B8}.crm-alerts-panel .crm-badge{border-color:rgba(225,29,60,.25);background:rgba(225,29,60,.12);color:#FDA4AF}.crm-alert-list{display:flex;flex-direction:column}.crm-alert-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:11px 15px;border:0;border-top:1px solid #232F48;background:transparent;color:#F8FAFC;text-align:left;cursor:pointer}.crm-alert-row:first-child{border-top:0}.crm-alert-row:hover{background:#141C2D}.crm-alert-row strong{font-weight:600}.crm-alert-row span{color:#94A3B8;font-size:11px}
.crm-chat-replies{padding:8px 10px 0!important}
.crm-chat-replies button{
  height:29px;
  background:#121212;
  border-color:#262626;
}
.crm-chat-replies button:hover{
  background:#171717;
  border-color:#353535;
}
.crm-chat-composer{
  padding:10px!important;
  background:#0f0f0f;
  border-top:1px solid #202020;
}
.crm-chat-input-wrap{background:#0d0d0d}
.crm-context-profile{padding:16px!important}
.crm-context-section{padding:14px 16px!important}
.crm-context-grid{gap:8px!important}
.crm-context-grid button{background:#0f0f0f!important}
.crm-context-grid button:hover{background:#151515!important}
.crm-drawer{
  width:min(580px,100vw);
  background:#0b0b0b;
  border-left-color:#242424;
}
.crm-drawer-head{
  padding:18px;
  background:rgba(11,11,11,.97);
}
.crm-drawer-body{
  padding:16px 18px 22px;
  gap:12px;
}
.crm-section{border-radius:11px}
.crm-section-head{min-height:44px;padding:0 13px}
.crm-section-body{padding:13px}
.crm-modal{
  width:min(560px,100%);
  border-radius:14px;
  background:#0f0f0f;
}
.crm-modal-head{min-height:60px;padding:0 18px}
.crm-modal-body{padding:18px}
.crm-modal-actions{padding:13px 18px}
.crm-pro-settings-grid{gap:12px}
.crm-pro-setting-body{padding:15px}
.crm-pro-setting-row{padding:11px 0}
.crm-universal-settings-highlight{
  background:linear-gradient(180deg,#121010 0%,#101010 100%)!important;
  border-color:#2a2022!important;
}
.crm-business-grid{gap:9px!important}
.crm-business-card{
  min-height:92px!important;
  border-color:#252525!important;
  background:#0f0f0f!important;
}
.crm-business-card:hover{
  border-color:#343434!important;
  background:#151515!important;
}
.crm-business-card strong{font-size:22px!important}
.crm-business-card small{color:#6d6d6d!important}
@media(max-width:1180px){
  .content-area{padding:22px!important}
  .crm-pro-inbox-360{gap:10px!important}
}
@media(max-width:760px){
  .content-area{padding:12px!important}
  .crm-shell{gap:12px}
  .crm-toolbar{gap:9px}
  .crm-actions{gap:6px}
  .crm-actions .crm-btn{min-height:38px}
  .crm-kpi{min-height:94px}
  .crm-panel{border-radius:11px}
  .crm-panel-head{min-height:50px;padding:0 13px}
  .crm-filterbar{padding:9px}
  .crm-pro-chat{padding:13px}
  .crm-drawer-body{padding:14px}
  .crm-modal-overlay{padding:10px}
}
/* Ajustes de densidade após QA visual */
.crm-service-layout,.crm-grid{align-items:start}
.crm-service-queue{min-height:0}
.crm-kanban{grid-auto-columns:minmax(230px,1fr)}
.crm-stage{min-height:360px}
.crm-stage-body{min-height:302px}
.crm-chat-channel{
  align-self:stretch;
  justify-content:center;
}

/* Inbox clean — 2026-09-29 */
.crm-inbox-command{
  gap:10px;
  margin-bottom:10px;
}
.crm-inbox-filters{gap:5px}
.crm-inbox-filter{
  min-width:0;
  height:34px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 10px;
  border-radius:8px;
  text-align:left;
  background:#0f0f0f;
}
.crm-inbox-filter strong{font-size:11px}
.crm-inbox-filter span{
  margin:0;
  font-size:9.5px;
}
.crm-inbox-search{
  width:min(300px,100%);
  height:34px!important;
}

.crm-pro-inbox-360{
  position:relative;
  grid-template-columns:minmax(290px,330px) minmax(0,1fr)!important;
  gap:10px!important;
  min-height:650px;
}
.crm-pro-thread-list{min-width:0}
.crm-pro-thread{
  min-height:62px;
  padding:9px 11px;
}
.crm-pro-thread .crm-avatar{
  width:36px;
  height:36px;
  border-radius:10px;
}
.crm-pro-thread-title small{
  padding:2px 5px;
  border:1px solid #2a2a2a;
  border-radius:5px;
}
.crm-pro-thread-owner{margin-top:3px}
.crm-pro-thread-side{min-width:58px}
.crm-pro-thread-side span{
  min-width:19px;
  height:19px;
  font-size:9px;
}

.crm-pro-conversation-head{
  min-height:58px;
  padding:0 12px!important;
  align-items:center!important;
}
.crm-pro-customer-summary{min-width:0}
.crm-pro-customer-summary .crm-avatar{
  width:36px;
  height:36px;
  border-radius:10px;
}
.crm-pro-conversation-state{
  gap:6px;
  flex-wrap:nowrap;
}
.crm-pro-conversation-state .crm-select{height:34px}
.crm-details-toggle{height:34px}
.crm-pro-customer-actions-compact{
  display:flex;
  gap:6px;
  padding:7px 12px;
  border-top:1px solid #1c1c1c;
  border-bottom:1px solid #1c1c1c;
  background:#0e0e0e;
}
.crm-pro-customer-actions-compact .crm-btn{
  min-height:30px;
  padding:0 9px;
  font-size:9.5px;
}

.crm-pro-chat{
  min-height:360px;
  padding:18px 16px 22px!important;
  gap:10px;
}
.crm-pro-message{
  max-width:min(72%,620px);
  border-radius:12px;
}
.crm-chat-tools{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-top:1px solid #1f1f1f;
  background:#0f0f0f;
}
.crm-chat-tools .crm-chat-replies{
  flex:1;
  min-width:0;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
.crm-ai-main{
  flex:0 0 auto;
  height:30px;
  padding:0 10px;
  border:1px solid #2c2c2c;
  border-radius:8px;
  background:#151515;
  color:#d8d8d8;
  font-size:9.5px;
  cursor:pointer;
}

.crm-ai-main:hover{
  border-color:#3a3a3a;
  background:#191919;
}
.crm-ai-actions{
  display:flex;
  gap:6px;
  padding:7px 10px;
  overflow-x:auto;
  border-top:1px solid #1d1d1d;
  background:#0d0d0d;
}
.crm-ai-actions[hidden]{display:none!important}
.crm-ai-actions button{
  flex:0 0 auto;
  height:29px;
  padding:0 9px;
  border:1px solid #292929;
  border-radius:7px;
  background:#121212;
  color:#999;
  font-size:9.5px;
  cursor:pointer;
}
.crm-ai-actions button:hover{color:#eee;background:#171717}
.crm-ai-result{
  display:none;
  margin:0 10px 8px;
  padding:11px;
  border:1px solid #262626;
  border-radius:9px;
  background:#101010;
}

.crm-chat-composer{
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  padding:9px 10px 10px!important;
}
.crm-chat-channel{display:none!important}
.crm-chat-send{
  min-width:70px;
  border-radius:9px;
}
.crm-pro-context{
  position:absolute!important;
  top:0;
  right:0;
  bottom:0;
  width:min(330px,calc(100% - 20px));
  height:100%;
  z-index:35;
  display:block!important;
  background:#0f0f0f!important;
  border:1px solid #292929!important;
  border-radius:12px!important;
  box-shadow:-18px 0 50px rgba(0,0,0,.32);
  transform:translateX(calc(100% + 18px));
  opacity:0;
  pointer-events:none;
  transition:transform .18s ease,opacity .18s ease;
}

.crm-pro-context.open{
  transform:translateX(0);
  opacity:1;
  pointer-events:auto;
}
.crm-context-drawer-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:48px;
  padding:0 14px;
  border-bottom:1px solid #242424;
  background:#0f0f0f;
}
.crm-context-drawer-head strong{
  color:#eee;
  font-size:11.5px;
}
.crm-context-drawer-head button{
  width:30px;
  height:30px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#777;
  font-size:20px;
  cursor:pointer;
}
.crm-context-drawer-head button:hover{background:#181818;color:#fff}
.crm-context-assignment .crm-select{width:100%;height:36px}
.crm-context-assignment .crm-select+.crm-select{margin-top:7px}

@media(max-width:1180px){
  .crm-pro-inbox-360{
    grid-template-columns:minmax(270px,310px) minmax(0,1fr)!important;
  }
  .crm-pro-context{grid-column:auto!important}
}
@media(max-width:760px){
  .crm-inbox-command{align-items:stretch}
  .crm-inbox-filters{
    flex-wrap:nowrap;
    overflow-x:auto;
  }
  .crm-inbox-filter{flex:0 0 auto}
  .crm-pro-inbox-360{grid-template-columns:1fr!important}
  .crm-pro-thread-list{min-height:280px}
  .crm-pro-context{
    position:fixed!important;
    top:72px;
    right:8px;
    bottom:8px;
    width:min(360px,calc(100vw - 16px));
    height:auto;
  }
  .crm-pro-message{max-width:88%}
  .crm-pro-customer-actions-compact{overflow-x:auto}
}
/* CRM standard pass — 2026-09-30 */
#crmRoot,
#crmRoot *,
.crm-modal-overlay *,
.crm-drawer-overlay * {
  box-sizing: border-box;
}
.crm-input,
.crm-select,
.crm-textarea {
  max-width: 100%;
}
.crm-form-grid .crm-input,
.crm-form-grid .crm-select,
.crm-form-grid .crm-textarea,
.crm-field > .crm-input,
.crm-field > .crm-select,
.crm-field > .crm-textarea {
  width: 100%;
}
.crm-shell {
  width: 100%;
  min-width: 0;
}
.crm-toolbar {
  margin: 0;
  min-height: 36px;
}
.crm-toolbar-actions-only {
  justify-content: flex-end;
}
.crm-panel,
.crm-kpi,
.crm-stage,
.crm-section,
.crm-case-filter,
.crm-business-card {
  box-shadow: none !important;
}
.crm-kpi {
  background: #111 !important;
}
.crm-panel-head,
.crm-section-head {
  flex-wrap: wrap;
}
.crm-table th,
.crm-table td {
  vertical-align: middle;
}
.crm-table td strong {
  line-height: 1.35;
}
.crm-filterbar > * {
  min-width: 0;
}
.crm-filterbar .crm-search {
  min-width: 220px;
}
.crm-kanban {
  grid-auto-columns: minmax(210px, 1fr);
  width: 100%;
}
.crm-stage {
  min-width: 0;
}
.crm-stage-head {
  overflow: hidden;
}
.crm-stage-head > div {
  min-width: 0;
}
.crm-stage-name,
.crm-stage-meta {
  min-width: 0;
}
.crm-deal {
  min-width: 0;
}
.crm-deal-title,
.crm-deal-contact {
  overflow-wrap: anywhere;
}
.crm-chat-input-wrap {
  width: 100%;
  min-width: 0;
}
.crm-chat-input-wrap .crm-textarea {
  display: block;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}
.crm-pro-composer {
  width: 100%;
}
.crm-pro-chat {
  overflow-y: auto;
}
.crm-pro-scroll {
  overflow-y: auto;
}
.crm-pro-thread-list,
.crm-pro-conversation-panel {
  min-width: 0;
}
.crm-pro-thread-main,
.crm-pro-customer-summary {
  min-width: 0;
}
.crm-inbox-command {
  padding: 0;
}
.crm-inbox-filters {
  min-width: 0;
}
.crm-inbox-search {
  flex: 0 1 300px;
}
.crm-pro-inbox-360 {
  min-width: 0;
}
.crm-case-filters {
  align-items: stretch;
}
.crm-case-filter {
  min-width: 0;
}
.sidebar-user-details {
  min-width: 0 !important;
}
.sidebar-user-plan {
  max-width: 100%;
  overflow: hidden;
}
.sidebar-user-plan span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item > span,
.nav-sub-item > span {
  min-width: 0;
  line-height: 1.25;
}
@media (min-width: 1181px) {
  .crm-pro-inbox-360 {
    min-height: calc(100vh - 205px);
  }
}
@media (max-width: 1180px) {
  .crm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .crm-kanban {
    grid-auto-columns: minmax(220px, 280px);
  }
}
@media (max-width: 760px) {
  .crm-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .crm-toolbar-actions-only {
    min-height: 0;
  }
  .crm-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .crm-filterbar > * {
    flex: 1 1 100%;
    width: 100%;
  }
  .crm-inbox-search {
    flex-basis: 100%;
  }
}
.crm-inbox-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.crm-inbox-command-actions .crm-inbox-search {
  width: min(300px, 42vw);
}
@media (max-width: 760px) {
  .crm-inbox-command-actions {
    width: 100%;
  }
  .crm-inbox-command-actions .crm-inbox-search {
    flex: 1 1 auto;
    width: auto;
  }
}


/* CRM audit polish — 2026-10-07 */
.crm-settings-section{display:flex;flex-direction:column;gap:10px}
.crm-settings-section>.crm-section-kicker{margin:2px 0 0}
.crm-settings-section .crm-pro-settings-grid{gap:12px}
.crm-universal-settings-highlight{background:#101010}
.crm-universal-settings-highlight .crm-pro-setting-body{display:flex;flex-direction:column;gap:10px}
.crm-universal-settings-highlight .crm-muted{margin:0;max-width:900px;line-height:1.55}
.crm-pro-inbox-360{height:calc(100vh - 190px);min-height:560px;max-height:760px}
.crm-pro-inbox-360 .crm-pro-thread-list{min-height:0;height:100%}
.crm-pro-inbox-360 .crm-pro-scroll{flex:1;min-height:0;max-height:none}
.crm-pro-inbox-360 .crm-pro-conversation-panel{height:100%}
.crm-pro-inbox-360 .crm-pro-chat{max-height:none;min-height:180px}
.crm-pro-customer-actions-compact{padding:7px 12px;border-bottom:1px solid var(--border);background:#0f0f0f}
.crm-pro-customer-actions-compact .crm-btn{min-height:30px;padding:0 10px;color:#a9a9a9;background:transparent}
.crm-pro-customer-actions-compact .crm-btn:hover{color:#fff;background:#171717}
.crm-chat-tools{background:#0f0f0f}
.crm-chat-composer{padding:10px 12px 12px;background:#0f0f0f;border-top:1px solid var(--border)}
.crm-chat-input-wrap .crm-textarea{font-size:12.5px!important}
.crm-case-filters{gap:8px}
.crm-case-filter{min-height:64px}
.crm-table .crm-btn{white-space:nowrap}
.crm-stage{min-height:360px}
.crm-stage-body{min-height:305px}
.crm-pro-settings-grid>.crm-panel{height:100%}
@media(max-width:1180px){.crm-pro-inbox-360{height:auto;max-height:none;min-height:620px}}
@media(max-width:760px){.crm-pro-inbox-360{min-height:0}.crm-settings-section .crm-pro-settings-grid{grid-template-columns:1fr}.crm-pro-customer-actions-compact{overflow-x:auto;flex-wrap:nowrap}.crm-pro-customer-actions-compact .crm-btn{flex:0 0 auto}}

/* CRM collision polish — 2026-10-07 */
.crm-ticket-table{
  min-width:980px;
}
.crm-ticket-table th:nth-child(1),
.crm-ticket-table td:nth-child(1){
  min-width:260px;
  width:30%;
}
.crm-ticket-table th:nth-child(2),
.crm-ticket-table td:nth-child(2){
  min-width:110px;
}
.crm-ticket-table th:nth-child(3),
.crm-ticket-table td:nth-child(3){
  min-width:155px;
}
.crm-ticket-table th:nth-child(4),
.crm-ticket-table td:nth-child(4){
  min-width:180px;
}
.crm-ticket-table th:nth-child(5),
.crm-ticket-table td:nth-child(5){
  min-width:145px;
}
.crm-ticket-table th:nth-child(6),
.crm-ticket-table td:nth-child(6){
  min-width:135px;
}
.crm-ticket-table td:first-child strong,
.crm-ticket-table td:first-child .crm-muted{
  overflow-wrap:break-word;
  word-break:normal;
}
@media(max-width:760px){
  .crm-kanban{
    grid-auto-columns:minmax(280px,calc(100vw - 52px))!important;
    scroll-snap-type:x proximity;
    overscroll-behavior-x:contain;
  }
  .crm-stage{
    scroll-snap-align:start;
  }
}
@media(max-width:520px){
  .crm-chat-tools{
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .crm-chat-tools .crm-chat-replies{
    flex:1 1 100%;
    flex-wrap:wrap;
    overflow-x:visible;
    padding-right:0!important;
  }
  .crm-chat-tools .crm-chat-replies button{
    flex:0 0 auto;
  }
  .crm-chat-tools .crm-ai-main{
    margin-left:auto;
  }
}

/* Grupos / audiências — correção de header responsivo */
.groups-card-header{
  align-items:flex-start!important;
  gap:12px;
}
.groups-card-heading{
  min-width:0;
  flex:1 1 280px;
}
.groups-card-heading .card-title,
.groups-card-heading .card-desc{
  overflow-wrap:anywhere;
}
.groups-card-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  flex:0 0 auto;
}
.groups-card-actions .btn{
  white-space:nowrap;
}
@media(max-width:760px){
  .groups-card-header{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
  }
  .groups-card-heading{
    width:100%;
    flex:0 0 auto;
  }
  .groups-card-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    justify-content:stretch;
  }
  .groups-card-actions .btn{
    width:100%;
    min-width:0;
    justify-content:center;
  }
}
@media(max-width:420px){
  .groups-card-actions{
    grid-template-columns:1fr;
  }
}

.groups-table td:nth-child(2),
.groups-table th:nth-child(2){
  min-width:180px;
}
@media(max-width:520px){
  .groups-table{
    min-width:0!important;
    width:100%;
    table-layout:fixed;
  }
  .groups-table th:first-child,
  .groups-table td:first-child{
    width:44px!important;
  }
  .groups-table th:nth-child(2),
  .groups-table td:nth-child(2){
    width:auto!important;
    min-width:0!important;
  }
  .groups-table th:nth-child(3),
  .groups-table td:nth-child(3){
    width:92px!important;
  }
  .groups-table th:nth-child(3){
    font-size:8px;
    letter-spacing:.04em;
  }
  .groups-table td:nth-child(2)>div:first-child{
    line-height:1.35;
  }
  .groups-table td:nth-child(3) .mono{
    font-size:9.5px!important;
    padding:3px 6px!important;
  }
}

/* Inbox V2 — chat responsivo + áudio */
.crm-pro-inbox-360{
  overflow:hidden;
  height:calc(100vh - 178px);
  min-height:560px;
  max-height:none;
  grid-template-columns:minmax(310px,350px) minmax(0,1fr)!important;
  align-items:stretch;
}
.crm-pro-inbox-360 .crm-pro-thread-list,
.crm-pro-inbox-360 .crm-pro-conversation-panel{
  height:100%;
  min-height:0;
}
.crm-pro-conversation-panel{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.crm-pro-conversation-panel>.crm-empty{
  margin:auto;
}
.crm-pro-inbox-360 .crm-pro-scroll{
  flex:1;
  min-height:0;
  max-height:none;
}
.crm-pro-chat{
  flex:1 1 auto;
  min-height:0!important;
  max-height:none!important;
  padding:18px 18px 24px!important;
  scroll-behavior:smooth;
}
.crm-pro-message{
  width:fit-content;
  min-width:118px;
  max-width:min(72%,640px);
  padding:9px 11px 8px;
  border-radius:12px 12px 12px 4px;
  background:#151515;
}
.crm-pro-message.out{
  border-radius:12px 12px 4px 12px;
  background:#1b1114;
}
.crm-pro-message small{
  margin-top:5px;
  font-size:9.5px;
  opacity:.82;
}
.crm-pro-thread.active{
  background:#171717;
  box-shadow:inset 2px 0 0 var(--accent-red);
}
.crm-pro-thread .crm-list-title{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.crm-chat-back{
  display:none;
  flex:0 0 auto;
  width:34px;
  height:34px;
  align-items:center;
  justify-content:center;
  border:1px solid #292929;
  border-radius:9px;
  background:#121212;
  color:#ddd;
  font-size:18px;
  cursor:pointer;
}
.crm-chat-back:hover{background:#191919;color:#fff}
.crm-pro-conversation-head{
  flex-wrap:nowrap!important;
  gap:10px;
}
.crm-pro-customer-summary{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  overflow:hidden;
}
.crm-pro-customer-summary>div:last-child{
  min-width:0;
}
.crm-pro-customer-summary .crm-panel-title,
.crm-pro-customer-summary .crm-panel-subtitle{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.crm-pro-conversation-state{
  margin-left:auto;
  display:flex;
  align-items:center;
}

/* Composer inspirado em mensageiros, sem validação nativa do navegador */
.crm-chat-composer{
  display:block!important;
  width:100%;
  padding:9px 10px 10px!important;
  border-top:1px solid #202020;
  background:#0d0d0d;
}
.crm-chat-compose-row{
  display:flex;
  align-items:flex-end;
  gap:8px;
  width:100%;
}
.crm-composer-icon{
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #292929;
  border-radius:12px;
  background:#151515;
  color:#c8c8c8;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease;
}
.crm-composer-icon:hover{
  background:#1b1b1b;
  border-color:#373737;
  color:#fff;
}
.crm-composer-icon:active{transform:scale(.97)}
.crm-composer-icon svg{
  width:19px;
  height:19px;
  fill:currentColor;
}
.crm-chat-mic.recording{
  color:#fff;
  border-color:rgba(255,41,77,.65);
  background:rgba(255,41,77,.16);
}
.crm-chat-input-wrap{
  position:relative;
  flex:1 1 auto;
  min-width:0;
  border:1px solid #292929;
  border-radius:13px;
  background:#141414;
  overflow:hidden;
  transition:border-color .15s ease,background .15s ease;
}
.crm-chat-input-wrap:focus-within{
  border-color:#3b3b3b;
  background:#161616;
}
.crm-chat-input-wrap .crm-textarea{
  min-height:43px!important;
  max-height:120px!important;
  padding:11px 12px 20px!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  resize:none!important;
  overflow-y:auto!important;
  background:transparent!important;
  box-shadow:none!important;
  line-height:1.45;
}
.crm-chat-input-wrap .crm-textarea:focus{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
}
.crm-chat-input-meta{
  position:absolute;
  left:12px;
  right:10px;
  bottom:4px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  pointer-events:none;
  color:#606060;
  font-size:8.5px;
}
.crm-chat-input-meta span:first-child{
  display:flex;
  align-items:center;
  gap:5px;
}
.crm-chat-input-meta i{
  width:5px;
  height:5px;
  display:inline-block;
  border-radius:50%;
  background:#20c76b;
}
.crm-chat-send{
  display:none!important;
  min-width:74px;
  height:44px!important;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  border-radius:12px!important;
}
.crm-chat-composer.has-text .crm-chat-send{
  display:inline-flex!important;
}
.crm-chat-composer.has-text .crm-chat-mic{
  display:none!important;
}

/* Gravação e preview */
.crm-audio-recorder{
  margin-top:8px;
  width:100%;
}
.crm-audio-recorder[hidden]{display:none!important}
.crm-audio-recording-live,
.crm-audio-preview{
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 9px 8px 12px;
  border:1px solid #2b2b2b;
  border-radius:12px;
  background:#131313;
}
.crm-audio-live-status{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  color:#e8e8e8;
  font-size:11px;
}
.crm-audio-live-status strong{font-size:11px}
.crm-audio-live-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--accent-red);
  box-shadow:0 0 0 0 rgba(255,41,77,.45);
  animation:crmAudioPulse 1.2s ease-out infinite;
}
@keyframes crmAudioPulse{
  0%{box-shadow:0 0 0 0 rgba(255,41,77,.42)}
  70%{box-shadow:0 0 0 8px rgba(255,41,77,0)}
  100%{box-shadow:0 0 0 0 rgba(255,41,77,0)}
}
.crm-audio-live-actions,
.crm-audio-preview-actions{
  display:flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
}
.crm-audio-preview-player{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  gap:9px;
}
.crm-audio-preview-player audio{
  width:min(360px,100%);
  height:34px;
}
.crm-audio-preview-player>span{
  color:#777;
  font-size:10px;
  font-variant-numeric:tabular-nums;
}
.crm-pro-message.audio{
  min-width:260px;
  padding:8px 10px 7px;
}
.crm-audio-message{
  display:flex;
  align-items:center;
  gap:8px;
}
.crm-audio-message-icon{
  width:26px;
  height:26px;
  flex:0 0 26px;
  display:none;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#242424;
  color:#fff;
  font-size:9px;
}
.crm-audio-message audio{
  display:block;
  width:270px;
  max-width:100%;
  height:34px;
}
.crm-audio-unavailable{
  color:#c9c9c9;
  font-size:11.5px;
}

/* Mobile: lista e conversa viram duas telas, como WhatsApp */
@media(max-width:900px){
  .crm-pro-inbox-360{
    display:block!important;
    height:calc(100dvh - 180px);
    min-height:520px!important;
  }
  .crm-pro-inbox-360 .crm-pro-thread-list{
    display:flex!important;
    width:100%;
    height:100%;
  }
  .crm-pro-inbox-360 .crm-pro-conversation-panel{
    display:none!important;
    width:100%;
    height:100%;
  }
  .crm-pro-inbox-360.conversation-open .crm-pro-thread-list{
    display:none!important;
  }
  .crm-pro-inbox-360.conversation-open .crm-pro-conversation-panel{
    display:flex!important;
  }
  #crmRoot.crm-mobile-chat-open .crm-inbox-command{
    display:none!important;
  }
  .crm-chat-back{
    display:inline-flex;
  }
}
@media(max-width:640px){
  .crm-shell{gap:8px}
  .crm-inbox-command{
    margin-bottom:8px;
  }
  .crm-inbox-command-actions{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }
  .crm-inbox-command-actions .crm-inbox-search{
    width:100%;
  }
  .crm-pro-inbox-360{
    height:calc(100dvh - 150px);
    min-height:480px!important;
    gap:0!important;
  }
  .crm-pro-thread-list,
  .crm-pro-conversation-panel{
    border-radius:10px!important;
  }
  .crm-pro-conversation-head{
    min-height:62px;
    padding:8px 9px!important;
  }
  .crm-pro-customer-summary .crm-avatar{
    width:34px;
    height:34px;
    flex:0 0 34px;
  }
  .crm-pro-customer-summary .crm-panel-title{
    font-size:12px;
  }
  .crm-pro-customer-summary .crm-panel-subtitle{
    font-size:9.5px;
  }
  .crm-pro-conversation-state .crm-select{
    width:112px;
    min-width:112px;
    font-size:9.5px!important;
  }
  .crm-details-toggle{
    padding:0 8px!important;
    font-size:9.5px!important;
  }
  .crm-pro-customer-actions-compact{
    scrollbar-width:none;
  }
  .crm-pro-customer-actions-compact::-webkit-scrollbar{display:none}
  .crm-pro-chat{
    padding:14px 10px 18px!important;
  }
  .crm-pro-message{
    max-width:88%;
    font-size:12px;
  }
  .crm-pro-message.audio{
    min-width:min(250px,86%);
  }
  .crm-chat-tools{
    padding:7px 8px;
  }
  .crm-chat-composer{
    padding:8px!important;
  }
  .crm-composer-icon{
    width:42px;
    height:42px;
    flex-basis:42px;
  }
  .crm-chat-input-wrap .crm-textarea{
    min-height:42px!important;
  }
  .crm-chat-send{
    min-width:64px;
    height:42px!important;
  }
  .crm-chat-input-meta span:first-child{
    max-width:110px;
    overflow:hidden;
    white-space:nowrap;
  }
  .crm-audio-recording-live,
  .crm-audio-preview{
    align-items:stretch;
    flex-direction:column;
  }
  .crm-audio-live-actions,
  .crm-audio-preview-actions{
    width:100%;
  }
  .crm-audio-live-actions .crm-btn,
  .crm-audio-preview-actions .crm-btn{
    flex:1;
  }
  .crm-audio-preview-player{
    width:100%;
  }
  .crm-audio-preview-player audio{
    width:100%;
  }
}
@media(max-width:430px){
  .crm-pro-conversation-state .crm-details-toggle{
    display:none;
  }
  .crm-pro-conversation-state .crm-select{
    width:104px;
    min-width:104px;
  }
  .crm-pro-customer-summary .crm-avatar{
    display:none;
  }
  .crm-pro-message.audio{
    min-width:230px;
  }
}

/* Tablet: libera largura útil do CRM e usa menu lateral por drawer */
@media(min-width:761px) and (max-width:900px){
  body{overflow:hidden!important}
  aside.sidebar{
    position:fixed!important;
    inset:0 auto 0 0;
    z-index:2200!important;
    width:232px!important;
    transform:translateX(-102%);
    transition:transform .22s ease;
    box-shadow:18px 0 50px rgba(0,0,0,.35)!important;
  }
  body.mobile-nav-open aside.sidebar{transform:translateX(0)}
  .mobile-nav-toggle{display:inline-flex}
  .mobile-nav-backdrop{
    position:fixed;
    inset:0 0 0 232px;
    z-index:2100;
    background:rgba(0,0,0,.52);
  }
  body.mobile-nav-open .mobile-nav-backdrop{display:block}
  .main-wrapper{
    width:100%!important;
    min-width:0!important;
  }
  .top-header{
    min-height:64px!important;
    padding:12px 14px!important;
  }
  .top-header-left{min-width:0}
  .top-header-icon{display:none!important}
  .page-subtitle{
    max-width:300px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  .user-profile-info{display:none!important}
  .content-area{
    width:100%;
    padding:14px!important;
  }
}

@media(max-width:430px){
  .crm-pro-conversation-head{
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    grid-template-rows:auto auto;
    align-items:center!important;
    gap:7px 9px!important;
    padding:8px 9px!important;
  }
  .crm-pro-conversation-head .crm-chat-back{
    grid-column:1;
    grid-row:1;
    margin:0;
  }
  .crm-pro-conversation-head .crm-pro-customer-summary{
    grid-column:2;
    grid-row:1;
    width:100%;
  }
  .crm-pro-conversation-head .crm-pro-conversation-state{
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    margin:0;
  }
  .crm-pro-conversation-head .crm-pro-conversation-state .crm-select{
    width:100%!important;
    min-width:0!important;
  }
}

/* Inbox layout correction — 2026-10-08 */
body.crm-inbox-active .main-wrapper{
  overflow:hidden!important;
}
body.crm-inbox-active .content-area{
  flex:1 1 auto;
  min-height:0!important;
  overflow:hidden!important;
  padding:18px 20px!important;
}
body.crm-inbox-active .app-footer{
  display:none!important;
}
body.crm-inbox-active #crmRoot,
body.crm-inbox-active .crm-inbox-shell{
  height:100%;
  min-height:0;
}
.crm-inbox-shell{
  gap:0!important;
}
.crm-pro-inbox-360{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  grid-template-columns:minmax(320px,350px) minmax(0,1fr)!important;
  gap:12px!important;
}
.crm-inbox-list-head{
  min-height:58px;
  padding:11px 12px 9px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid #202020;
}
.crm-inbox-list-head>div{
  min-width:0;
}
.crm-inbox-list-head .crm-panel-title{
  font-size:12.5px;
}
.crm-inbox-list-head .crm-panel-subtitle{
  margin-top:2px;
  font-size:9.5px;
}
.crm-new-ticket-btn{
  min-height:30px!important;
  padding:0 9px!important;
  flex:0 0 auto;
  font-size:9.5px!important;
}
.crm-inbox-list-controls{
  padding:9px 10px 8px;
  border-bottom:1px solid #202020;
  background:#0e0e0e;
}
.crm-inbox-list-controls .crm-inbox-search{
  width:100%!important;
  height:34px!important;
  margin:0 0 7px;
  flex:none!important;
  background:#121212!important;
}
.crm-inbox-list-controls .crm-inbox-filters{
  width:100%;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  overflow:visible;
}
.crm-inbox-list-controls .crm-inbox-filter{
  width:100%;
  height:30px;
  padding:0 6px;
  justify-content:center;
  gap:4px;
  border-radius:7px;
}
.crm-inbox-list-controls .crm-inbox-filter strong{
  font-size:10px;
}
.crm-inbox-list-controls .crm-inbox-filter span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:8.5px;
}
.crm-pro-thread{
  min-height:66px;
}
.crm-pro-thread-side{
  min-width:62px;
}
.crm-pro-thread-side small{
  white-space:nowrap;
  font-size:8.5px;
}
.crm-pro-conversation-panel{
  border-radius:12px!important;
}
.crm-pro-conversation-head{
  min-height:60px;
  border-bottom:1px solid #202020;
}
.crm-pro-customer-actions-compact{
  min-height:43px;
  align-items:center;
}
.crm-pro-chat{
  /* Mesmo tom-base dos cards do Vabion System: separação por borda e
     tipografia, sem alternar grandes blocos para tons diferentes. */
  background:#101010!important;
}
.crm-pro-thread-list,
.crm-pro-conversation-panel,
.crm-chat-composer{
  background:#111!important;
  border-color:#252525!important;
}
.crm-pro-message{
  background:#171717!important;
  border-color:#2a2a2a!important;
}
.crm-pro-message.out{
  /* Mantém o mesmo acabamento dos demais cards, sem marcador lateral. */
  background:#171717!important;
  border-color:#2a2a2a!important;
  box-shadow:none!important;
}
.crm-chat-tools{
  min-height:44px;
  padding:7px 10px!important;
}
.crm-chat-replies{
  display:flex;
  align-items:center;
  gap:6px;
  overflow-x:auto!important;
  scrollbar-width:none;
}
.crm-chat-replies::-webkit-scrollbar{
  display:none;
}
.crm-chat-replies button{
  flex:0 0 auto;
}

/* Custom dark voice player */
.crm-voice-player{
  width:280px;
  max-width:100%;
  min-height:38px;
  display:grid;
  grid-template-columns:34px minmax(80px,1fr) 38px;
  align-items:center;
  gap:8px;
}
.crm-voice-player audio{
  display:none!important;
}
.crm-voice-play{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:50%;
  background:#242424;
  color:#f4f4f4;
  font-size:11px;
  cursor:pointer;
}
.crm-pro-message.out .crm-voice-play{
  background:rgba(255,41,77,.16);
  color:#ff7890;
}
.crm-voice-play:hover{
  background:#2c2c2c;
}
.crm-voice-range{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  height:3px;
  margin:0;
  border:0;
  border-radius:999px;
  background:#3a3a3a;
  outline:0;
  cursor:pointer;
}
.crm-voice-range::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#d8d8d8;
}
.crm-voice-range::-moz-range-thumb{
  width:10px;
  height:10px;
  border:0;
  border-radius:50%;
  background:#d8d8d8;
}
.crm-voice-time{
  color:#777;
  font-size:9.5px;
  font-variant-numeric:tabular-nums;
  text-align:right;
}
.crm-audio-preview-player{
  width:min(340px,100%);
}
.crm-audio-preview-player .crm-voice-player{
  width:100%;
}
.crm-audio-preview-player>span{
  display:none!important;
}

/* Desktop keeps both panes; narrower screens use one pane at a time */
@media(max-width:1100px){
  .crm-pro-inbox-360{
    display:block!important;
    height:100%!important;
  }
  .crm-pro-inbox-360 .crm-pro-thread-list{
    display:flex!important;
    width:100%;
    height:100%;
  }
  .crm-pro-inbox-360 .crm-pro-conversation-panel{
    display:none!important;
    width:100%;
    height:100%;
  }
  .crm-pro-inbox-360.conversation-open .crm-pro-thread-list{
    display:none!important;
  }
  .crm-pro-inbox-360.conversation-open .crm-pro-conversation-panel{
    display:flex!important;
  }
  #crmRoot.crm-mobile-chat-open .crm-inbox-list-head,
  #crmRoot.crm-mobile-chat-open .crm-inbox-list-controls{
    display:none!important;
  }
  .crm-chat-back{
    display:inline-flex!important;
  }
}
@media(min-width:901px) and (max-width:1100px){
  aside.sidebar{
    position:fixed!important;
    inset:0 auto 0 0;
    z-index:2200!important;
    width:232px!important;
    transform:translateX(-102%);
    transition:transform .22s ease;
    box-shadow:18px 0 50px rgba(0,0,0,.35)!important;
  }
  body.mobile-nav-open aside.sidebar{
    transform:translateX(0);
  }
  .mobile-nav-toggle{
    display:inline-flex!important;
  }
  .mobile-nav-backdrop{
    position:fixed;
    inset:0 0 0 232px;
    z-index:2100;
    background:rgba(0,0,0,.52);
  }
  body.mobile-nav-open .mobile-nav-backdrop{
    display:block;
  }
  .main-wrapper{
    width:100%!important;
    min-width:0!important;
  }
  .top-header{
    min-height:64px!important;
    padding:12px 14px!important;
  }
  .top-header-icon{
    display:none!important;
  }
  .user-profile-info{
    display:none!important;
  }
}
@media(max-width:640px){
  body.crm-inbox-active .content-area{
    padding:10px 12px!important;
  }
  .crm-inbox-list-head{
    min-height:54px;
    padding:9px 10px 8px;
  }
  .crm-inbox-list-controls{
    padding:8px;
  }
  .crm-inbox-list-controls .crm-inbox-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .crm-inbox-list-controls .crm-inbox-filter{
    justify-content:flex-start;
    padding:0 9px;
  }
  .crm-pro-message.audio{
    min-width:245px;
  }
  .crm-voice-player{
    width:245px;
    grid-template-columns:32px minmax(70px,1fr) 36px;
    gap:7px;
  }
  .crm-voice-play{
    width:32px;
    height:32px;
  }
}

/* Inbox viewport fill fix */
body.crm-inbox-active .content-area{
  height:calc(100vh - 70px)!important;
  height:calc(100dvh - 70px)!important;
  flex:0 0 auto!important;
  min-height:0!important;
}
body.crm-inbox-active #crmRoot{
  height:100%!important;
  min-height:0!important;
}
body.crm-inbox-active .crm-inbox-shell,
body.crm-inbox-active .crm-pro-inbox-360{
  height:100%!important;
  min-height:0!important;
}
@media(max-width:1100px){
  body.crm-inbox-active .content-area{
    height:calc(100vh - 64px)!important;
    height:calc(100dvh - 64px)!important;
  }
}

/* Propagação correta de altura até a Inbox */
body.crm-inbox-active .content-area{
  display:flex!important;
  flex-direction:column!important;
}
body.crm-inbox-active #tab-crm.active{
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  min-height:0!important;
  height:100%!important;
}
body.crm-inbox-active #tab-crm.active>#crmRoot{
  flex:1 1 auto!important;
  min-height:0!important;
  height:100%!important;
}

/* Perfil e Conta — sem faturamento */
.profile-account-modal{
  width:min(560px,calc(100vw - 28px))!important;
  max-width:560px!important;
  max-height:min(720px,calc(100dvh - 28px));
  overflow:auto;
  padding:22px!important;
  border-radius:16px!important;
}
.profile-account-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding-bottom:16px;
  border-bottom:1px solid var(--border);
}
.profile-account-head .custom-modal-title{
  margin:0 0 4px;
  font-size:17px;
}
.profile-account-head .custom-modal-desc{
  margin:0;
  max-width:360px;
}
.profile-close-btn{
  width:32px;
  height:32px;
  flex:0 0 32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(255,255,255,.035);
  color:var(--text-tert);
  cursor:pointer;
}
.profile-close-btn:hover{
  color:#fff;
  background:rgba(255,255,255,.07);
}
.profile-photo-section{
  display:flex;
  align-items:center;
  gap:15px;
  padding:20px 0;
}
.profile-photo-button{
  position:relative;
  width:76px;
  height:76px;
  flex:0 0 76px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:1px solid rgba(255,41,77,.28);
  border-radius:22px;
  background:#171717;
  color:#fff;
  font-size:24px;
  font-weight:750;
  cursor:pointer;
}
.profile-photo-button img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.profile-photo-edit{
  position:absolute;
  right:5px;
  bottom:5px;
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.16);
  border-radius:8px;
  background:#111;
  color:#fff;
}
.profile-photo-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}
.profile-photo-copy strong{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#f8f8f8;
  font-size:14px;
}
.profile-photo-copy>span{
  color:var(--text-tert);
  font-size:10.5px;
}
.profile-photo-change{
  margin-top:4px;
  padding:0;
  border:0;
  background:transparent;
  color:#ff5975;
  font-size:10.5px;
  font-weight:650;
  cursor:pointer;
}
.profile-photo-change:hover{color:#ff7890}
.profile-account-section{
  padding:16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.018);
}
.profile-section-title{
  margin-bottom:13px;
  color:#f2f2f2;
  font-size:12px;
  font-weight:700;
}
.profile-account-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:13px;
}
.profile-field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.profile-field>span{
  color:#a1a1aa;
  font-size:10px;
  font-weight:600;
}
.profile-field .input-control{
  width:100%;
  min-width:0;
  height:39px;
  border-radius:9px;
  background:#111!important;
}
.profile-readonly{
  color:#777!important;
  cursor:not-allowed;
}
.profile-field small{
  color:#5f5f65;
  font-size:8.5px;
  line-height:1.35;
}
.profile-account-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-top:12px;
  padding:10px 11px;
  border:1px solid #232323;
  border-radius:9px;
  background:#101010;
  color:#74747b;
  font-size:9.5px;
  line-height:1.45;
}
.profile-account-note svg{
  flex:0 0 auto;
  margin-top:1px;
}
.profile-account-actions{
  margin-top:18px!important;
  padding-top:14px!important;
  border-top:1px solid var(--border);
}
.sidebar-user-avatar,
.user-profile-avatar{
  overflow:hidden;
}
.sidebar-user-avatar img,
.user-profile-avatar img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.sidebar-user-avatar.has-profile-image,
.user-profile-avatar.has-profile-image{
  background:#171717!important;
}
@media(max-width:620px){
  .profile-account-modal{
    width:calc(100vw - 20px)!important;
    padding:17px!important;
    border-radius:14px!important;
  }
  .profile-photo-section{
    padding:17px 0;
  }
  .profile-account-grid{
    grid-template-columns:1fr;
  }
  .profile-account-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr;
  }
  .profile-account-actions .btn{
    width:100%;
    justify-content:center;
  }
}

/* Ajuste final do modal de perfil */
.profile-account-modal{
  background:#0d0e10!important;
  border-color:#25262a!important;
}
.profile-account-section{
  background:#111214!important;
}
.profile-field .input-control{
  background:#0b0b0c!important;
}
.profile-photo-button img[hidden]{
  display:none!important;
}

/* Sistema visual unificado - atendimento, alertas e feedback. */
.crm-alerts-panel{
  margin-top:12px;
  background:#151012!important;
  border-color:rgba(225,29,60,.34)!important;
  box-shadow:none!important;
}
.crm-alerts-panel .crm-panel-title{color:#f5f5f5}
.crm-alerts-panel .crm-panel-subtitle{color:#8b8b8b}
.crm-alert-row{border-top-color:#2a2022!important;color:#ededed!important;transition:background-color .16s ease}
.crm-alert-row:hover{background:#1b1315!important}
.crm-alert-row span{color:#8b8b8b!important}

/* A conversa selecionada usa contraste, sem a linha lateral genérica. */
.crm-pro-thread.active{background:#1a1718!important;box-shadow:none!important;border-left-color:transparent!important}
.crm-wa-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.crm-wa-summary>div,.crm-wa-card{padding:16px;border:1px solid var(--border);border-radius:10px;background:#111}.crm-wa-summary small{display:block;color:var(--text-tert);font-size:10px;letter-spacing:.08em}.crm-wa-summary b{display:block;margin:7px 0 3px;font-size:22px}.crm-wa-summary span,.crm-wa-card small,.crm-wa-meta{color:var(--text-sec);font-size:12px}.crm-wa-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}.crm-wa-card{display:flex;flex-direction:column;gap:15px}.crm-wa-card header{display:flex;align-items:center;gap:10px}.crm-wa-card header>div:nth-child(2){min-width:0;flex:1}.crm-wa-card header strong,.crm-wa-card header small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-wa-status{font-size:11px;padding:4px 8px;border-radius:99px;background:#242424;color:#aaa}.crm-wa-status.online{background:#0e2c1c;color:#51d88e}.crm-wa-status.qr{background:#34280b;color:#f4c04a}.crm-wa-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.crm-wa-stats div{background:#181818;border-radius:7px;padding:8px}.crm-wa-stats b,.crm-wa-stats span{display:block}.crm-wa-stats b{font-size:15px}.crm-wa-stats span{color:var(--text-tert);font-size:10px}.crm-wa-meta{display:grid;gap:5px}.crm-wa-meta span{display:flex;justify-content:space-between;gap:9px}.crm-wa-meta b{font-weight:500;color:#ddd;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-wa-card footer{display:flex;gap:7px;margin-top:auto}.crm-wa-card footer .crm-btn{flex:1;justify-content:center}.crm-wa-add{min-height:235px;border:1.5px dashed #3b3436;border-radius:10px;background:transparent;color:var(--text-sec);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;cursor:pointer;padding:18px}.crm-wa-add:hover{border-color:var(--accent-red)}.crm-wa-add b{display:grid;place-items:center;width:38px;height:38px;border:1px solid #4a3c40;border-radius:50%;color:#ff8799;font-size:22px}.crm-wa-add strong{color:#f5f5f5}.crm-wa-add span{font-size:12px;text-align:center;max-width:190px}.crm-wa-qr{display:block;width:min(280px,100%);margin:18px auto;border-radius:9px;background:#fff;padding:10px}.crm-wa-steps{color:var(--text-sec);line-height:1.7}@media(max-width:900px){.crm-wa-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.crm-wa-summary{grid-template-columns:1fr}.crm-wa-card footer{flex-wrap:wrap}}
.crm-pro-thread.active::before{display:none!important}

/* Mensagens e cartões compartilham a mesma superfície escura. */
.crm-pro-message,.crm-pro-message.out{background:#171717!important;border-color:#2a2a2a!important;box-shadow:none!important}
.crm-pro-message.out .crm-voice-play{background:#292022;color:#ff9aaa}
.crm-panel,.crm-kpi,.crm-stage,.crm-section,.crm-kanban-column,.crm-business-card{background:#111!important;border-color:#242424!important;box-shadow:none!important}
.crm-panel-head,.crm-pro-conversation-head,.crm-inbox-list-head{border-bottom-color:#242424!important}

/* Estados de foco e toque claros, sem aparência de erro. */
.crm-btn:focus-visible,.crm-input:focus-visible,.crm-select:focus-visible,.crm-textarea:focus-visible,.crm-inbox-filter:focus-visible,.crm-alert-row:focus-visible{outline:2px solid rgba(230,0,35,.72);outline-offset:2px}
@media (prefers-reduced-motion: reduce){.crm-btn,.crm-pro-thread,.crm-alert-row,.crm-deal{transition:none!important}}
