:root {
  --bg: #e6e6e6;
  --panel: #ffffff;
  --ink: #191919;
  --muted: #6d6a66;
  --accent: #ff0000;
  --accent-2: #0f6f6f;
  --accent-3: #f2c14e;
  --line: #e5ded3;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #e6e6e6 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 0%, #eaf7f5 0%, transparent 45%),
              var(--bg);
}
.app-body {
  overflow: hidden;
  overflow-x: hidden;
}
.shell {
  width: 100%;
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}
.sidebar {
  min-width: 0;
  height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--sidebar-bg, #11100f);
  color: #f7f2ea;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}
.content {
  min-width: 0;
  height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 6px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.logo--image {
  display: flex;
  justify-content: center;
  align-items: center;
}
.logo--image-login {
  width: 100%;
}
.logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #f08a61);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.logo-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.2);
}
.logo-img-sidebar {
  width: 60%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  border: none;
}
.logo-img-login {
  width: 120px;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  border: none;
}
.logo-preview {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}
.logo-preview--small {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}
.logo-preview-box--small {
  min-height: 64px;
}
.logo-preview--wide {
  width: 180px;
  height: 90px;
  border-radius: 12px;
}
.logo-preview-box--wide {
  min-height: 90px;
}
.color-compact {
  height: 42px;
  padding: 4px;
}
.logo-upload {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: center;
}
.logo-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-painel {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  border-radius: 12px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 420px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  pointer-events: none;
}
.toast-painel.show {
  opacity: 1;
  transform: translateY(0);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}
.toast-text {
  font-size: 13px;
  color: var(--ink);
}
.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #e6f6f1;
  color: #0f6f6f;
  flex-shrink: 0;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.toast-success {
  border-left-color: #0f6f6f;
}
.toast-success .toast-icon {
  background: #e6f6f1;
  color: #0f6f6f;
}
.toast-warning {
  border-left-color: #f2c14e;
}
.toast-warning .toast-icon {
  background: #fff6dc;
  color: #8a6a12;
}
.toast-error {
  border-left-color: #b4442a;
}
.toast-error .toast-icon {
  background: #fff0e7;
  color: #b4442a;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.nav a {
  color: var(--sidebar-link, #efe8de);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.nav a.nav-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.nav a .nav-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav a .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-link, #efe8de);
}
.nav a .nav-icon svg {
  width: 18px;
  height: 18px;
}
.nav a.active {
  background: rgba(255, 255, 255, 0.1);
  border: 0px solid white;
}
.nav-group {
  margin-top: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sidebar-link, #efe8de);
  padding: 8px 12px;
  background: transparent;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
}
.nav-group .nav-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-group .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-link, #efe8de);
}
.nav-group .nav-icon svg {
  width: 18px;
  height: 18px;
}
.nav-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--sidebar-link, #efe8de);
  border-bottom: 2px solid var(--sidebar-link, #efe8de);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.nav-group[aria-expanded="true"] .nav-caret {
  transform: rotate(-135deg);
}
.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-left: 6px;
}
.nav-submenu.open {
  display: flex;
}
.nav-submenu.open {
  padding: 8px 10px;
  margin-left: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}
