/* ============================================================================
   DashOS · DASHBOARD DA AGÊNCIA (ESTILOS ESPECÍFICOS)
   Segue estritamente os tokens de styles/tokens.css e componentes de styles/components.css.
   ============================================================================ */

/* Faixa de Alerta Crítico no Topo */
.critical-alerts-strip[hidden], #criticalAlertsStrip[hidden] { display: none !important; }
.critical-alerts-strip {
  margin-bottom: 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 143, 168, .32);
  background: linear-gradient(135deg, rgba(255, 108, 148, .12), rgba(27, 20, 32, .85));
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: fadeUp 350ms var(--ease-standard) both;
}
.critical-alerts-strip:hover {
  border-color: rgba(255, 143, 168, .5);
}
.alert-strip-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.alert-strip-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-negative-soft);
  color: var(--color-negative);
  display: grid;
  place-items: center;
  flex: none;
}
.alert-strip-text {
  min-width: 0;
}
.alert-strip-text strong {
  color: #ffd6df;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-strip-text p {
  color: var(--color-text-secondary);
  font-size: 11.5px;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alert-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Seletor de Perfil do Usuário Simulado */
.profile-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26, 25, 41, .85);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.profile-switcher:hover {
  border-color: var(--color-border-focus);
}
.profile-switcher-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.profile-switcher-info strong {
  font-size: 11.5px;
  color: var(--color-text);
  line-height: 1.2;
}
.profile-switcher-info small {
  font-size: 9.5px;
  color: var(--color-accent-high);
  font-weight: 600;
}

/* In-page dropdown anchors (isolamento de z-index para nunca sobrepor o menu do topo) */
.table-actions .dropdown-anchor,
.card .dropdown-anchor,
.filter-bar-card .dropdown-anchor {
  position: relative;
  z-index: 30;
}
.table-actions .dropdown-menu,
.card .dropdown-menu,
.filter-bar-card .dropdown-menu {
  z-index: 40;
}

/* User Profile Dropdown Menu Styling (Orbit Design System · 0 Emojis) */
.profile-dropdown-panel {
  width: 300px;
  background: #141526 !important;
  border: 1px solid rgba(190, 180, 235, 0.28) !important;
  border-radius: 12px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(185, 165, 255, 0.15) !important;
  padding: 0 !important;
  overflow: hidden;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  z-index: 100050 !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
}
.profile-dropdown-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-dropdown-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-dropdown-meta {
  min-width: 0;
  flex: 1;
}
.profile-dropdown-meta strong {
  display: block;
  font-size: 13px;
  color: #fff;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-dropdown-meta .role-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--color-accent-high);
  background: rgba(185, 165, 255, 0.12);
  padding: 1px 7px;
  border-radius: 4px;
  margin-top: 2px;
}
.profile-dropdown-meta .email {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.profile-dropdown-section {
  padding: 6px;
}
.profile-dropdown-btn {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  width: 100% !important;
  padding: 9px 12px !important;
  font-size: 12px !important;
  color: var(--color-text) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all var(--duration-fast) ease !important;
  box-sizing: border-box !important;
}
.profile-dropdown-btn:hover {
  background: rgba(185, 165, 255, 0.1) !important;
  color: var(--color-accent-high) !important;
}
.profile-dropdown-btn .icon {
  width: 16px;
  height: 16px;
  color: var(--color-accent-high);
  flex-shrink: 0;
  transition: transform var(--duration-fast);
}
.profile-dropdown-btn:hover .icon {
  transform: scale(1.1);
}
.profile-btn-content {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.profile-btn-content strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}
.profile-btn-content small {
  display: block;
  font-size: 9.5px;
  color: var(--color-text-muted);
}
.profile-dropdown-btn:hover .profile-btn-content small {
  color: var(--color-text-secondary);
}
.profile-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}
.profile-sim-toggle {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 7px 12px !important;
  font-size: 10.5px !important;
  color: var(--color-text-muted) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  border-radius: 6px !important;
}
.profile-sim-toggle:hover {
  color: var(--color-text) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}
.profile-sim-list {
  padding: 4px 6px 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.profile-sim-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
  color: var(--color-text-secondary) !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
}
.profile-sim-item:hover {
  background: rgba(185, 165, 255, 0.12) !important;
  color: var(--color-accent-high) !important;
}
.profile-sim-item.active {
  background: rgba(185, 165, 255, 0.18) !important;
  color: #fff !important;
  font-weight: 600;
}
.profile-dropdown-logout {
  color: var(--color-negative) !important;
}
.profile-dropdown-logout .icon {
  color: var(--color-negative) !important;
}
.profile-dropdown-logout:hover {
  background: rgba(255, 92, 114, 0.12) !important;
  color: #ff8fa8 !important;
}
.profile-dropdown-logout:hover .icon {
  color: #ff8fa8 !important;
}

/* Barra de Filtros Avançados */
.filter-bar-card {
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.filter-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-bar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--color-text-secondary);
  letter-spacing: .05em;
}
.filter-bar-title .icon {
  color: var(--color-accent);
}
.filter-bar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-item label {
  font-size: 10px;
  font-weight: 680;
  letter-spacing: .08em;
  color: var(--color-text-muted);
}
.filter-select {
  height: 36px;
  background-color: #141423;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b7a1ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid rgba(190, 180, 235, 0.16);
  border-radius: 8px;
  color: var(--color-text);
  padding: 0 34px 0 12px;
  font-size: 11.5px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  transition: all var(--duration-fast);
  cursor: pointer;
  color-scheme: dark !important;
}
.filter-select:hover {
  background-color: #17182c;
  border-color: rgba(185, 165, 255, 0.35);
  color: var(--color-accent-high);
}
.filter-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(185, 165, 255, 0.18);
}
.filter-select option, .filter-select optgroup {
  background: #161729 !important;
  color: #fff !important;
  padding: 8px 12px;
}
.filter-select option:checked {
  background: #2b284c !important;
  color: #b7a1ff !important;
  font-weight: 600;
}
.comparison-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #cbbaf9;
  background: rgba(168, 142, 248, .12);
  border: 1px solid rgba(168, 142, 248, .25);
  padding: 4px 9px;
  border-radius: 6px;
}

/* Grade de Indicadores (KPIs) com 8 Cards */
.stats-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-comparison-tag {
  font-size: 9.5px;
  color: var(--color-text-muted);
  margin-top: 3px;
  display: block;
}

/* Gráfico de Desempenho e Seletor de Plataforma */
.platform-pill-selector {
  display: flex;
  align-items: center;
  background: #151525;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}
.platform-pill {
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.platform-pill:hover {
  color: var(--color-text);
}
.platform-pill.active {
  background: rgba(185, 165, 255, .18);
  color: var(--color-accent-high);
}

/* Card de NPS Dedicado */
.nps-overview-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.nps-dial-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0;
  padding: 16px;
  background: rgba(18, 18, 30, .6);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.nps-score-badge {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(168, 142, 248, .2), rgba(30, 26, 48, .9));
  border: 2px solid var(--color-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 0 24px rgba(168, 142, 248, .2);
}
.nps-score-badge strong {
  font-size: 28px;
  font-weight: 750;
  color: var(--color-text);
  line-height: 1;
}
.nps-score-badge span {
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--color-accent-high);
  font-weight: 700;
  margin-top: 3px;
}
.nps-classification {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nps-classification h3 {
  font-size: 15px;
  font-weight: 670;
  margin: 0;
  color: var(--color-text);
}
.nps-classification p {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 0;
}
.nps-breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.nps-bar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.nps-bar-item span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-secondary);
}
.nps-bar-item strong {
  color: var(--color-text);
}

/* Seção de Clientes que Precisam de Atenção */
.attention-card, .integrations-card {
  padding: 24px;
}
.attention-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.attention-item {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: #141422;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: border-color var(--duration-fast);
}
.attention-item:hover {
  border-color: rgba(188, 167, 255, .25);
}
.attention-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.severity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.severity-dot.critico { background: var(--color-negative); box-shadow: 0 0 10px rgba(255, 143, 168, .5); }
.severity-dot.atencao { background: var(--color-warning); box-shadow: 0 0 10px rgba(248, 201, 142, .4); }
.severity-dot.informativo { background: var(--color-accent); }
.attention-info {
  min-width: 0;
}
.attention-info strong {
  font-size: 12px;
  color: var(--color-text);
  display: block;
}
.attention-info p {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 2px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attention-info small {
  font-size: 9.5px;
  color: var(--color-text-muted);
}
.attention-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* Monitoramento de Integrações */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.integration-card-mini {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #141422;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.integration-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.integration-card-top strong {
  font-size: 12px;
  color: var(--color-text);
}
.integration-status-pill {
  font-size: 9.5px;
  font-weight: 650;
  padding: 3px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.integration-status-pill.connected { color: var(--color-positive); background: var(--color-positive-soft); }
.integration-status-pill.unstable { color: var(--color-warning); background: var(--color-warning-soft); }
.integration-status-pill.disconnected { color: var(--color-negative); background: var(--color-negative-soft); }
.integration-status-pill.unconfigured { color: var(--color-text-muted); background: rgba(255, 255, 255, .05); }
.integration-status-pill.not_integrated { color: var(--color-text-muted); background: rgba(255, 255, 255, .05); }

/* Fase 2A: status de integração (Meta/Google/WhatsApp) — "não integrado" em cinza */
.platform-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: rgba(255, 255, 255, .18); }
.platform-dot.connected { background: var(--color-positive); }
.platform-dot.unstable { background: var(--color-warning); }
.platform-dot.disconnected { background: var(--color-negative); }
.platform-dot.unconfigured, .platform-dot.not_integrated { background: rgba(255, 255, 255, .18); }

/* Fase 2A: card do kanban sem permissão de edição e status do salvamento automático */
.kanban-card[draggable="false"] { cursor: pointer; }
.trello-sec-hint.is-saving { color: var(--color-text-muted); }
.trello-sec-hint.is-saved { color: var(--color-positive); }
.trello-sec-hint.is-error { color: var(--color-negative); font-weight: 600; }
.modal-trello.is-readonly .trello-meta-interactive { cursor: default; }

/* Expansão Inline na Tabela de Clientes */
.expandable-row {
  cursor: pointer;
  transition: background var(--duration-fast);
}
.expandable-row:hover {
  background: rgba(188, 167, 255, .04) !important;
}
.expand-toggle-icon {
  transition: transform var(--duration-fast);
  color: var(--color-text-muted);
}
.expandable-row.is-expanded .expand-toggle-icon {
  transform: rotate(180deg);
  color: var(--color-accent);
}
.expanded-row-container {
  background: #0d0e19 !important;
}
.expanded-row-container td {
  padding: 0 !important;
  border-bottom: 1px solid rgba(184, 174, 226, .12) !important;
}
.expanded-details-wrapper {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: tableRowFade 200ms var(--ease-standard) both;
}
/* ============================================================================
   CLIENTS CARDS GRID VIEW (GESTÃO DE CLIENTES EM CARDS)
   ============================================================================ */
.clients-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}

.client-card {
  background: #141525;
  border: 1px solid rgba(190, 180, 235, 0.12);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.client-card:hover {
  transform: translateY(-3px);
  border-color: rgba(185, 165, 255, 0.38);
  background: #17182c;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(185, 165, 255, 0.12);
}

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(138, 115, 239, 0.22), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(138, 115, 239, 0.3);
  color: #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.client-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-card-name {
  font-size: 14px;
  font-weight: 680;
  color: var(--color-text);
  line-height: 1.25;
}

.client-card-niche {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.client-card-finance-bar {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(190, 180, 235, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-card-fee-box {
  display: flex;
  flex-direction: column;
}

.client-card-fee-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}

.client-card-fee-val {
  font-size: 14px;
  font-weight: 750;
  color: var(--color-accent-high);
}

.client-card-due-box {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(138, 115, 239, 0.08);
  border: 1px solid rgba(138, 115, 239, 0.2);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.client-card-due-box strong {
  color: var(--color-text);
}

.client-card-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.client-card-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-card-kpi-label {
  font-size: 9.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.client-card-kpi-val {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--color-text);
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.client-card-manager {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.client-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  transition: all 140ms ease;
}

.client-card:hover .client-card-action {
  color: var(--color-accent-high);
  transform: translateX(2px);
}

.client-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 14px;
}
.client-detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.client-detail-header-left h3 {
  font-size: 16px;
  font-weight: 680;
  margin: 0;
  color: var(--color-text);
}
.client-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.detail-block {
  background: #131422;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-block-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.detail-mini-metric {
  display: flex;
  flex-direction: column;
}
.detail-mini-metric span {
  font-size: 10px;
  color: var(--color-text-muted);
}
.detail-mini-metric strong {
  font-size: 13px;
  color: var(--color-text);
}
.detail-notes-box {
  background: rgba(0, 0, 0, .2);
  border-radius: 6px;
  padding: 10px;
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Bloco Financeiro Restrito */
.finance-restricted-section {
  margin-bottom: 22px;
}
.finance-card {
  padding: 24px;
  border-color: rgba(188, 167, 255, .22);
  background: radial-gradient(ellipse 350px 200px at 95% -10%, rgba(188, 167, 255, .08), transparent 80%), var(--color-surface);
}
.finance-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 650;
  color: var(--color-accent-high);
  background: rgba(188, 167, 255, .12);
  padding: 3px 8px;
  border-radius: 6px;
}
.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.finance-kpi-box {
  background: #141422;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.finance-kpi-box span {
  font-size: 11px;
  color: var(--color-text-muted);
}
.finance-kpi-box strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 8px;
}
.finance-kpi-box small {
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Modais do Sistema */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, .78);
  backdrop-filter: blur(6px);
  z-index: 2000 !important;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  animation: fadeIn 180ms var(--ease-standard) both;
}
.modal-overlay[hidden] {
  display: none;
}
.modal-window {
  width: 100%;
  max-width: 560px;
  background: #141525;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .58);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 220ms var(--ease-standard) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 680;
  color: var(--color-text);
}
.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #111220;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-size: 11px;
  font-weight: 650;
  color: var(--color-text-secondary);
}
.form-input, .form-textarea, .form-select, .form-select-full {
  width: 100%;
  background: #0f101b;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  padding: 9px 12px;
  font-size: 12px;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  box-sizing: border-box;
}
.form-select, .form-select-full {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #0f101b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b7a1ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
  color-scheme: dark !important;
}
.form-select:hover, .form-select-full:hover {
  background-color: #131424;
  border-color: rgba(185, 165, 255, 0.35);
  color: var(--color-accent-high);
}
.form-input:focus, .form-textarea:focus, .form-select:focus, .form-select-full:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(185, 165, 255, 0.18);
}
.form-select option, .form-select-full option {
  background: #171828 !important;
  color: #f0f0ff !important;
  padding: 8px 12px;
}
.form-select option:checked, .form-select-full option:checked {
  background: #2b284c !important;
  color: #b7a1ff !important;
  font-weight: 600;
}
.form-textarea {
  min-height: 80px;
  resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-top: 4px;
}

/* ============================================================================
   SISTEMA ERP & KANBAN OPERACIONAL (FLUXO DE PRODUÇÃO)
   ============================================================================ */

/* Altura total batendo até o final da tela */
.kanban-page-main {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-page-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 30px 14px;
  max-width: 100%;
}
.kanban-page-content .page-heading {
  margin-bottom: 12px;
  gap: 12px;
}
.kanban-page-content .page-heading h1 {
  font-size: clamp(22px, 2.2vw, 28px);
  margin: 6px 0 2px;
}
.kanban-page-content .filter-bar-card {
  margin-bottom: 12px;
  padding: 10px 16px;
  flex-shrink: 0;
}

/* Container do Quadro com Grab-to-Scroll (arrastar pelo fundo sem scrollbar) */
.kanban-board-container {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  margin-top: 0;
  cursor: grab;
  user-select: none;
}
.kanban-board-container.is-panning {
  cursor: grabbing !important;
}
.kanban-board-container.is-panning * {
  cursor: grabbing !important;
  pointer-events: none;
}

.kanban-board {
  display: flex;
  gap: 16px;
  min-width: max-content;
  align-items: stretch;
  height: 100%;
}