.nav-submenu.open a {
  padding-left: 10px;
}
.nav-group[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.tag {
  font-size: 11px;
  background: #2a2420;
  padding: 2px 8px;
  border-radius: 999px;
  color: #f2c14e;
}
.user {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2a2420;
  font-size: 12px;
  color: #d9cfc4;
}

body.sidebar-collapsed .shell {
  grid-template-columns: 88px minmax(0, 1fr);
}
body.sidebar-collapsed .sidebar {
  padding: 16px 10px;
}
body.sidebar-collapsed .logo-img-sidebar {
  width: 80%;
}
body.sidebar-collapsed .nav a,
body.sidebar-collapsed .nav-group {
  justify-content: center;
}
body.sidebar-collapsed .nav a .nav-label,
body.sidebar-collapsed .nav-group .nav-label {
  font-size: 0;
  gap: 0;
}
body.sidebar-collapsed .nav a .nav-icon,
body.sidebar-collapsed .nav-group .nav-icon {
  width: 22px;
  height: 22px;
}
body.sidebar-collapsed .nav a .nav-icon svg,
body.sidebar-collapsed .nav-group .nav-icon svg {
  width: 20px;
  height: 20px;
}
body.sidebar-collapsed .tag,
body.sidebar-collapsed .nav-caret,
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .user {
  display: none !important;
}
.avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  background: #1f1c19;
  border: 1px solid #2e2924;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #efe8de;
  font-weight: 700;
  margin: 0 auto 12px;
}
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #f7f3ee;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}
.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-upload {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.avatar-wrapper {
  position: relative;
  display: inline-flex;
}
.avatar-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  background: #f7f3ee;
  position: relative;
  overflow: hidden;
}
.avatar-circle input {
  display: none;
}
.avatar-circle span {
  padding: 0 10px;
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.avatar-wrapper.has-image .avatar-circle span {
  display: none;
}
.avatar-wrapper.has-image .avatar-circle img {
  display: block;
}
.avatar-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #1f1c19;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.content {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
}
.app-footer {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--sidebar-bg, #11100f);
  color: #f2f2f2;
  border-radius: 14px;
  font-size: 12px;
  text-align: center;
}
.app-footer .footer-link {
  color: #ffffff;
  text-decoration: none;
}
.app-footer .footer-link:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
}

.mapa-vendedores {
  display: grid;
  gap: 16px;
}