.kanban-column {
  width: 310px;
  flex: 0 0 310px;
  height: 100%;
  max-height: 100%;
  background: #0f101c;
  border: 1px solid rgba(190, 180, 235, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}

/* Identidade visual e iluminação por etapa */
.kanban-column[data-stage="backlog"] { border-top: 3px solid #727b9e; }
.kanban-column[data-stage="backlog"] .kanban-col-count { background: rgba(114, 123, 158, 0.18); color: #b4bddf; }

.kanban-column[data-stage="todo"] { border-top: 3px solid #4a94f8; }
.kanban-column[data-stage="todo"] .kanban-col-count { background: rgba(74, 148, 248, 0.18); color: #8bc0ff; }

.kanban-column[data-stage="in_progress"] { border-top: 3px solid #b9a5ff; }
.kanban-column[data-stage="in_progress"] .kanban-col-count { background: rgba(185, 165, 255, 0.2); color: #dcd0ff; }

.kanban-column[data-stage="review"] { border-top: 3px solid #f8c98e; }
.kanban-column[data-stage="review"] .kanban-col-count { background: rgba(248, 201, 142, 0.18); color: #fae1c3; }

.kanban-column[data-stage="deploy"] { border-top: 3px solid #48cae4; }
.kanban-column[data-stage="deploy"] .kanban-col-count { background: rgba(72, 202, 228, 0.18); color: #90e0ef; }

.kanban-column[data-stage="done"] { border-top: 3px solid #75d9af; }
.kanban-column[data-stage="done"] .kanban-col-count { background: rgba(117, 217, 175, 0.18); color: #aaf0d2; }

.kanban-column.drag-over {
  border-color: var(--color-accent-high);
  background: rgba(185, 165, 255, .04);
  box-shadow: 0 0 24px rgba(185, 165, 255, 0.12);
}
.kanban-column.drag-over .kanban-empty-slot {
  display: none !important;
}

.kanban-column-header {
  padding: 13px 15px;
  border-bottom: 1px solid rgba(190, 180, 235, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .015);
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
  cursor: grab;
}
.kanban-col-title {
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .06em;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
.kanban-col-count {
  font-size: 10px;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: .02em;
}
/* Funil do CRM: altura definida para as colunas ocuparem a área toda (coluna vazia também recebe o card
   arrastado) e a lista de cards rolar dentro da coluna, como no kanban de Tarefas. */
.kanban-board-container:has(> #crmFunnelBoard) {
  height: max(580px, calc(100vh - 220px));
}
.kanban-cards-list,
#crmFunnelBoard .kanban-cards {
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Slot para quando a coluna estiver vazia */
.kanban-empty-slot {
  padding: 34px 14px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  border: 1.5px dashed rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.kanban-empty-slot span {
  opacity: 0.8;
}

/* Indicador visual de Drop dinâmico estilo Trello com a mesma altura padronizada dos cards */
.kanban-drop-placeholder {
  height: 128px;
  min-height: 128px;
  max-height: 128px;
  box-sizing: border-box;
  border: 2px dashed rgba(185, 165, 255, 0.7);
  background: radial-gradient(ellipse at center, rgba(185, 165, 255, 0.16) 0%, rgba(185, 165, 255, 0.04) 75%);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .03em;
  pointer-events: none;
  margin: 0;
  box-shadow: 0 0 24px rgba(185, 165, 255, 0.22), inset 0 0 16px rgba(185, 165, 255, 0.08);
  animation: placeholderPulseGlow 1.2s ease-in-out infinite alternate;
}
@keyframes placeholderPulseGlow {
  from { border-color: rgba(185, 165, 255, 0.45); transform: scale(0.99); }
  to { border-color: rgba(185, 165, 255, 0.9); transform: scale(1); }
}

/* Cards do Kanban - Tamanho e layout 100% padronizados e simétricos */
.kanban-card {
  position: relative;
  background: linear-gradient(168deg, #171829 0%, #111220 100%);
  border: 1px solid rgba(190, 180, 235, 0.1);
  border-left: 3px solid rgba(185, 165, 255, 0.35);
  border-radius: 11px;
  padding: 12px 14px;
  height: 128px;
  min-height: 128px;
  max-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  transition: transform 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard), border-color 160ms var(--ease-standard);
}

/* Cards do Funil Comercial / CRM - Altura adaptativa sem corte de botões */
#crmFunnelBoard .kanban-card,
.crm-deal-card {
  height: auto !important;
  min-height: 165px !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 13px 14px 14px 14px !important;
  overflow: visible !important;
}
.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(185, 165, 255, 0.35);
  border-left-color: var(--color-accent-high);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(185, 165, 255, 0.22);
}
.kanban-card.is-dragging {
  position: absolute !important;
  opacity: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kanban-client-tag {
  font-size: 10px;
  font-weight: 750;
  color: var(--color-accent-high);
  background: rgba(185, 165, 255, .1);
  border: 1px solid rgba(185, 165, 255, .15);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.kanban-priority-badge {
  font-size: 9px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kanban-priority-high {
  background: rgba(255, 107, 140, .14);
  color: #ff7597;
  border: 1px solid rgba(255, 107, 140, .28);
}
.kanban-priority-medium {
  background: rgba(248, 201, 142, .14);
  color: #f8c98e;
  border: 1px solid rgba(248, 201, 142, .28);
}
.kanban-priority-low {
  background: rgba(120, 183, 255, .14);
  color: #8ec3ff;
  border: 1px solid rgba(120, 183, 255, .28);
}

.kanban-card-center {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 4px 0;
}
.kanban-card-title {
  font-size: 12.5px;
  font-weight: 650;
  color: #f3f1ff;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

/* Rodapé do Card com Responsável à esquerda e Prazo/Checklist à direita */
.kanban-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, .05);
  padding-top: 7px;
  gap: 8px;
}
.kanban-card-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--color-text-secondary);
  flex: 1;
  min-width: 0;
}
.kanban-card-user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Indicadores de Checklist e Prazo coloridos no rodapé do card */
.kanban-card-checklist-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: all var(--duration-fast);
}
.kanban-card-checklist-badge .checklist-badge-svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.kanban-card-checklist-badge.all-done {
  background: rgba(16, 185, 129, .15);
  border: 1px solid rgba(16, 185, 129, .35);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, .14);
}
.kanban-card-checklist-badge.in-progress {
  background: rgba(168, 85, 247, .15);
  border: 1px solid rgba(168, 85, 247, .32);
  color: #c084fc;
}
.kanban-card-checklist-badge.empty {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  color: var(--color-text-muted);
}

.kanban-card-due {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  padding: 2.5px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

/* 1. Vencida: Vermelho com efeito pulsante */
.kanban-card-due.overdue {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
  animation: pulseOverdueRed 1.4s ease-in-out infinite;
}

/* 2. Próximo de 1 hora para entrega: Vermelho estático (sem efeito pulsante) */
.kanban-card-due.today-urgent {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* 3. Hoje: Amarelo */
.kanban-card-due.today {
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fde047;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.18);
}

/* 4. Amanhã: Laranja */
.kanban-card-due.tomorrow {
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.42);
  color: #fdba74;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.18);
}

/* 5. Próximos dias (Futuro): Roxo suave / neutro */
.kanban-card-due.future {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}

/* Concluída */
.kanban-card-due.completed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  opacity: 0.85;
}

@keyframes pulseOverdueRed {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.95);
    color: #ffffff;
    background: rgba(239, 68, 68, 0.32);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.4);
  }
}

/* ============================================================================
   MODAL TRELLO CARD DETAIL (INTERFACE RICA E MAIS LARGA ESTILO TRELLO)
   ============================================================================ */
.modal-trello {
  max-width: 1160px !important;
  width: 95vw;
  height: 86vh !important;
  max-height: 86vh !important;
  border-radius: 16px;
  background: #131424;
  border: 1px solid rgba(190, 180, 235, 0.16);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-trello #formEditTask {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.trello-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(190, 180, 235, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #111220;
}
.trello-header-title-box {
  flex: 1;
}
.trello-card-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-accent);
  margin-bottom: 6px;
}
.trello-kicker-sep {
  color: var(--color-text-muted);
}
.trello-title-input {
  width: 100%;
  font-size: 21px;
  font-weight: 700;
  color: #f7f6ff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0 -8px;
  outline: none;
  transition: all var(--duration-fast);
}
.trello-title-input:hover {
  background: rgba(255, 255, 255, .03);
  border-color: rgba(190, 180, 235, 0.2);
}
.trello-title-input:focus {
  background: #0f101b;
  border-color: var(--color-border-focus);
}
.trello-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 5px 0 0;
}
.trello-subtitle strong {
  color: var(--color-text-secondary);
}

.trello-body {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(290px, 1fr);
  gap: 28px;
  padding: 24px 28px;
  max-height: calc(92vh - 105px);
  overflow-y: auto;
}

/* Modal Trello Unificado (com Grid 2 Colunas e Scroll Independente) */
.trello-body-unified {
  flex: 1;
  min-height: 0;
  padding: 20px 26px 24px;
  box-sizing: border-box;
  overflow: hidden;
}

.trello-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(310px, 1fr);
  gap: 24px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

/* Coluna Esquerda: Conteúdo com Scroll Vertical Interno Fixo */
.trello-col-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  scrollbar-width: thin;
}

/* Coluna Direita: Logs com Scroll Vertical apenas se houver logs suficientes */
.trello-col-logs {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.trello-logs-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-color: rgba(190, 180, 235, 0.1);
  background: rgba(255, 255, 255, .012);
}

.trello-logs-section .trello-section-header {
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.trello-activity-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

/* Scrollbars personalizados e elegantes para o modal Trello */
.trello-col-main::-webkit-scrollbar,
.trello-activity-list::-webkit-scrollbar {
  width: 6px;
}
.trello-col-main::-webkit-scrollbar-track,
.trello-activity-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 99px;
}
.trello-col-main::-webkit-scrollbar-thumb,
.trello-activity-list::-webkit-scrollbar-thumb {
  background: rgba(190, 180, 235, 0.22);
  border-radius: 99px;
}
.trello-col-main::-webkit-scrollbar-thumb:hover,
.trello-activity-list::-webkit-scrollbar-thumb:hover {
  background: rgba(190, 180, 235, 0.45);
}

@media (max-width: 980px) {
  .modal-trello {
    height: 94vh !important;
    max-height: 94vh !important;
  }
  .trello-body-unified {
    overflow-y: auto;
  }
  .trello-body-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .trello-col-main {
    height: auto;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  .trello-col-logs,
  .trello-logs-section {
    height: auto;
    max-height: 380px;
  }
}

/* Coluna Principal da Demanda */
.trello-main-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.trello-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.trello-meta-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, .018);
  border: 1px solid rgba(190, 180, 235, 0.08);
  border-radius: 9px;
  padding: 10px 12px;
}
.trello-meta-item.trello-meta-interactive {
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.trello-meta-item.trello-meta-interactive:hover {
  background: rgba(185, 165, 255, 0.05);
  border-color: rgba(185, 165, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.trello-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.trello-meta-hint {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.65;
  transition: opacity 180ms ease;
}
.trello-meta-item:hover .trello-meta-hint {
  opacity: 1;
}
.trello-meta-popover {
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: #171828 !important;
  border: 1px solid rgba(190, 180, 235, 0.22) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  z-index: 150;
}

/* O popover de Cliente (e último item da linha) abre alinhado à direita para NUNCA vazar na coluna de Logs */
.trello-meta-popover.trello-popover-right,
.trello-meta-item:last-child .trello-meta-popover,
#popMetaClient {
  left: auto !important;
  right: 0 !important;
}

.trello-meta-item:has(.custom-select-popover:not([hidden])),
.trello-meta-item.is-popover-open {
  z-index: 120;
}
.trello-meta-label {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .08em;
  color: var(--color-text-muted);
}
.trello-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--color-text);
}
.trello-assignees-stack,
.kanban-avatars-stack {
  display: inline-flex;
  align-items: center;
}
.assignee-check-indicator {
  transition: all 140ms ease;
}
.trello-badge-due {
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  transition: all var(--duration-fast);
}
.trello-badge-due.overdue {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  animation: pulseOverdueRed 1.4s ease-in-out infinite;
}
.trello-badge-due.today-urgent {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.trello-badge-due.today {
  background: rgba(234, 179, 8, 0.16);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fde047;
}
.trello-badge-due.tomorrow {
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.42);
  color: #fdba74;
}
.trello-badge-due.future {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}
.trello-badge-due.completed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* Popover de Data e Hora com Calendário e Campo de Horário (sem atalhos rápidos) */
.trello-date-time-popover {
  min-width: 270px !important;
  padding: 14px !important;
  background: #171828 !important;
  border: 1px solid rgba(190, 180, 235, 0.25) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
}
.trello-datetime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.trello-datetime-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 750;
  color: #fff;
}
.trello-datetime-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.trello-datetime-field label {
  font-size: 10px;
  font-weight: 750;
  color: var(--color-text-muted);
  letter-spacing: .06em;
  display: block;
  margin-bottom: 4px;
}
.trello-datetime-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.trello-dot-priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warning);
}
.trello-dot-priority.high { background: var(--color-negative); box-shadow: 0 0 8px rgba(255, 143, 168, .5); }
.trello-dot-priority.medium { background: var(--color-warning); }
.trello-dot-priority.low { background: #78b7ff; }

/* Seções de Conteúdo (Descrição, Checklist, Atividades) */
.trello-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, .015);
  border: 1px solid rgba(190, 180, 235, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
}
.trello-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trello-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.trello-sec-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.trello-sec-hint {
  font-size: 10.5px;
  color: var(--color-text-muted);
}
.trello-desc-textarea {
  min-height: 105px;
  line-height: 1.5;
  font-size: 12.5px;
  background: #0f101d;
  border: 1px solid rgba(190, 180, 235, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--color-text);
}

/* Checklist de Produção estilo Trello */
.trello-checklist-count {
  font-size: 11px;
  font-weight: 750;
  color: var(--color-accent-high);
  background: rgba(185, 165, 255, .14);
  border: 1px solid rgba(185, 165, 255, .25);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: .02em;
  transition: all 200ms ease;
}
.trello-checklist-count.all-done {
  background: rgba(16, 185, 129, .16);
  border-color: rgba(16, 185, 129, .4);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, .2);
}
.trello-progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.trello-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a73ef, #75d9af);
  border-radius: 99px;
  transition: width 280ms cubic-bezier(0.16, 1, 0.3, 1), background 280ms ease, box-shadow 280ms ease;
}
.trello-progress-fill.all-done {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}
.trello-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trello-checkitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .045);
  border-left: 3px solid transparent;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.trello-checkitem:hover {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(185, 165, 255, .18);
  border-left-color: rgba(185, 165, 255, .5);
}
.trello-checkitem.is-done {
  background: rgba(16, 185, 129, .025);
  border-color: rgba(16, 185, 129, .15);
  border-left-color: #10b981;
}
.trello-checkitem-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}
/* Checkbox invisível mas acessível para teclado e eventos nativos */
.trello-custom-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* Caixinha estilizada da marcação */
.trello-checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1.5px solid rgba(190, 180, 235, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.trello-checkitem-left:hover .trello-checkbox-custom {
  border-color: rgba(185, 165, 255, 0.6);
  background: rgba(185, 165, 255, 0.08);
  box-shadow: 0 0 8px rgba(138, 115, 239, 0.25);
  transform: scale(1.05);
}
.trello-custom-checkbox-input:focus-visible + .trello-checkbox-custom {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
/* Ícone de check vetorizado dentro da marcação */
.trello-check-svg {
  width: 12px;
  height: 12px;
  stroke: #ffffff;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  opacity: 0;
  transform: scale(0.5);
  transition: all 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Estado Marcado */
.trello-custom-checkbox-input:checked + .trello-checkbox-custom {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.trello-custom-checkbox-input:checked + .trello-checkbox-custom .trello-check-svg {
  opacity: 1;
  stroke-dashoffset: 0;
  transform: scale(1);
}
.trello-checkitem-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  cursor: pointer;
  transition: all 180ms ease;
}
.trello-checkitem.is-done .trello-checkitem-text {
  text-decoration: line-through;
  color: var(--color-text-muted);
  opacity: 0.75;
}
.trello-checkitem-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.4;
  transition: all var(--duration-fast);
}
.trello-checkitem-remove:hover {
  opacity: 1;
  color: var(--color-negative);
  background: rgba(255, 107, 140, .14);
}
.trello-add-checkitem {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* Histórico / Logs da Demanda em Timeline Perfeita */
.trello-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding: 4px 0;
}
.trello-activity-list::before {
  display: none !important;
}
.trello-activity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  padding: 8px 0 8px 24px;
  position: relative;
}
/* Ponto da timeline perfeitamente alinhado */
.trello-activity-item::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(185, 165, 255, .6);
  z-index: 2;
}
/* Linha conectora entre eventos (centralizada a exatos 7px, passando pelo meio do ponto) */
.trello-activity-item::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 20px;
  bottom: -4px;
  width: 2px;
  background: rgba(190, 180, 235, 0.18);
  z-index: 1;
}
/* O último registro não estica a linha para o vazio */
.trello-activity-item:last-child::after {
  display: none;
}
.trello-activity-item strong {
  color: var(--color-text);
  font-weight: 650;
}
.trello-activity-time {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Rodapé do Modal da Demanda */
.trello-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0e19;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  gap: 16px;
  flex-wrap: wrap;
}
.trello-footer-stage-hint {
  font-size: 11.5px;
  color: var(--color-text-muted);
}
.trello-footer-stage-hint strong {
  color: var(--color-accent-high);
}
.trello-footer-stage-hint i {
  opacity: 0.8;
  font-style: normal;
}
.trello-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trello-btn-delete {
  color: var(--color-negative) !important;
  border-color: rgba(255, 107, 140, .28) !important;
}
.trello-btn-delete:hover {
  background: rgba(255, 107, 140, .12) !important;
}