.mapa-container {
  width: 100%;
  height: clamp(360px, 60vh, 720px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e9e6e2;
}

.topbar {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f7f3ee;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}
.sidebar-toggle:hover {
  background: #efe8de;
}
.search {
  background: #f7f3ee;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  width: auto;
  flex: 1 1 260px;
  min-width: 200px;
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.top-filters {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-group label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.top-filters .form-select {
  background: #f7f3ee;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: #f7f3ee;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-icon svg {
  width: 18px;
  height: 18px;
}
.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
.btn-icon--edit {
  background: #dff4ef;
  color: #0b5f5f;
  border-color: #bfe7dd;
}
.btn-icon--delete {
  background: #ffe3da;
  color: #a73722;
  border-color: #f2b8aa;
}
.btn-icon--receive {
  background: #e4f0ff;
  color: #184a86;
  border-color: #c1daf7;
}
.btn-icon--history {
  background: #fff2cc;
  color: #7a5c10;
  border-color: #e8d28b;
}
.btn-icon--pay {
  background: #e0f5ef;
  color: #0b5f5f;
  border-color: #bfe7dd;
}
.acoes-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.acoes-info {
  margin-top: 6px;
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
}
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.integracoes-tabs-wrap {
  display: grid;
  gap: 8px;
}
.integracoes-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.integracoes-tabs .nav-item {
  margin: 0;
}
.integracoes-tabs .nav-link {
  border: 1px solid var(--line);
  background: #f7f3ee;
  color: #403b35;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 14px;
}
.integracoes-tabs .nav-link:hover {
  border-color: #d8cec0;
  color: #2c2823;
}
.integracoes-tabs .nav-link.active,
.integracoes-tabs .nav-link.active:hover {
  background: linear-gradient(135deg, #fff5f0, #edf8f6);
  border-color: #b8e4d8;
  color: #0f6f6f;
}
.integracoes-helper {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.integracoes-tab-content {
  margin-top: 14px;
}
.integracao-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.integracao-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}
.integracao-card--full {
  grid-column: 1 / -1;
}
.integracao-card-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.integracao-card-topo h3 {
  margin: 0;
}
.integracao-chip {
  border: 1px solid #cde8df;
  background: #effaf7;
  color: #0f6f6f;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
}
.integracao-card-subtitulo {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.integracao-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.integracao-switches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.evolution-qrcode-area {
  margin-top: 12px;
  border: 1px dashed #d8cec0;
  border-radius: 12px;
  padding: 12px;
  background: #fcfaf7;
  display: grid;
  gap: 10px;
}
.evolution-qrcode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.evolution-qrcode-head strong {
  font-size: 13px;
  color: #2f2a24;
}
.evolution-status-badge {
  border: 1px solid #d8cec0;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #6d6a66;
  background: #f7f3ee;
}
.evolution-status-badge.is-connected {
  border-color: #b8e4d8;
  color: #0f6f6f;
  background: #ecfaf6;
}
.evolution-status-badge.is-pending {
  border-color: #f1dbb2;
  color: #8a6318;
  background: #fff7e8;
}
.evolution-qrcode-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.evolution-qrcode-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.evolution-qrcode-box {
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
.evolution-qrcode-box img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}
.evolution-qrcode-placeholder {
  margin-top: 12px;
  border: 1px dashed #d8cec0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fcfaf7;
  font-size: 12px;
  color: var(--muted);
}
.templates-variaveis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.templates-variaveis span {
  border: 1px solid #d8cec0;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f7f3ee;
  color: #4a443e;
  font-size: 12px;
  font-weight: 600;
}
.templates-grid {
  display: grid;
  gap: 14px;
}
.template-notificacao-card {
  display: grid;
  gap: 12px;
}
.template-notificacao-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.template-notificacao-topo h3 {
  margin-bottom: 4px;
}
.template-textarea {
  min-height: 170px;
  resize: vertical;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.cards-compact .card-item {
  padding: 12px;
  background: #fdfbf7;
}
.cards-compact .card-item .value {
  font-size: 18px;
}
.comissao-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-accent {
  position: relative;
  border: 1px solid #e6e0d7;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}
.card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  border-radius: 12px 12px 0 0;
}
.card-accent--amber::before { background: #f2b705; }
.card-accent--green::before { background: #21c36f; }
.card-accent--blue::before { background: #26a7ff; }
.card-accent--navy::before { background: #0c2d73; }
.card-accent--teal::before { background: #1bb9a7; }
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-bar,
.table-filters,
.top-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.filter-bar .filter-group,
.table-filters .filter-group,
.top-filters .filter-group {
  min-width: 150px;
}
.table-filters--compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  align-items: end;
}
.table-filters--compact .filter-group {
  min-width: 160px;
}
.table-filters--compact .filter-actions {
  margin-left: 0;
  align-self: end;
  justify-self: end;
  padding: 0;
}
.table-filters--operacional {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}
.table-filters--operacional .filter-group {
  min-width: 0;
}
.table-filters--operacional .filter-actions {
  margin-left: 0;
  align-self: end;
  justify-self: end;
  padding: 0;
}
@media (max-width: 1100px) {
  .table-filters--compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .table-filters--compact .filter-actions {
    justify-self: start;
  }
  .table-filters--operacional {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .table-filters--operacional .filter-actions {
    justify-self: start;
  }
}
.filter-bar .form-control,
.filter-bar .form-select,
.table-filters .form-control,
.table-filters .form-select,
.top-filters .form-control,
.top-filters .form-select {
  background: #f7f3ee;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
}
.filter-bar .btn,
.table-filters .btn,
.top-filters .btn {
  padding: 8px 12px;
  border-radius: 10px;
}
.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.dashboard-stack {
  display: grid;
  gap: 20px;
}
.dashboard-hero {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.dashboard-hero h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
}
.dashboard-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.hero-card {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(6px);
  min-height: 72px;
  position: relative;
}
.hero-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
.hero-icon svg {
  width: 14px;
  height: 14px;
}
.finance-dashboard .hero-icon--corner {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
}
.finance-dashboard .hero-icon--corner svg {
  width: 12px;
  height: 12px;
}
.hero-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
section.panel .hero-card .text-muted {
  color: #ffffff !important;
}
.hero-card--sunset {
  background: linear-gradient(135deg, #ff6a00, #ff2d55);
}
.hero-card--teal {
  background: linear-gradient(135deg, #00b09b, #96c93d);
}
.finance-dashboard {
  display: grid;
  gap: 18px;
  align-content: start;
}
.finance-dashboard .hero-cards {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: stretch;
  justify-content: stretch;
}
.finance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.finance-card {
  border-radius: 16px;
  padding: 16px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 96px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}
.finance-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}
.finance-card__value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}
.finance-card__sub {
  font-size: 12px;
  opacity: 0.9;
}
.finance-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.finance-card__icon svg {
  width: 20px;
  height: 20px;
}
.finance-card--amber {
  background: linear-gradient(135deg, #f4b017, #d88b10);
}
.finance-card--blue {
  background: linear-gradient(135deg, #4c6ef5, #364fc7);
}
.finance-card--green {
  background: linear-gradient(135deg, #1fbf75, #158f5b);
}
.finance-card--teal {
  background: linear-gradient(135deg, #2f9cab, #2b7a8f);
}
.finance-alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.finance-summary {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}
.finance-alerts .finance-summary {
  min-height: 72px;
  padding: 14px;
  grid-column: span 2;
}
.finance-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.finance-summary__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f7f3ee;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}
.finance-summary__value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}
.finance-summary__sub {
  font-size: 12px;
  color: var(--muted);
}
.finance-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.finance-charts .chart-card {
  min-height: 320px;
}
.finance-charts .chart-card canvas {
  height: 220px !important;
}
.chart-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.hero-card--amber {
  background: linear-gradient(135deg, #ffcc00, #ff7a00);
}
.hero-card--crimson {
  background: linear-gradient(135deg, #ff2d55, #ff5d00);
}
.hero-card--emerald {
  background: linear-gradient(135deg, #00d26a, #00b3ff);
}
.hero-card--blue {
  background: linear-gradient(135deg, #00a3ff, #4b2cff);
}
.hero-label {
  font-size: 12px;
  opacity: 1;
  color: #ffffff;
}
.hero-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 6px;
  color: #ffffff;
}
.comissao-page {
  display: grid;
  gap: 16px;
}
.comissao-section {
  display: grid;
  gap: 12px;
}
.comissao-page .hero-cards {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}
.comissao-page .hero-cards.hero-cards--line {
  flex-wrap: nowrap;
  overflow-x: hidden;
  gap: 10px;
  width: 100%;
}
.comissao-page .hero-cards.hero-cards--line .hero-card {
  flex: 1 1 0;
  min-width: 0;
}
.comissao-page .hero-card {
  flex: 1 1 0;
  min-width: 160px;
  padding: 10px;
  min-height: 64px;
}
.comissao-page .hero-value {
  font-size: 16px;
  margin-top: 4px;
}
.comissao-page .hero-label {
  font-size: 11px;
}
.comissao-page .hero-icon {
  width: 24px;
  height: 24px;
}
.comissao-page .hero-icon svg {
  width: 13px;
  height: 13px;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chart-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.chart-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-filter label {
  font-size: 12px;
  color: var(--muted);
}
.chart-filter .form-select {
  min-width: 160px;
  border-radius: 10px;
}
.chart-grid--large {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.chart-grid--dashboard {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  grid-template-areas:
    "vendas vendas receber"
    "pipeline pipeline pagar";
  align-items: stretch;
}
.chart-grid--dashboard .chart-card--vendas {
  grid-area: vendas;
  min-height: 320px;
}
.chart-grid--dashboard .chart-card--receber {
  grid-area: receber;
}
.chart-grid--dashboard .chart-card--pagar {
  grid-area: pagar;
}
.chart-grid--dashboard .chart-card--pipeline {
  grid-area: pipeline;
}
@media (max-width: 1100px) {
  .chart-grid--dashboard {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    grid-template-areas: none;
  }
  .chart-grid--dashboard .chart-card--vendas,
  .chart-grid--dashboard .chart-card--receber,
  .chart-grid--dashboard .chart-card--pagar,
  .chart-grid--dashboard .chart-card--pipeline {
    grid-area: auto;
  }
}
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-card--wide {
  grid-column: span 2;
}
.chart-card h4 {
  margin: 0;
  font-size: 13px;
}
.chart-card canvas {
  width: 100% !important;
  height: 220px !important;
}
.chart-card--vendas canvas {
  height: 250px !important;
}
.chart-card--receber canvas,
.chart-card--pagar canvas {
  height: 220px !important;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.chart-card--receber,
.chart-card--pagar {
  justify-content: flex-start;
  align-items: center;
  min-height: 300px;
}
.chart-card--vendas {
  min-height: 300px;
}
.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.card-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.card-item .label { color: var(--muted); font-size: 12px; }
.card-item .value { font-size: 22px; font-weight: 700; margin-top: 6px; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 320px);
}
.pipeline-column {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  height: 100%;
}
.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: var(--pipeline-color, #e2d8cc);
  border: 1px solid var(--pipeline-color, #e2d8cc);
  border-radius: 12px;
  padding: 8px 10px;
}
.pipeline-column-header h4 {
  color: #ffffff;
}
.pipeline-column-header .pipeline-count {
  background: #000;
}
.pipeline-column-header h4 {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.pipeline-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pipeline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pipeline-action {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.pipeline-action svg {
  width: 14px;
  height: 14px;
}
.pipeline-action--danger {
  color: #b4442a;
  border-color: #f1c5b8;
  background: #fff4ef;
}
.pipeline-handle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  background: transparent;
}
.pipeline-handle svg {
  width: 14px;
  height: 14px;
  color: #fff;
}
.pipeline-count {
  background: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
}
.pipeline-column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f1f1f1;
  border: 1px dashed #d9d9d9;
  border-radius: 12px;
  padding: 10px;
  min-height: 180px;
}
.pipeline-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: grab;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  min-height: 54px;
}
.pipeline-card.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}
.pipeline-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.pipeline-card-code {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.pipeline-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.stage {
  background: #f7f3ee;
  border: 1px dashed #e2d8cc;
  padding: 10px;
  border-radius: 12px;
  min-height: 110px;
}
.stage h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.stage .pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin: 4px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.table th, .table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
  white-space: normal;
}
.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.b-green { background: #e6f6f1; color: #0f6f6f; }
.b-orange { background: #fff0e7; color: #b4442a; }
.b-yellow { background: #fff6dc; color: #8a6a12; }
.b-red { background: #ffe8e6; color: #b42318; }
.b-blue { background: #e8f1ff; color: #1d4ed8; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 11px;
}
.calendar .day {
  background: #f7f3ee;
  border: 1px solid var(--line);
  padding: 8px 6px;
  border-radius: 10px;
  height: 120px;
  overflow: auto;
}
.calendar .day.day-header {
  height: auto;
  min-height: auto;
  padding: 6px;
  background: #f7f3ee;
  border: 1px solid var(--line);
}
.calendar .day strong { display: block; font-size: 11px; }
.calendar .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.calendar .day-empty {
  background: transparent;
  border-color: transparent;
}
.calendar-day {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.calendar-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
.day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.day-count {
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}
.agenda-item {
  margin-top: 6px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.agenda-item .badge {
  font-size: 9px;
  padding: 2px 6px;
}
.agenda-text {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #1f2937;
  margin-top: 4px;
}
.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agenda-subtitle {
  font-size: 12px;
  color: var(--muted);
}
.agenda-nav {
  display: flex;
  gap: 6px;
}
.view-switch {
  display: flex;
  gap: 6px;
  margin-right: 10px;
}
.view-switch .btn.is-active {
  background: #151515;
  color: #fff;
  border-color: #151515;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
}
.page-subtitle {
  font-size: 12px;
  color: var(--muted);
}
.table-wrapper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

.auth-body {
  background: radial-gradient(900px 500px at 10% -10%, #fff2df 0%, transparent 55%),
              radial-gradient(800px 500px at 110% 0%, #eaf7f5 0%, transparent 45%),
              var(--bg);
}
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.auth-card {
  width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-header {
  margin-bottom: 20px;
}
.auth-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.auth-form .form-control {
  background: #f7f3ee;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 12px;
}

.modal-content {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.modal-header {
  border-bottom: 1px solid var(--line);
}
.modal-footer {
  border-top: 1px solid var(--line);
}

#modalConfirmacao .modal-body {
  font-size: 14px;
  color: var(--muted);
}
#modalConfirmacao .modal-title {
  font-weight: 700;
}

.chat-flutuante {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.chat-toggle {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(17, 16, 15, 0.22);
  display: grid;
  place-items: center;
  position: relative;
}
.chat-toggle svg {
  width: 24px;
  height: 24px;
}
.chat-notificacao {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}
.chat-painel {
  width: min(660px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(17, 16, 15, 0.2);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
.chat-corpo {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 360px;
  height: clamp(360px, 52vh, 520px);
}
.chat-usuarios {
  border-right: 1px solid var(--line);
  background: #fcfaf7;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-usuarios-vazio {
  margin: auto;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 10px;
}
.chat-usuario-item {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}
.chat-usuario-item:hover {
  background: #f5efe6;
}
.chat-usuario-item.active {
  background: #e9f8f4;
  border-color: #b8e4d8;
}
.chat-usuario-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.chat-usuario-nome {
  font-size: 12px;
  font-weight: 600;
  color: #2d2924;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-usuario-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chat-usuario-status {
  font-size: 10px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chat-usuario-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.18);
}
.chat-usuario-status.is-online {
  color: #0f6f6f;
  font-weight: 600;
}
.chat-usuario-status.is-online i {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}
.chat-usuario-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-conversa {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.chat-conversa-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-conversa-topo-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.chat-conversa-nome {
  font-size: 12px;
  font-weight: 700;
  color: #4b463f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-conversa-status {
  font-size: 10px;
  color: var(--muted);
}
.chat-conversa-excluir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  border: 1px solid #f2c5bf;
  background: #fff5f3;
  color: #b4442a;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.chat-conversa-excluir svg {
  width: 14px;
  height: 14px;
}
.chat-conversa-excluir:disabled {
  opacity: 0.6;
  cursor: wait;
}
.chat-digitando {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--accent-2);
  border-bottom: 1px solid var(--line);
  background: #f7fffc;
}
.chat-painel-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff9f1;
}
.chat-painel-identidade {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.chat-painel-logo {
  width: 56px;
  height: 56px;
  border-radius: 0;
  border: 0;
  object-fit: contain;
  background: transparent;
  flex: 0 0 auto;
}
.chat-painel-logo-fallback {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #f08a61);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.chat-painel-topo h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.chat-painel-topo small {
  color: var(--muted);
  font-size: 11px;
}
.chat-fechar {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: #4f4a43;
  background: #f2ebe1;
  display: grid;
  place-items: center;
}
.chat-fechar svg {
  width: 16px;
  height: 16px;
}
.chat-lista {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background-color: #e5ddd5;
  background-image: url('/chat/background.png');
  background-repeat: repeat;
  background-size: 320px;
  background-position: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-vazio {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}
.chat-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.chat-item--proprio {
  justify-content: flex-end;
}
.chat-item-bolha {
  max-width: 84%;
  background: #f8f4ed;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.chat-item--proprio .chat-item-bolha {
  background: #e9f8f4;
  border-color: #b8e4d8;
}
.chat-item-cabecalho {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.chat-item-autor {
  font-size: 11px;
  font-weight: 700;
  color: #3d3831;
}
.chat-item-cabecalho time {
  font-size: 10px;
  color: var(--muted);
}
.chat-item-texto {
  margin: 0;
  font-size: 13px;
  color: #272522;
  word-break: break-word;
}
.chat-item-anexo {
  display: inline-flex;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
}
.chat-item-anexo:hover {
  text-decoration: underline;
}
.chat-item-anexo-tamanho {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}
.chat-item-status {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.chat-item-status.is-read {
  color: var(--accent-2);
  font-weight: 700;
}
.chat-formulario {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}
.chat-formulario textarea {
  resize: none;
  min-height: 66px;
}
.chat-formulario-rodape {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-anexo-botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4ece1;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: #403b35;
  cursor: pointer;
}
.chat-anexo-botao input {
  display: none;
}
.chat-anexo-nome {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-upload {
  min-width: 100px;
  display: grid;
  gap: 2px;
}
.chat-upload-barra {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #eee5d9;
  overflow: hidden;
}
.chat-upload-barra span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}
.chat-upload small {
  font-size: 10px;
  color: var(--muted);
}

.atendimento-wa-panel {
  display: grid;
  gap: 14px;
}
.atendimento-alerta {
  border: 1px solid #f1dbb2;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff7e8;
  color: #8a6318;
  font-size: 13px;
}
.atendimento-status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f3ee;
  color: #5c5550;
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
}
.atendimento-status-badge.is-connected {
  border-color: #b8e4d8;
  background: #ecfaf6;
  color: #0f6f6f;
}
.atendimento-status-badge.is-pending {
  border-color: #f1dbb2;
  background: #fff7e8;
  color: #8a6318;
}
.atendimento-status-badge.is-error {
  border-color: #f2c5bf;
  background: #fff5f3;
  color: #b4442a;
}
.wa-ticket-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 520px;
  height: clamp(520px, 68vh, 660px);
  background: #fff;
}
.wa-ticket-sidebar {
  border-right: 1px solid var(--line);
  background: #fcfaf7;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  min-height: 0;
}
.wa-ticket-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.wa-ticket-sidebar-head h3 {
  margin: 0;
  font-size: 18px;
}
.wa-ticket-sidebar-head small {
  font-size: 12px;
  color: var(--muted);
}
.wa-ticket-resumo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.wa-ticket-resumo-item {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f7f3ee;
  color: #5a534b;
}
.wa-ticket-resumo-item strong {
  font-size: 11px;
  font-weight: 700;
}
.wa-ticket-resumo-item.is-aberto {
  border-color: #e8dcc8;
  background: #f8f1e8;
  color: #8a5d2f;
}
.wa-ticket-resumo-item.is-atendimento {
  border-color: #bfdefc;
  background: #eaf5ff;
  color: #1f5fab;
}
.wa-ticket-resumo-item.is-aguardando {
  border-color: #f1dbb2;
  background: #fff7e8;
  color: #8a6318;
}
.wa-ticket-resumo-item.is-finalizado {
  border-color: #b8e4d8;
  background: #ecfaf6;
  color: #0f6f6f;
}
.wa-ticket-busca {
  background: #fff;
}
.wa-ticket-filtros {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.wa-ticket-filtros .form-select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.wa-ticket-filtros .btn {
  width: 100%;
}
.wa-ticket-lista {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.wa-ticket-item {
  width: 100%;
  border: 1px solid #e7ded1;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 5px;
  cursor: pointer;
}
.wa-ticket-item-grid {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
}
.wa-ticket-item-conteudo {
  display: grid;
  gap: 5px;
}
.wa-ticket-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d6cabc;
  background: #efe4d5;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.wa-ticket-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.wa-ticket-avatar.has-image .wa-ticket-avatar-img {
  display: block;
}
.wa-ticket-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b5f52;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.wa-ticket-avatar.has-image .wa-ticket-avatar-fallback {
  display: none;
}
.wa-ticket-item:hover {
  background: #f6f0e8;
}
.wa-ticket-item.active {
  border-color: #b8e4d8;
  background: #e9f8f4;
}
.wa-ticket-item-topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.wa-ticket-item-topo-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.wa-ticket-item-topo strong {
  font-size: 13px;
  color: #2d2924;
  line-height: 1.25;
}
.wa-ticket-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: #f7f3ee;
  color: #5a534b;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  white-space: nowrap;
  line-height: 1;
}
.wa-ticket-status.is-aberto {
  border-color: #e8dcc8;
  background: #f8f1e8;
  color: #8a5d2f;
}
.wa-ticket-status.is-atendimento {
  border-color: #bfdefc;
  background: #eaf5ff;
  color: #1f5fab;
}
.wa-ticket-status.is-aguardando {
  border-color: #f1dbb2;
  background: #fff7e8;
  color: #8a6318;
}
.wa-ticket-status.is-finalizado {
  border-color: #b8e4d8;
  background: #ecfaf6;
  color: #0f6f6f;
}
.wa-ticket-item small {
  color: var(--muted);
  font-size: 11px;
}
.wa-ticket-item p {
  margin: 0;
  font-size: 12px;
  color: #4f4a43;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.wa-ticket-badge {
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
}
.wa-ticket-main {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
}
.wa-ticket-topo {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
}
.wa-ticket-topo-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wa-ticket-topo-acoes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wa-ticket-topo-acoes .form-select {
  width: auto;
  min-width: 170px;
  max-width: 220px;
  background: #f7f3ee;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.wa-ticket-nome {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #3f3a34;
}
.wa-ticket-meta {
  color: var(--muted);
  font-size: 12px;
}
.wa-ticket-mensagens {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background-color: #e5ddd5;
  background-image: url('/chat/background.png');
  background-repeat: repeat;
  background-size: 320px;
}
.wa-ticket-vazio {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  max-width: 260px;
}
.wa-msg-item {
  display: flex;
  justify-content: flex-start;
}
.wa-msg-item--proprio {
  justify-content: flex-end;
}
.wa-msg-bolha {
  max-width: min(78%, 620px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f4ed;
  padding: 8px 10px;
}
.wa-msg-item--proprio .wa-msg-bolha {
  background: #e9f8f4;
  border-color: #b8e4d8;
}
.wa-msg-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}
.wa-msg-cabecalho strong {
  font-size: 11px;
  color: #3a342f;
}
.wa-msg-cabecalho time {
  font-size: 10px;
  color: var(--muted);
}
.wa-msg-bolha p {
  margin: 0;
  font-size: 13px;
  color: #252321;
  word-break: break-word;
  line-height: 1.4;
}
.wa-ticket-formulario {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}
.wa-ticket-formulario textarea {
  resize: none;
  min-height: 70px;
}
.wa-ticket-formulario-rodape {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.wa-ticket-anexo-botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f2eb;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  height: 40px;
  padding: 0 16px;
  cursor: pointer;
}
.wa-ticket-anexo-botao input[type="file"] {
  display: none;
}
.wa-ticket-anexo-botao.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.wa-ticket-anexo-nome {
  color: var(--muted);
  font-size: 13px;
  min-width: 120px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-ticket-feedback {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 180px;
}
.wa-ticket-feedback.is-error {
  color: #b4442a;
}
.wa-ticket-feedback.is-success {
  color: #0f6f6f;
}
.wa-ticket-formulario-rodape .btn {
  margin-left: auto;
}
.wa-msg-anexo {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #d9d4cd;
  border-radius: 10px;
  background: #ffffff;
}
.wa-msg-anexo--imagem {
  display: block;
  padding: 6px;
  max-width: min(320px, 72vw);
}
.wa-msg-anexo--audio {
  display: block;
  min-width: 240px;
  max-width: min(340px, 78vw);
}
.wa-msg-anexo-info {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wa-msg-anexo-img-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e4ddd2;
}
.wa-msg-anexo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  background: #f2eee7;
}
.wa-msg-anexo--imagem.is-broken .wa-msg-anexo-img-link {
  display: none;
}
.wa-msg-anexo-audio {
  width: 100%;
}
.wa-msg-anexo--audio.is-broken .wa-msg-anexo-audio {
  display: none;
}
.wa-msg-anexo-link {
  font-size: 12px;
  font-weight: 700;
  color: #1d5f9d;
  text-decoration: none;
  word-break: break-word;
}
.wa-msg-anexo-link:hover {
  text-decoration: underline;
}
.wa-msg-anexo-tamanho {
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    padding: 16px;
  }
  .sidebar {
    order: 2;
    height: auto;
  }
  .content {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
  .grid { grid-template-columns: 1fr; }
  .integracao-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .chart-card--wide { grid-column: span 1; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .logo-img-sidebar { width: 40%; }
  .nav { max-height: none; }
}
@media (max-width: 720px) {
  .shell { gap: 16px; padding: 12px; }
  .sidebar { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search { width: 100%; }
  .chat-flutuante {
    right: 12px;
    bottom: 12px;
  }
  .chat-painel {
    width: min(420px, calc(100vw - 24px));
  }
  .chat-corpo {
    grid-template-columns: 1fr;
    min-height: 0;
    height: clamp(300px, 48vh, 420px);
  }
  .chat-usuarios {
    max-height: 140px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .chat-lista {
    height: 100%;
    min-height: 0;
  }
  .chat-formulario-rodape {
    flex-wrap: wrap;
    gap: 6px;
  }
  .chat-upload {
    width: 100%;
    order: 3;
  }
  .wa-ticket-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
  }
  .wa-ticket-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .wa-ticket-lista {
    max-height: 220px;
  }
  .wa-ticket-resumo {
    grid-template-columns: 1fr;
  }
  .wa-ticket-topo-acoes .form-select {
    min-width: 150px;
  }
  .wa-msg-bolha {
    max-width: 92%;
  }
  .integracoes-tabs .nav-link {
    width: auto;
    text-align: left;
  }
  .pipeline { grid-template-columns: 1fr; }
  .top-actions { width: 100%; }
  .top-actions .btn { width: 100%; }
  .logo-img-sidebar { width: 55%; }
  .modal-dialog { margin: 12px; }
  .modal-content { border-radius: 14px; }
  .avatar-circle { width: 96px; height: 96px; }
}
@media (max-width: 520px) {
  .grid { gap: 12px; }
  .panel { padding: 14px; }
  .page-title { font-size: 16px; }
  .page-subtitle { font-size: 11px; }
  .logo-img-sidebar { width: 70%; }
  .nav a { font-size: 13px; padding: 9px 10px; }
  .nav-group { font-size: 11px; }
}