/* ============================================================================
   TOOLBAR COMPACTA & SELECTS COM BUSCA DIGITÁVEL (DESIGN SYSTEM)
   ============================================================================ */
.kanban-toolbar {
  position: relative;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #121323;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 7px 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.kanban-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kanban-toolbar-caption {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 750;
  color: var(--color-text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-right: 2px;
}
.kanban-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kanban-active-counter {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
}
.kanban-active-counter strong {
  color: var(--color-accent-high);
}

/* Tabelas largas rolam dentro do próprio card, nunca empurram a página para os lados. */
.table-container {
  max-width: 100%;
  overflow-x: auto;
}

/* Custom Searchable Select */
.custom-select-wrap {
  position: relative;
}
.custom-select-wrap:has(.custom-select-popover:not([hidden])),
.custom-select-wrap.is-open {
  z-index: 100;
}
/* O card que contém um seletor aberto precisa ficar acima dos cards seguintes: cards com backdrop-filter
   criam seu próprio contexto de empilhamento e, sem isso, o card de baixo cobre a lista de opções. */
.card:has(.custom-select-popover:not([hidden])),
.card:has(.custom-select-wrap.is-open) {
  position: relative;
  z-index: 60;
}

/* Modal Form Custom Selects */
.form-custom-select-wrap {
  width: 100%;
}
.form-custom-select-wrap.is-open {
  z-index: 150;
}
.form-custom-select-trigger {
  width: 100%;
  min-height: 38px;
  background: #0f101b;
  border: 1px solid rgba(190, 180, 235, 0.16);
  border-radius: 8px;
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 180ms ease;
  box-sizing: border-box;
  text-align: left;
}
.form-custom-select-trigger:hover,
.form-custom-select-trigger[aria-expanded="true"] {
  background: #141628;
  border-color: rgba(185, 165, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(138, 115, 239, 0.12);
}
.form-custom-select-trigger .custom-select-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
}
.form-custom-select-trigger .custom-select-arrow {
  margin-left: auto;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 180ms ease;
}
.form-custom-select-trigger[aria-expanded="true"] .custom-select-arrow {
  transform: rotate(180deg);
}

.modal-custom-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 500;
  background: #171828;
  border: 1px solid rgba(190, 180, 235, 0.28);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 6px;
  box-sizing: border-box;
  animation: popoverIn 160ms var(--ease-standard) both;
}

#modalCreateTask .modal-window {
  overflow: visible;
}
#modalCreateTask .modal-body {
  overflow: visible;
}
.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(190, 180, 235, 0.12);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}
.custom-select-trigger:hover,
.custom-select-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(185, 165, 255, 0.35);
  color: var(--color-accent-high);
}
.custom-select-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
}
.custom-select-value {
  color: var(--color-text);
  font-weight: 600;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-select-arrow {
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 180ms ease;
}
.custom-select-trigger[aria-expanded="true"] .custom-select-arrow {
  transform: rotate(180deg);
}
.custom-select-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 500;
  background: #171828;
  border: 1px solid rgba(190, 180, 235, 0.25);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 6px;
  min-width: 220px;
  animation: popoverIn 160ms var(--ease-standard) both;
}
.custom-select-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}
.custom-select-search .icon {
  position: absolute;
  left: 14px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.custom-select-input {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(190, 180, 235, 0.12);
  border-radius: 6px;
  padding: 0 10px 0 32px;
  color: var(--color-text);
  font-size: 11.5px;
  font-family: inherit;
  outline: none;
  transition: all 180ms ease;
  box-sizing: border-box;
}
.custom-select-input:focus {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(185, 165, 255, 0.15);
}
.custom-select-options {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.custom-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 140ms ease;
}
.custom-select-option:hover {
  background: rgba(185, 165, 255, 0.1);
  color: var(--color-accent-high);
}
.custom-select-option.selected {
  background: rgba(185, 165, 255, 0.16);
  color: var(--color-accent-high);
  font-weight: 650;
}

@media (max-width: 900px) {
  .trello-meta-strip {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   COCKPIT OPERACIONAL (DASHBOARD REAL PARA A OPERAÇÃO DA AGÊNCIA)
   ============================================================================ */
.cockpit-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
/* Raio-X dos clientes + pauta do dia (empilha em telas estreitas) */
.cockpit-main-grid {
  display: grid;
  /* Coluna da direita (Entregas de Hoje) estreita: o espaço vai para o Status Real dos Clientes */
  grid-template-columns: minmax(0, 1fr) minmax(250px, 290px);
  gap: 18px;
  margin-bottom: 24px;
}
.cockpit-main-grid > * { min-width: 0; }
.cockpit-stat-box {
  background: #11121e;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: transform var(--duration-fast), border-color var(--duration-fast);
}
.cockpit-stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-focus);
}
.cockpit-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.cockpit-stat-val {
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
  color: var(--color-text);
}
.cockpit-stat-footer {
  font-size: 10px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Semáforo Operacional do Cliente */
.traffic-light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 650;
}
.traffic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.traffic-green { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, .4); }
.traffic-yellow { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, .4); }
.traffic-red { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, .4); }

/* Pacing Bar */
.pacing-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  min-width: 100px;
}
.pacing-bar {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  position: relative;
}
.pacing-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 400ms var(--ease-standard);
}
.pacing-ideal-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  opacity: .75;
}

/* Responsividade do Dashboard */
@media (max-width: 1300px) {
  .cockpit-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .cockpit-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 768px) {
  .cockpit-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .cockpit-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Responsividade do Dashboard */
@media (max-width: 1200px) {
  .stats-grid-8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .stats-grid-8 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .finance-kpi-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .filter-bar-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Estilos de Impressão (PDF de Alta Legibilidade) */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .sidebar, .topbar-actions, .filter-bar-header, .critical-alerts-strip, .modal-overlay, .toast-region {
    display: none !important;
  }
  .main-area {
    margin: 0 !important;
    background: none !important;
  }
  .card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  .data-table th, .data-table td {
    color: #000 !important;
    border-bottom: 1px solid #ddd !important;
  }
}


/* ============================================================================
   Menu de Contexto do Card Kanban (Acesso Rápido - Botão Direito)
   ============================================================================ */
.kanban-context-menu {
  position: fixed;
  z-index: 10080 !important;
  background: #141527 !important;
  border: 1px solid rgba(190, 180, 235, 0.24) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(185, 165, 255, 0.14) !important;
  min-width: 230px;
  max-width: 320px;
  padding: 6px;
  backdrop-filter: blur(20px);
  animation: popoverIn 140ms cubic-bezier(0.16, 1, 0.3, 1) both;
  user-select: none;
}
.kanban-ctx-header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
}
.kanban-ctx-header strong {
  display: block;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 650;
}
.kanban-ctx-client {
  display: inline-block;
  font-size: 10px;
  color: var(--color-accent-high);
  background: rgba(185, 165, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-ctx-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kanban-ctx-item-wrap {
  position: relative;
}
.kanban-ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
  box-sizing: border-box;
}
.kanban-ctx-item:hover,
.kanban-ctx-item.is-active {
  background: rgba(185, 165, 255, 0.12);
  color: #fff;
}
.kanban-ctx-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.kanban-ctx-label .icon {
  width: 14px;
  height: 14px;
  color: var(--color-accent-high);
  flex-shrink: 0;
}
.kanban-ctx-arrow {
  width: 12px;
  height: 12px;
  opacity: 0.45;
  transition: transform var(--duration-fast);
}
.kanban-ctx-item-wrap:hover .kanban-ctx-arrow,
.kanban-ctx-item.is-active .kanban-ctx-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.kanban-ctx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
}
.kanban-ctx-danger {
  color: var(--color-negative) !important;
}
.kanban-ctx-danger:hover {
  background: rgba(255, 92, 124, 0.12) !important;
  color: var(--color-negative) !important;
}
.kanban-ctx-danger .icon {
  color: var(--color-negative) !important;
}

/* Submenus laterais */
.kanban-ctx-submenu {
  position: absolute;
  top: -4px;
  left: calc(100% + 6px);
  z-index: 10090 !important;
  background: #141527;
  border: 1px solid rgba(190, 180, 235, 0.24);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(185, 165, 255, 0.14);
  min-width: 210px;
  max-width: 280px;
  max-height: 290px;
  overflow-y: auto;
  padding: 6px;
  backdrop-filter: blur(20px);
  animation: popoverIn 130ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kanban-ctx-submenu.flip-left {
  left: auto;
  right: calc(100% + 6px);
}
.kanban-ctx-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 9px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
  box-sizing: border-box;
}
.kanban-ctx-subitem:hover {
  background: rgba(185, 165, 255, 0.12);
  color: #fff;
}
.kanban-ctx-subitem.is-selected {
  background: rgba(185, 165, 255, 0.18);
  color: var(--color-accent-high);
  font-weight: 600;
}
.kanban-ctx-subitem-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.kanban-ctx-check {
  font-size: 12px;
  color: var(--color-accent-high);
  font-weight: 700;
  margin-left: 6px;
}

/* Relatórios: estado vazio honesto sobre o espaço do gráfico */
.rep-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  border: 1px dashed rgba(190, 180, 235, 0.18);
  border-radius: 10px;
}
.rep-chart-empty[hidden] { display: none; }
@media (max-width: 680px) {
  .rep-nps-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Raio-X: largura mínima para as ações não quebrarem em coluna (rola dentro do card) */
.cockpit-pulse-table { min-width: 600px; width: 100%; }
.cockpit-pulse-table th, .cockpit-pulse-table td { padding-left: 8px; padding-right: 8px; }
.cockpit-pulse-table th { white-space: normal; line-height: 1.3; }
.cockpit-pulse-table td:first-child { min-width: 120px; white-space: normal; }
.cockpit-pulse-table td:nth-child(2) { min-width: 96px; max-width: 160px; white-space: normal; }
.cockpit-pulse-table td:last-child { width: 1%; white-space: nowrap; }
.cockpit-pulse-table td:last-child > div { flex-wrap: nowrap !important; gap: 5px !important; }
@media (min-width: 1101px) and (max-width: 1500px) {
  .cockpit-main-grid { grid-template-columns: minmax(0, 1fr) 250px; }
}
.cockpit-today-card { padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.cockpit-kanban-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #141423; border: 1px solid var(--color-border); color: var(--color-text); font-size: 12px; font-weight: 600; text-decoration: none; }
.cockpit-kanban-link:hover { border-color: rgba(185, 165, 255, 0.4); }
.cockpit-kanban-link .status-badge { font-size: 10px; }

/* Integrações (integracoes.html) */
.integration-card { padding: 24px; border: 1px solid rgba(190, 180, 235, 0.16); background: rgba(18, 19, 34, 0.7); backdrop-filter: blur(12px); border-radius: var(--radius-xl); }
.integration-card[hidden] { display: none; }
.integration-soon-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.integration-soon { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.015); }
.integration-soon strong { font-size: 13px; color: var(--color-text); }
.integration-soon p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--color-text-muted); }
#smtpTestResult:empty { display: none; }
.form-row.smtp-server-row { grid-template-columns: 2fr 1fr 1.4fr; }
@media (max-width: 640px) {
  .form-row.smtp-server-row { grid-template-columns: 1fr; }
  .integration-card { padding: 18px; }
}

/* Lembretes de cobrança (configuracoes.html) */
.form-row.reminder-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-row.reminder-row { grid-template-columns: 1fr; } }

/* Fechamento de mês (financeiro.html) */
.month-lock { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 6px; font-size: 10px; font-weight: 700; color: var(--color-accent-high); background: rgba(185, 165, 255, 0.1); white-space: nowrap; }

/* Tarefas: comentários, anexos e modelos (tarefas.html) */
.task-comment-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.task-comment-form[hidden] { display: none; }
.task-comment-form textarea { min-height: 56px; font-size: 12px; }
.task-comment-form button { align-self: flex-end; }
.task-comments { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.task-comment { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); }
.task-comment-head { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--color-text-muted); }
.task-comment-head strong { color: var(--color-text); font-size: 11.5px; }
.task-comment-del { margin-left: auto; font-size: 10.5px; color: var(--color-negative); }
.task-comment-body { margin-top: 4px; font-size: 12px; color: var(--color-text-secondary); white-space: pre-wrap; word-break: break-word; }
.task-extra-empty { font-size: 11px; color: var(--color-text-muted); padding: 4px 0; }
.task-attachments { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.task-attachment { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); }
.task-attachment-name { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--color-accent-high); cursor: pointer; text-align: left; word-break: break-all; }
.task-attachment-meta { font-size: 10.5px; color: var(--color-text-muted); }
.kanban-card-extra-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--color-text-muted); }
.template-manager { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.template-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.template-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.02); color: var(--color-text); cursor: pointer; text-align: left; }
.template-item small { font-size: 10.5px; color: var(--color-text-muted); }
.template-item.selected { border-color: rgba(185, 165, 255, 0.5); background: rgba(185, 165, 255, 0.1); }
.template-form { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 680px) { .template-manager { grid-template-columns: 1fr; } }

/* CRM: total e chance de fechar por coluna */
.crm-col-total { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 600; color: var(--color-text-muted); }

/* Assinatura eletrônica (contratos.html) */
.signature-status-box { padding: 12px 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); }
.signature-status-box[hidden] { display: none; }
.signature-signer-status { margin: 8px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--color-text-secondary); }
.signature-signer-status span { color: var(--color-text-muted); }
.signature-signers { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.signature-signer-row { display: grid; grid-template-columns: 1fr 1fr 32px; gap: 6px; }
@media (max-width: 640px) { .signature-signer-row { grid-template-columns: 1fr 32px; } .signature-signer-row [data-signer-email] { grid-column: 1; } }

/* Integrações: passo a passo e vínculos do Meta Ads */
.integration-guide { margin-top: 14px; font-size: 12px; color: var(--color-text-secondary); }
.integration-guide summary { cursor: pointer; color: var(--color-accent-high); font-weight: 600; }
.integration-guide ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }
.integration-guide p { margin: 8px 0 0; font-size: 11px; color: var(--color-text-muted); }
.meta-links-table td, .meta-links-table th { padding: 8px 10px; }

/* Vendas pelo WhatsApp (whatsapp.html) */
.wa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wa-stages-table td { vertical-align: middle; padding: 6px 8px; }
@media (max-width: 1000px) { .wa-grid { grid-template-columns: 1fr; } }

/* Status das integrações (rodapé do menu) */
.integration-status { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--color-border); background: rgba(255, 255, 255, 0.025); color: var(--color-text); text-decoration: none; min-width: 0; }
.integration-status:hover { border-color: rgba(185, 165, 255, 0.35); }
.integration-status-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--color-positive); box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.15); }
.integration-status[data-state="problem"] { border-color: rgba(255, 92, 124, 0.45); background: rgba(255, 92, 124, 0.07); }
.integration-status[data-state="problem"] .integration-status-dot { background: var(--color-negative); box-shadow: 0 0 0 3px rgba(255, 92, 124, 0.18); animation: integration-pulse 1.8s ease-in-out infinite; }
.integration-status[data-state="off"] .integration-status-dot { background: var(--color-text-muted); box-shadow: none; }
.integration-status-text { display: flex; flex-direction: column; min-width: 0; }
.integration-status-text strong { font-size: 11.5px; font-weight: 650; }
.integration-status-text strong em { font-style: normal; color: var(--color-negative); margin-left: 3px; }
.integration-status-text small { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.integration-status[data-state="problem"] .integration-status-text small { color: #ffb3c3; }
@keyframes integration-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 92, 124, 0.05); } }
@media (prefers-reduced-motion: reduce) { .integration-status[data-state="problem"] .integration-status-dot { animation: none; } }

.integration-status-text small.integration-status-detail { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }

/* Checkbox no padrão das checklists (Integrações e Vendas WhatsApp) */
input[type="checkbox"].ds-check { appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; width: 18px; height: 18px; border-radius: 5px; background: rgba(255, 255, 255, .04); border: 1.5px solid rgba(190, 180, 235, 0.22); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); cursor: pointer; transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1); vertical-align: middle; }
input[type="checkbox"].ds-check:hover:not(:disabled) { border-color: rgba(185, 165, 255, 0.6); background-color: rgba(185, 165, 255, 0.08); box-shadow: 0 0 8px rgba(138, 115, 239, 0.25); }
input[type="checkbox"].ds-check:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
input[type="checkbox"].ds-check:checked { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px 11px no-repeat, linear-gradient(135deg, #10b981 0%, #059669 100%); border-color: #10b981; box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3); }
input[type="checkbox"].ds-check:disabled { opacity: .45; cursor: not-allowed; }
.ds-select-wrap { position: relative; }
.ds-select-wrap .form-custom-select-trigger:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.ds-select-popover { z-index: 2100; } /* acima dos modais (z-index 2000) */
.ds-select-popover .custom-select-options { max-height: 240px; overflow-y: auto; }
.ds-select-popover .ds-select-search { margin-bottom: 6px; padding-left: 10px; }
.ds-select-popover .custom-select-option[hidden] { display: none; }
.ds-select-empty { margin: 6px 4px 2px; font-size: 11.5px; color: var(--color-text-muted); }

/* Vendas WhatsApp: link fixo de conexão do cliente */
.wa-link-box { margin-top: 14px; padding: 12px; border-radius: 10px; border: 1px solid rgba(190, 180, 235, 0.14); background: rgba(255, 255, 255, 0.02); }
.wa-link-box label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: 6px; }
.wa-link-row { display: flex; gap: 8px; }
.wa-link-row .form-input { flex: 1; min-width: 0; height: 36px; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wa-link-row .button { height: 36px; font-size: 11.5px; white-space: nowrap; }
.wa-link-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.wa-link-foot span { font-size: 10.5px; color: var(--color-text-muted); flex: 1; min-width: 180px; }
.wa-link-foot .button { height: 28px; padding: 0 10px; font-size: 10.5px; }

/* Desempenho: filtros com o seletor do design (mesma altura e fundo do antigo .filter-select) */
.filter-item .ds-select-wrap { width: 100%; }
.filter-item .ds-select-wrap .form-custom-select-trigger { min-height: 36px; height: 36px; padding: 0 12px; background: #141423; font-size: 11.5px; font-weight: 500; }
.filter-item .ds-select-wrap .form-custom-select-trigger:hover { background: #17182c; }
.filter-item .ds-select-wrap .custom-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type="month"].form-input { color-scheme: dark; }

/* Desempenho: indicadores em grade regular (9 numa linha em telas largas, 5+4 e 3x3 nas menores) */
.perf-kpi-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 12px; margin: 18px 0; padding: 14px; background: #141423; border-radius: 8px; border: 1px solid var(--color-border); }
@media (max-width: 1280px) { .perf-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 720px) { .perf-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.perf-kpi-grid strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Desempenho: calendário de período (predefinições + intervalo livre) */
.perf-period-trigger { min-height: 36px; height: 36px; padding: 0 12px; background: #141423; font-size: 11.5px; font-weight: 500; }
.perf-period-trigger:hover { background: #17182c; }
.perf-period-trigger .perf-period-icon { color: var(--color-accent-high); flex-shrink: 0; }
.perf-period-trigger .custom-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-period-trigger.is-open .custom-select-arrow { transform: rotate(180deg); }
.perf-cal-pop { position: fixed; z-index: 2100; display: flex; width: 468px; max-width: calc(100vw - 16px); background: #171828; border: 1px solid rgba(190, 180, 235, 0.25); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06); animation: popoverIn 160ms var(--ease-standard) both; overflow: hidden; }
.perf-cal-pop[hidden] { display: none; }
.perf-cal-title { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--color-text-muted); margin: 0 0 8px; }
.perf-cal-presets { width: 148px; flex-shrink: 0; padding: 14px 10px; border-right: 1px solid rgba(190, 180, 235, 0.12); display: flex; flex-direction: column; gap: 2px; }
.perf-cal-preset { text-align: left; padding: 7px 10px; border-radius: 7px; border: none; background: none; color: var(--color-text-secondary); font-size: 11.5px; font-family: inherit; cursor: pointer; transition: all 140ms ease; }
.perf-cal-preset:hover { background: rgba(185, 165, 255, 0.1); color: var(--color-accent-high); }
.perf-cal-preset.active { background: rgba(185, 165, 255, 0.16); color: var(--color-accent-high); font-weight: 600; }
.perf-cal-main { flex: 1; min-width: 0; padding: 14px 14px 12px; }
.perf-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.perf-cal-nav strong { font-size: 12.5px; font-weight: 650; color: var(--color-text); }
.perf-cal-navbtn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; border: 1px solid rgba(190, 180, 235, 0.14); background: rgba(255, 255, 255, 0.03); color: var(--color-text-secondary); cursor: pointer; transition: all 140ms ease; }
.perf-cal-navbtn:hover:not(:disabled) { border-color: rgba(185, 165, 255, 0.45); color: var(--color-accent-high); }
.perf-cal-navbtn:disabled { opacity: .35; cursor: not-allowed; }
.perf-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.perf-cal-wd { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--color-text-muted); padding: 6px 0 4px; }
.perf-cal-day { height: 30px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--color-text-secondary); font-size: 11.5px; font-family: inherit; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.perf-cal-day:hover:not(:disabled) { background: rgba(185, 165, 255, 0.12); color: var(--color-accent-high); }
.perf-cal-day:disabled { opacity: .25; cursor: not-allowed; }
.perf-cal-day.is-today { border-color: rgba(185, 165, 255, 0.55); }
.perf-cal-day.in-range { background: rgba(185, 165, 255, 0.14); color: var(--color-text); border-radius: 4px; }
.perf-cal-day.is-preview { background: rgba(185, 165, 255, 0.08); }
.perf-cal-day.is-edge { background: linear-gradient(135deg, #b9a5ff 0%, #8a73ef 100%); color: #14121e; font-weight: 700; box-shadow: 0 2px 10px rgba(138, 115, 239, 0.35); }
.perf-cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(190, 180, 235, 0.1); }
.perf-cal-sel { font-size: 11px; color: var(--color-text-muted); min-width: 0; }
.perf-cal-apply { height: 30px; padding: 0 14px; font-size: 11.5px; flex-shrink: 0; }
.perf-cal-apply:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 520px) {
  .perf-cal-pop { flex-direction: column; width: calc(100vw - 16px); }
  .perf-cal-presets { width: auto; border-right: none; border-bottom: 1px solid rgba(190, 180, 235, 0.12); flex-direction: row; flex-wrap: wrap; }
  .perf-cal-presets .perf-cal-title { width: 100%; }
}

/* Seletor do design: o valor escolhido usa toda a largura do campo (o .custom-select-value genérico limita a 170px) */
.ds-select-wrap .custom-select-value, .perf-period-trigger .custom-select-value { max-width: none; min-width: 0; flex: 1; text-align: left; }
/* Caixas de texto com a fonte do painel (o <textarea> herdava a fonte monoespaçada do navegador) */
.form-textarea, textarea.form-input { font-family: inherit; }

/* PWA: passos de instalação no iPhone/iPad */
.pwa-ios-steps { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; line-height: 1.5; color: var(--color-text-secondary); }
.pwa-ios-steps strong { color: var(--color-text); }
.pwa-ios-steps .icon { vertical-align: -2px; color: var(--color-accent-high); }

/* ── Notificador (Sistema → Notificador) ── */
.notifier-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px; align-items: start; }
.notifier-form, .notifier-history { padding: 22px; overflow: visible; }
.notifier-form .card-header, .notifier-history .card-header { margin-bottom: 18px; }
.notifier-form .form-field { margin-bottom: 14px; position: relative; }
.notifier-form .form-textarea { min-height: 104px; resize: vertical; }
.notifier-counter { position: absolute; right: 2px; top: 0; font-size: 10px; color: var(--color-text-muted); }
.notifier-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.notifier-section { border: 0; padding: 4px 0 4px; margin: 4px 0 0; border-top: 1px solid var(--color-border); min-width: 0; }
.notifier-section legend { padding: 0; margin-bottom: 10px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--color-text-secondary); }
.notifier-subtitle { font-size: 11.5px; font-weight: 650; color: var(--color-text); margin: 4px 0 8px; }
.notifier-subtitle small { font-weight: 500; color: var(--color-text-muted); }
.notifier-muted { font-size: 12px; color: var(--color-text-muted); }
.notifier-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.notifier-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 6px 9px; border-radius: 10px; border: 1px solid var(--color-border); background: rgba(255, 255, 255, .02); font-size: 12px; cursor: pointer; transition: border-color 160ms ease, background 160ms ease; user-select: none; }
.notifier-chip:hover { border-color: rgba(185, 165, 255, .35); }
.notifier-chip.is-on { border-color: rgba(16, 185, 129, .45); background: rgba(16, 185, 129, .07); }
.notifier-chip.is-empty { opacity: .5; cursor: not-allowed; }
.notifier-chip small { min-width: 20px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--color-text-muted); font-size: 10px; font-weight: 700; }
.notifier-chip-all { font-weight: 650; }
.notifier-people { border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.notifier-people-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--color-border); color: var(--color-text-muted); }
.notifier-people-search .form-input { border: 0; background: transparent; box-shadow: none; padding-left: 0; height: 40px; }
.notifier-people-search .form-input:focus { box-shadow: none; }
.notifier-people-list { max-height: 264px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.notifier-people-list > .notifier-muted { padding: 10px; }
.notifier-person { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; min-width: 0; }
.notifier-person:hover { background: rgba(255, 255, 255, .03); }
.notifier-person.is-on { background: rgba(16, 185, 129, .06); }
.notifier-person.is-by-role { cursor: default; }
.notifier-avatar { width: 30px; height: 30px; font-size: 10.5px; flex-shrink: 0; }
.notifier-person-info { display: flex; flex-direction: column; min-width: 0; }
.notifier-person-info strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notifier-person-info small { font-size: 10.5px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notifier-audience { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 12px; color: var(--color-text-muted); background: rgba(255, 255, 255, .03); border: 1px dashed var(--color-border); }
.notifier-audience.is-ready { color: var(--color-text-secondary); border-style: solid; border-color: rgba(185, 165, 255, .28); background: var(--color-accent-soft); }
.notifier-audience strong { color: var(--color-text); }
.notifier-when { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.notifier-when-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 10px; border: 1px solid var(--color-border); background: rgba(255, 255, 255, .02); color: var(--color-text-secondary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 160ms ease; }
.notifier-when-btn:hover { border-color: rgba(185, 165, 255, .35); color: var(--color-text); }
.notifier-when-btn.is-active { border-color: rgba(185, 165, 255, .55); background: var(--color-accent-soft); color: var(--color-accent-high); }
.notifier-schedule input[type="date"], .notifier-schedule input[type="time"] { color-scheme: dark; }
.notifier-preview-wrap { padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--color-border); }
.notifier-preview { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--color-border); }
.notifier-preview .notification-content { min-width: 0; }
.notifier-preview .notification-title { display: block; font-size: 12.5px; overflow-wrap: anywhere; }
.notifier-preview .notification-desc { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--color-text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
.notifier-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.notifier-actions .button { height: 40px; padding: 0 18px; }
.notifier-history .card-header .filter-select { min-width: 150px; }
.notifier-history-list { display: flex; flex-direction: column; gap: 10px; max-height: 1100px; overflow-y: auto; scrollbar-width: thin; }
.notifier-item { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--color-border); background: rgba(255, 255, 255, .015); min-width: 0; }
.notifier-item-body { flex: 1; min-width: 0; }
.notifier-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notifier-item-top strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.notifier-item-body > p { margin: 4px 0 8px; font-size: 12px; line-height: 1.5; color: var(--color-text-secondary); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notifier-item-meta { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.notifier-item-meta b { font-weight: 650; color: var(--color-text-secondary); }
.notifier-item-actions { margin-top: 10px; }
.notifier-item-actions .button { height: 30px; font-size: 11px; padding: 0 12px; }
.notifier-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 12px; color: var(--color-text-muted); font-size: 12px; }
.notifier-empty .icon { width: 22px; height: 22px; opacity: .6; }
@media (max-width: 1100px) { .notifier-layout { grid-template-columns: minmax(0, 1fr); } }

/* Tarefas: tipo de demanda no card e lista de arquivadas */
.kanban-demand-type { display: inline-block; margin-top: 6px; font-size: 9.5px; font-weight: 650; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; background: var(--color-accent-soft); color: var(--color-accent-high); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archived-tasks-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.archived-task { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border); background: rgba(255, 255, 255, .02); }
.archived-task strong { display: block; font-size: 12.5px; overflow-wrap: anywhere; }
.archived-task small { display: block; font-size: 10.5px; color: var(--color-text-muted); margin-top: 2px; overflow-wrap: anywhere; }

/* Ficha do cliente: contatos */
.client-contacts { background: rgba(255,255,255,0.02); border: 1px solid rgba(190,180,235,0.08); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.client-contacts-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.client-contacts-list { display: flex; flex-direction: column; gap: 6px; }
.client-contact { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02); }
.client-contact strong { font-size: 12px; color: var(--color-text); }
.client-contact small { font-size: 10.5px; color: var(--color-text-muted); }
.client-contact-meta { font-size: 11px; color: var(--color-text-secondary); margin-top: 2px; overflow-wrap: anywhere; }
.client-contact-meta a { color: var(--color-accent-high); text-decoration: none; }
.client-contact-btns { display: flex; gap: 6px; flex-shrink: 0; }
.client-contact-btns .button { height: 26px; font-size: 10.5px; padding: 0 9px; }
.client-contact-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.client-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.client-contact-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) { .client-contact-grid { grid-template-columns: minmax(0, 1fr); } .client-contact { flex-direction: column; align-items: stretch; } }

/* Verificação em duas etapas (perfil) */
.tfa-status { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.05); color: var(--color-text-secondary); margin-bottom: 12px; }
.tfa-status.is-on { background: rgba(16,185,129,.12); color: var(--color-positive); }
.tfa-form { display: flex; flex-direction: column; gap: 10px; }
.tfa-steps { font-size: 12px; color: var(--color-text-secondary); padding-left: 18px; margin: 0 0 10px; }
.tfa-qr { width: 200px; max-width: 100%; margin: 0 auto; background: #fff; padding: 8px; border-radius: 10px; }
.tfa-qr svg { display: block; width: 100%; height: auto; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.tfa-codes span { padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.04); text-align: center; user-select: all; }

/* DRE (Financeiro): linha · competência · caixa */
.dre-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px; align-items: center; }
.dre-grid > span:first-child { min-width: 0; overflow-wrap: anywhere; }

.finance-tabs .tab-short { display: none; }
.finance-tabs .button { gap: 0; }
.finance-tabs .tab-long { margin-right: 4px; }
#btnOpenProposalsModal { gap: 0; }
#btnOpenProposalsModal svg { margin-right: 6px; }
