/* =============================================================
   CRM COMERCIAL KELTRA - SISTEMA VISUAL ESTILO PIPEDRIVE
   Inspirado no Design System cui5 do PipeDrive
   Paleta: #003D9C (Azul Keltra), #001538 (Navy Keltra), #F4F6F9 (Slate)
   Zero Emojis. Alta densidade de informação e responsividade.
============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

:root {
  --keltra-blue: #003d9c;
  --keltra-blue-hover: #0052cc;
  --keltra-navy-dark: #001538;
  --keltra-navy-surface: #001d4a;
  
  --pd-green: #047857;
  --pd-green-hover: #065f46;
  --pd-red: #b91c1c;
  --pd-red-hover: #991b1b;
  --pd-yellow: #d97706;
  
  --bg-app: #f2f5f8;
  --bg-surface: #ffffff;
  --bg-sidebar: #001d4a;
  
  --border-light: #e5e8ec;
  --border-medium: #cbd5e1;
  --border-active: #003d9c;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-on-dark: #f8fafc;
  
  --sidebar-collapsed-w: 56px;
  --sidebar-expanded-w: 220px;
  --sidebar-w: var(--sidebar-collapsed-w);
  --header-h: 52px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
   LOGIN SCREEN
------------------------------------------------------------- */
.login-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, #002b66, #001538);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 21, 56, 0.4);
  width: 420px;
  max-width: 100%;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 4px solid var(--keltra-blue);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.login-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.login-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-input-group label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-input-group input {
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
}

.login-input-group input:focus {
  border-color: var(--keltra-blue);
  box-shadow: 0 0 0 2px rgba(0, 61, 156, 0.15);
}

.btn-login {
  background: var(--keltra-blue);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-login:hover {
  background: var(--keltra-blue-hover);
}

.quick-user-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.user-pill-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

.user-pill-btn:hover {
  background: var(--keltra-blue);
  color: #ffffff;
  border-color: var(--keltra-blue);
}

.login-error-msg {
  background: #fef2f2;
  color: #b91c1c;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid #fecaca;
  display: none;
}

/* -------------------------------------------------------------
   TOPBAR & HEADER
------------------------------------------------------------- */
header.keltra-header {
  height: var(--header-h);
  background: var(--keltra-navy-dark);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid var(--keltra-blue);
  z-index: 50;
  flex-shrink: 0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.keltra-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
  border-left: 1px solid #1e293b;
  padding-left: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  background: var(--keltra-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

.btn-logout {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-logout:hover {
  background: #1e293b;
  color: #ffffff;
}

/* -------------------------------------------------------------
   APP SHELL
------------------------------------------------------------- */
.app-container {
  display: flex;
  height: calc(100vh - var(--header-h));
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR PIPEDRIVE STYLE - AUTO EXPAND ON HOVER / COLLAPSE ON LEAVE (IMAGEM 2) */
aside.keltra-sidebar {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
  background: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #001538;
  flex-shrink: 0;
  user-select: none;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease;
  position: relative;
  z-index: 100;
  white-space: nowrap;
}

/* Expande com fluidez ao passar o mouse ou quando fixada pelo usuário */
aside.keltra-sidebar:hover,
aside.keltra-sidebar.is-pinned {
  width: var(--sidebar-expanded-w);
  min-width: var(--sidebar-expanded-w);
  box-shadow: 4px 0 24px rgba(0, 15, 45, 0.35);
}

.nav-section {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 6px 10px 4px 10px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

aside.keltra-sidebar:hover .nav-section-title,
aside.keltra-sidebar.is-pinned .nav-section-title {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active {
  background: var(--keltra-blue);
  color: #ffffff;
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.nav-item .nav-item-text {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  font-size: 13px;
}

aside.keltra-sidebar:hover .nav-item-text,
aside.keltra-sidebar.is-pinned .nav-item-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* BOTÃO DE CONTRAIR / FIXAR NO RODAPÉ */
.sidebar-footer-pin {
  margin-top: auto;
  padding: 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-pin-sidebar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  overflow: hidden;
}

.btn-pin-sidebar:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-pin-sidebar svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-pin-sidebar .nav-item-text {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 12px;
}

aside.keltra-sidebar:hover .btn-pin-sidebar .nav-item-text,
aside.keltra-sidebar.is-pinned .btn-pin-sidebar .nav-item-text {
  opacity: 1;
  transform: translateX(0);
}

aside.keltra-sidebar.is-pinned .btn-pin-sidebar {
  color: #38bdf8;
}

/* -------------------------------------------------------------
   MAIN VIEWPORT & PIPEDRIVE TOOLBAR
------------------------------------------------------------- */
main.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
}

/* TOOLBAR PIPEDRIVE */
.pd-toolbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pd-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-add-deal {
  background: var(--pd-green);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-add-deal:hover {
  background: var(--pd-green-hover);
}

.pipeline-dropdown-wrap select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
}

.pipeline-dropdown-wrap select:focus {
  border-color: var(--keltra-blue);
}

/* SWITCHER DE VISUALIZAÇÃO: KANBAN vs LISTA */
.view-switch-group {
  display: inline-flex;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.btn-view-toggle {
  background: #ffffff;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: #64748b;
  border-right: 1px solid var(--border-light);
}

.btn-view-toggle:last-child {
  border-right: none;
}

.btn-view-toggle:hover {
  background: #f8fafc;
  color: var(--text-primary);
}

.btn-view-toggle.active {
  background: #e6eef9;
  color: var(--keltra-blue);
}

.btn-view-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.pd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-filter-select {
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 5px 8px;
  color: #334155;
  background: #ffffff;
  outline: none;
}

/* -------------------------------------------------------------
   KANBAN BOARD ESTILO PIPEDRIVE
------------------------------------------------------------- */
.kanban-viewport {
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 16px;
  gap: 10px;
  background: var(--bg-app);
}

.pd-stage-col {
  width: 290px;
  min-width: 290px;
  max-width: 290px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.pd-stage-header {
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  background: #ffffff;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.pd-stage-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.pd-stage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.pd-stage-summary .total-val {
  font-weight: 700;
  color: #003d9c;
}

.pd-stage-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}

.pd-stage-cards.drag-over {
  background: #e6eef9;
  border: 2px dashed #003d9c;
}

/* CARD DO PIPEDRIVE */
.pd-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  user-select: none;
}

.pd-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.pd-card.rotten {
  border-left: 3px solid var(--pd-red);
  background: #fffafa;
}

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

.pd-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #001738;
  line-height: 1.3;
}

.pd-card-client-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #475569;
}

.pd-card-client-row .org-text {
  font-weight: 500;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-card-client-row .person-text {
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  color: #ffffff;
  text-transform: uppercase;
}

.badge-priority-baixa { background: #64748b; }
.badge-priority-media { background: #003d9c; }
.badge-priority-alta { background: #d97706; }
.badge-priority-urgente { background: #dc2626; }

.pd-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.pd-card-amount {
  font-size: 12px;
  font-weight: 700;
  color: #003d9c;
}

/* SEMÁFORO PIPEDRIVE */
.pd-traffic-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-traffic-light.green {
  background: #047857;
}

.pd-traffic-light.yellow {
  background: #d97706;
}

.pd-traffic-light.red {
  background: #b91c1c;
}

.pd-traffic-light svg {
  width: 8px;
  height: 8px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.5;
}

/* -------------------------------------------------------------
   VISUALIZAÇÃO EM LISTA (SPREADSHEET / TABELA PIPEDRIVE)
------------------------------------------------------------- */
.list-view-container {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.list-table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pd-spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12px;
}

.pd-spreadsheet-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
}

.pd-spreadsheet-table th:hover {
  background: #f1f5f9;
}

.pd-spreadsheet-table td {
  padding: 9px 12px;
  color: #1e293b;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.pd-spreadsheet-table tr:hover td {
  background: #f8fafc;
}

/* -------------------------------------------------------------
   VISÃO DETALHADA DO NEGÓCIO (DEAL DETAIL DRAWER / VIEW)
------------------------------------------------------------- */
.deal-detail-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 21, 56, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}

.deal-detail-panel {
  width: 950px;
  max-width: 95vw;
  background: #ffffff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 21, 56, 0.25);
  animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* CABEÇALHO DO DEAL DETAIL */
.deal-detail-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deal-detail-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deal-detail-h1 {
  font-size: 18px;
  font-weight: 700;
  color: #001738;
}

.deal-detail-amount {
  font-size: 15px;
  font-weight: 700;
  color: #003d9c;
}

.deal-detail-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-win-large {
  background: #047857;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-win-large:hover {
  background: #065f46;
}

.btn-lost-large {
  background: #b91c1c;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-lost-large:hover {
  background: #991b1b;
}

.btn-decline-large {
  background: #475569;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-decline-large:hover {
  background: #334155;
}

.btn-close-drawer {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
}

/* CHEVRONS DE ETAPAS PIPEDRIVE */
.pipeline-chevrons-bar {
  display: flex;
  width: 100%;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  padding: 8px 16px;
  gap: 4px;
}

.chevron-step {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
}

.chevron-step:hover {
  background: #cbd5e1;
}

.chevron-step.completed {
  background: #047857;
  color: #ffffff;
}

.chevron-step.active {
  background: #003d9c;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 61, 156, 0.3);
}

/* CORPO DO DEAL DETAIL (DUAS COLUNAS: DADOS + TIMELINE) */
.deal-detail-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #f8fafc;
  min-height: 0;
}

/* COLUNA ESQUERDA: CADASTRO */
.deal-info-sidebar {
  width: 360px;
  min-width: 360px;
  border-right: 1px solid var(--border-light);
  background: #ffffff;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card-block h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.info-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 5px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  position: relative;
}

.info-field-row.editable {
  cursor: pointer;
}

.info-field-row.editable:hover {
  background: #f1f5f9;
}

.info-field-row.editable:hover::after {
  content: "✎";
  font-size: 11px;
  color: #003d9c;
  margin-left: 6px;
}

.info-field-row .label {
  color: #64748b;
  flex-shrink: 0;
}

.info-field-row .val {
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

/* CAMPOS DE EDIÇÃO INLINE */
.inline-edit-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: flex-end;
}

.inline-edit-input, .inline-edit-select {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--keltra-blue);
  border-radius: 3px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  max-width: 180px;
}

.inline-btn-save {
  background: #047857;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.inline-btn-save:hover {
  background: #065f46;
}

.inline-btn-cancel {
  background: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
}

.inline-btn-cancel:hover {
  background: #cbd5e1;
}

.editable-header-field {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: background 0.15s;
}

.editable-header-field:hover {
  background: #f1f5f9;
}

/* POPOVER INLINE DE CHECKBOXES */
.inline-popover-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 10px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* COLUNA DIREITA: TIMELINE & ATIVIDADES */
.deal-timeline-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  position: relative;
}

/* Scrollbars visíveis e confortáveis para navegação */
.deal-timeline-area::-webkit-scrollbar,
#pane-tab-activity::-webkit-scrollbar,
.pd-activity-type-picker::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.deal-timeline-area::-webkit-scrollbar-thumb,
#pane-tab-activity::-webkit-scrollbar-thumb,
.pd-activity-type-picker::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.deal-timeline-area::-webkit-scrollbar-thumb:hover,
#pane-tab-activity::-webkit-scrollbar-thumb:hover,
.pd-activity-type-picker::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* TABS DE ENTRADA: NOTAS E ATIVIDADE */
.timeline-input-box {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-tabs-nav {
  display: flex;
  gap: 8px;
}

.timeline-tab-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
}

.timeline-tab-btn.active {
  background: #e6eef9;
  color: #003d9c;
}

.tab-pane-content textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
}

.tab-pane-content textarea:focus {
  border-color: #003d9c;
}

/* FEED DA TIMELINE */
.timeline-feed {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-entry {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-entry-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.timeline-entry-header strong {
  color: #001738;
}

.timeline-entry-content {
  font-size: 13px;
  color: #1e293b;
  white-space: pre-wrap;
}

/* PIPEDRIVE ACTIVITY PICKER & TIMELINE CONTROLS */
.deal-detail-pipeline-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 10px;
  transition: all 0.15s ease;
}
.deal-detail-pipeline-box:hover {
  background: #f1f5f9;
  border-color: #003d9c;
}
.deal-detail-pipeline-box select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #003d9c;
  cursor: pointer;
  outline: none;
}

.pd-activity-type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
  max-height: 115px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 6px;
}
.pd-act-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pd-act-type-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.pd-act-type-btn.active {
  background: #003d9c;
  color: #ffffff;
  border-color: #003d9c;
  box-shadow: 0 1px 3px rgba(0, 61, 156, 0.25);
}
.pd-act-type-btn .act-icon {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

/* RODAPÉ DO FORMULÁRIO DE ATIVIDADE COM BOTÕES STICKY VISÍVEIS */
.deal-act-form-footer {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding: 10px 0 4px 0;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 20;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.04);
}

.timeline-filter-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.timeline-filter-pill:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.timeline-filter-pill.active {
  background: #003d9c;
  color: #ffffff;
  border-color: #003d9c;
}

.pd-activity-check-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: #ffffff;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}
.pd-activity-check-btn:hover {
  border-color: #047857;
  transform: scale(1.08);
}
.pd-activity-check-btn.checked {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

.timeline-entry.note-entry {
  border-left: 4px solid #f59e0b;
}
.timeline-entry.activity-entry {
  border-left: 4px solid #003d9c;
}
.timeline-entry.activity-entry.is-done {
  border-left: 4px solid #047857;
  opacity: 0.88;
}

/* MODAIS GERAIS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 21, 56, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.modal-box {
  background: #ffffff;
  border-radius: 6px;
  width: 580px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 30px rgba(0, 21, 56, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #001738;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #003d9c;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-primary {
  background: #003d9c;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0052cc;
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

/* -------------------------------------------------------------
   CONFIGURAÇÕES E GOVERNANÇA KELTRA (ESTILO PIPEDRIVE SETTINGS)
------------------------------------------------------------- */
.settings-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.settings-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.15s ease;
}

.settings-tab-btn:hover {
  color: var(--keltra-blue);
}

.settings-tab-btn.active {
  color: var(--keltra-blue);
  border-bottom-color: var(--keltra-blue);
}

.settings-pane {
  display: flex;
  flex-direction: column;
}

.btn-action-small {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s;
}

.btn-action-small:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-action-small.danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-action-small.danger:hover {
  background: #fef2f2;
}

/* =============================================================
   RELEITURA VISUAL PIPEDRIVE CUI5 + FONTE ARCHIVO
============================================================= */

/* SEGMENTED CONTROL DE VISUALIZAÇÃO */
.pd-segmented-group {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.pd-segmented-btn {
  background: #ffffff;
  border: none;
  border-right: 1px solid #cbd5e1;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: all 0.15s ease;
}

.pd-segmented-btn:last-child {
  border-right: none;
}

.pd-segmented-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.pd-segmented-btn.active {
  background: #e8f1fc;
  color: #003d9c;
}

.pd-segmented-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* BOTÃO SPLIT VERDE PIPEDRIVE "+ Negócio" */
.btn-split-green-group {
  display: inline-flex;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  background: #228a3f;
  transition: background 0.15s ease;
}

.btn-split-green-group:hover {
  background: #1c7334;
}

.btn-split-green-main {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-split-green-arrow {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 11px;
}

/* BOTÃO PÍLULA DE FUNIL E FILTROS DO PIPEDRIVE */
.pd-pill-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: 'Archivo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pd-pill-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.pd-pill-btn.active {
  background: #e8f1fc;
  border-color: #003d9c;
  color: #003d9c;
}

.pd-pill-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.pd-link-btn {
  background: none;
  border: none;
  color: #003d9c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.pd-link-btn:hover {
  background: #e8f1fc;
}

/* POPOVER FLUTUANTE DE FILTROS PIPEDRIVE */
.pd-filter-popover {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  width: 320px;
  z-index: 1050;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-filter-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: #001738;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.pd-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.pd-filter-group select, .pd-filter-group input {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Archivo', sans-serif;
  color: #1e293b;
  outline: none;
}

.pd-filter-group select:focus, .pd-filter-group input:focus {
  border-color: #003d9c;
}

/* LISTA DE FUNIS COM MÚLTIPLA SELEÇÃO ESTILO PIPEDRIVE */
.pd-pipeline-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 2px;
}

.pd-pipeline-checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #f1f5f9;
  background: #ffffff;
  transition: all 0.12s ease;
}

.pd-pipeline-checkbox-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pd-pipeline-checkbox-item.selected {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.pd-pipeline-checkbox-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
}

.pd-pipeline-checkbox-meta {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

/* BARRA DE CHIPS DE FILTRO ATIVOS */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.filter-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-chip-remove {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.filter-chip-remove:hover {
  color: #b91c1c;
}

/* KANBAN CHEVRONS PIPELINE (IMAGEM 2) */
.pd-stage-chevron-wrapper {
  margin-bottom: 6px;
  position: relative;
}

.pd-stage-chevron {
  background: #ebedf0;
  padding: 10px 14px;
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  clip-path: polygon(0% 0%, calc(100% - 12px) 0%, 100% 50%, calc(100% - 12px) 100%, 0% 100%);
  transition: background 0.15s ease;
}

.pd-stage-chevron:hover {
  background: #e2e5e9;
}

.pd-stage-chevron .pd-stage-title {
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 14px;
}

.pd-stage-chevron .pd-stage-val {
  font-family: 'Archivo', sans-serif;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.pd-stage-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin: 4px auto 6px auto;
  transition: all 0.15s ease;
}

.pd-stage-add-btn:hover {
  background: #e8f1fc;
  border-color: #003d9c;
  color: #003d9c;
}

/* TABELAS REDIMENSIONÁVEIS E REORDENÁVEIS (IMAGEM 1) */
.pd-spreadsheet-table th {
  position: relative;
  user-select: none;
}

.th-inner-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}

.th-resizer {
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize !important;
  user-select: none;
  z-index: 20;
}

.th-resizer:hover, .th-resizer.is-resizing {
  background: #003d9c;
  opacity: 1;
}

.deals-search-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.deals-search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 650px;
}

.deals-search-input-wrapper svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.deals-search-input-wrapper input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.deals-search-input-wrapper input:focus {
  background-color: #ffffff;
  border-color: #003D9C;
  box-shadow: 0 0 0 3px rgba(0, 61, 156, 0.12);
}

.th-drag-over-left {
  border-left: 3px solid #003d9c !important;
}

.th-drag-over-right {
  border-right: 3px solid #003d9c !important;
}

th[draggable="true"] {
  cursor: grab;
}

th[draggable="true"]:active {
  cursor: grabbing;
}

/* MODAL PIPEDRIVE REFINADO (IMAGEM 3) */
.pd-modal-banner {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.pd-modal-banner-icon {
  color: #6d28d9;
  flex-shrink: 0;
  margin-top: 2px;
}

.pd-modal-banner-content {
  font-size: 12px;
  color: #4c1d95;
  line-height: 1.4;
  flex: 1;
}

.pd-modal-banner-content strong {
  display: block;
  font-weight: 700;
  color: #2e1065;
  margin-bottom: 2px;
}

.pd-modal-banner-content a {
  color: #6d28d9;
  font-weight: 600;
  text-decoration: underline;
}

.pd-modal-banner-close {
  background: none;
  border: none;
  font-size: 14px;
  color: #6d28d9;
  cursor: pointer;
}

/* INPUTS COM ÍCONE INTERNO PIPEDRIVE */
.input-with-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon-wrap svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.input-with-icon-wrap input, .input-with-icon-wrap select {
  padding-left: 32px !important;
  width: 100%;
}

.input-with-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix-wrap input {
  padding-right: 28px !important;
  width: 100%;
}

.input-with-suffix-wrap .suffix-text {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  pointer-events: none;
}

/* CHEVRONS DE SELEÇÃO DE ETAPA NO MODAL (IMAGEM 3) */
.stage-chevrons-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
  background: #f1f5f9;
  padding: 2px;
}

.stage-chevron-segment {
  flex: 1;
  background: #e2e8f0;
  clip-path: polygon(0% 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 0% 100%);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.stage-chevron-segment:first-child {
  clip-path: polygon(0% 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 0% 100%);
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.stage-chevron-segment:last-child {
  clip-path: none;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

.stage-chevron-segment.is-active-stage {
  background: #228a3f;
}

.stage-chevron-segment.is-passed-stage {
  background: #86efac;
}

.stage-chevron-segment:hover {
  filter: brightness(0.95);
}

/* -------------------------------------------------------------
   MODAL DE NEGÓCIO AMPLO E AUTOCOMPLETE PIPEDRIVE CUI5
------------------------------------------------------------- */
.modal-box-large {
  width: 900px !important;
  max-width: 96vw !important;
  max-height: 92vh !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.modal-deal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

@media (max-width: 860px) {
  .modal-deal-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.modal-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.modal-column .form-group,
.modal-column .form-row {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.modal-column input,
.modal-column select,
.modal-column textarea {
  max-width: 100%;
  box-sizing: border-box;
}

/* PILLS DE SELEÇÃO DE MERCADO, PAÍS E EIXO (ESTILO VERTICAIS KELTRA) */
.pills-selection-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px 0;
  align-items: center;
  min-width: 0;
}

.market-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.market-pill-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.market-pill-btn.active {
  background-color: var(--pill-color, #003d9c) !important;
  color: #ffffff !important;
  border-color: var(--pill-color, #003d9c) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.market-pill-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed #94a3b8;
  background: transparent;
  color: #003d9c;
  cursor: pointer;
  white-space: nowrap;
}

.market-pill-btn-add:hover {
  background: #eff6ff;
  border-color: #003d9c;
}

.pd-autocomplete-wrap {
  position: relative;
  width: 100%;
}

.pd-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 21, 56, 0.22);
  max-height: 220px;
  overflow-y: auto;
  z-index: 2500;
  display: none;
}

.pd-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.12s ease;
}

.pd-autocomplete-item:last-child {
  border-bottom: none;
}

.pd-autocomplete-item:hover,
.pd-autocomplete-item.active {
  background: #eff6ff;
}

.pd-autocomplete-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.pd-autocomplete-item-meta {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-autocomplete-create-new {
  padding: 8px 12px;
  background: #f8fafc;
  color: var(--keltra-blue);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-autocomplete-create-new:hover {
  background: #eff6ff;
}

.pd-selected-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 6px;
}

.pd-selected-pill-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pd-selected-pill-name {
  font-weight: 700;
  color: #1e3a8a;
}

.pd-selected-pill-meta {
  font-size: 11px;
  color: #475569;
}

.pd-selected-pill-remove {
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}

.pd-selected-pill-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.market-cascade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.flag-icon {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
  vertical-align: middle;
  margin-right: 5px;
  display: inline-block;
  flex-shrink: 0;
}

/* =============================================================
   FILTROS POR COLUNA E FILTROS DE DATA NA LISTAGEM
   ============================================================= */
.table-filter-row th {
  padding: 4px 6px !important;
  background-color: #f1f5f9 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

.col-filter-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  font-family: inherit;
  color: #1e293b;
  box-sizing: border-box;
  font-weight: normal;
}

.col-filter-input:focus {
  outline: none;
  border-color: #003D9C;
  box-shadow: 0 0 0 2px rgba(0, 61, 156, 0.15);
}

.btn-clear-col-filters {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
  padding: 3px 6px;
  width: 100%;
  background-color: #ffffff;
}

.btn-clear-col-filters:hover {
  color: #b91c1c;
  border-color: #fca5a5;
  background-color: #fef2f2;
}

.list-date-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}

.list-date-filter-bar label {
  font-weight: 600;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
}

.list-date-input {
  padding: 3px 6px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #1e293b;
  font-family: inherit;
}

.list-date-preset-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  font-weight: 500;
}

.list-date-preset-btn:hover {
  background: #f1f5f9;
  color: #003d9c;
  border-color: #003d9c;
}

.list-date-preset-btn.active {
  background: #003d9c;
  color: #ffffff;
  border-color: #003d9c;
}

/* =============================================================
   EDIÇÃO INLINE NA TABELA SPREADSHEET (ESTILO PIPEDRIVE)
   ============================================================= */
.table-editable-cell {
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.table-editable-cell:hover {
  background-color: #f0f7ff !important;
  box-shadow: inset 0 0 0 1px #003D9C;
}

.table-editable-cell::after {
  content: '✎';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.table-editable-cell:hover::after {
  opacity: 0.7;
}

.table-inline-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #003D9C;
  border-radius: 4px;
  background-color: #ffffff;
  color: #001738;
  box-shadow: 0 0 0 2px rgba(0, 61, 156, 0.15);
  box-sizing: border-box;
}

.table-inline-select {
  width: 100%;
  padding: 3px 6px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid #003D9C;
  border-radius: 4px;
  background-color: #ffffff;
  color: #001738;
  box-shadow: 0 0 0 2px rgba(0, 61, 156, 0.15);
  box-sizing: border-box;
  cursor: pointer;
}

.drawer-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #64748b;
  font-size: 11px;
  text-decoration: none;
  padding: 2px 5px;
  border-radius: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

.drawer-trigger-icon:hover {
  color: #003d9c;
  background: #e2e8f0;
  border-color: #003d9c;
}

.cell-saved-flash {
  animation: flashGreen 0.6s ease;
}

@keyframes flashGreen {
  0% { background-color: #dcfce7; }
  100% { background-color: transparent; }
}

/* =============================================================
   BADGES & CARDS VISUAIS PIPEDRIVE CUI5 PARA A TABELA DE ATIVIDADES
   ============================================================= */

/* 1. TIPO DE ATIVIDADE */
.pd-table-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 100%;
}
.pd-table-type-badge:hover {
  background: #eff6ff;
  border-color: #003d9c;
  box-shadow: 0 1px 3px rgba(0, 61, 156, 0.15);
}
.pd-table-type-badge .type-icon {
  font-size: 13px;
  line-height: 1;
}
.pd-table-type-badge .type-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. VERTICAL */
.pd-table-vert-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 100%;
}
.pd-table-vert-badge:hover {
  filter: brightness(0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}
.pd-table-vert-badge .vert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pd-table-vert-badge .vert-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. VENCIMENTO / DATA */
.pd-table-due-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pd-table-due-badge:hover {
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px #003d9c;
}
.pd-table-due-badge .due-relative {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}
.pd-table-due-badge.is-late .due-relative {
  color: #dc2626;
}
.pd-table-due-badge.is-done .due-relative {
  color: #047857;
}
.pd-table-due-badge .due-calendar-date {
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
}

/* 4. RESPONSÁVEL (CARD COM AVATAR CIRCULAR) */
.pd-table-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 2px 10px 2px 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 100%;
}
.pd-table-user-badge:hover {
  background: #eff6ff;
  border-color: #003d9c;
  box-shadow: 0 1px 3px rgba(0, 61, 156, 0.15);
}
.pd-table-user-badge .user-avatar-circle {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.pd-table-user-badge .user-name {
  font-size: 12px;
  font-weight: 600;
  color: #001738;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================================
   CARD BONITO DO FUNIL NO CABEÇALHO DO NEGÓCIO
============================================================= */
.deal-pipeline-badge-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #003d9c;
  border-radius: 6px;
  padding: 4px 12px;
  box-shadow: 0 1px 3px rgba(0, 61, 156, 0.1);
  transition: all 0.18s ease;
  cursor: pointer;
}
.deal-pipeline-badge-card:hover {
  background: #f0f7ff;
  border-color: #002b66;
  box-shadow: 0 2px 8px rgba(0, 61, 156, 0.2);
}
.deal-pipeline-badge-card .pipeline-badge-icon {
  color: #003d9c;
  display: flex;
  align-items: center;
}
.deal-pipeline-badge-card .pipeline-badge-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.deal-pipeline-badge-card .pipeline-badge-kicker {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
}
.deal-pipeline-badge-card select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #001738;
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
}
.deal-pipeline-badge-card .pipeline-badge-arrow {
  font-size: 11px;
  color: #64748b;
}

/* =============================================================
   VERTICAIS EM CARTÕES INTERATIVOS
============================================================= */
.act-vert-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.82;
}
.act-vert-pill-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.act-vert-pill-btn.active {
  opacity: 1;
  border-color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* =============================================================
   GRÁFICO GANTT, CURVA S & CARGA DE TRABALHO
============================================================= */
.gantt-dashboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gantt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.gantt-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gantt-kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gantt-kpi-card .kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: #001738;
}

.gantt-kpi-card .kpi-sub {
  font-size: 11px;
  color: #94a3b8;
}

.gantt-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.gantt-scale-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.gantt-scale-btn.active {
  background: #003d9c;
  color: #ffffff;
  border-color: #003d9c;
}

.gantt-main-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.gantt-tasks-sidebar {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid #cbd5e1;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.gantt-tasks-header {
  height: 40px;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  box-sizing: border-box;
}

.gantt-timeline-area {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.gantt-timeline-header {
  height: 40px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.gantt-time-col-header {
  min-width: 44px;
  width: 44px;
  height: 100%;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #64748b;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

.gantt-time-col-header.is-today {
  background: #eff6ff;
  color: #003d9c;
  font-weight: 700;
}

.gantt-time-col-header.is-weekend {
  background: #f1f5f9;
}

.gantt-row {
  height: 34px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.gantt-task-meta-cell {
  height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  gap: 6px;
  box-sizing: border-box;
}

.gantt-task-meta-cell:hover {
  background: #f1f5f9;
}

.gantt-bar-cell {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.gantt-bar {
  position: absolute;
  height: 22px;
  border-radius: 4px;
  display: flex !important;
  align-items: center;
  padding: 0 !important;
  font-size: 10px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: grab;
  transition: box-shadow 0.15s ease;
  z-index: 5;
  box-sizing: border-box;
}

.gantt-bar:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 4;
  pointer-events: none;
}

.gantt-group-header {
  height: 28px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  box-sizing: border-box;
}

.gantt-tooltip {
  position: fixed;
  z-index: 3000;
  background: #1e293b;
  color: #ffffff;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  max-width: 340px;
  line-height: 1.4;
  display: none;
}

/* ALÇAS DE RESIZE & DRAG DAS BARRAS GANTT */
.gantt-bar {
  user-select: none;
  display: flex !important;
  align-items: center;
  padding: 0 !important;
}

.gantt-bar.is-dragging {
  opacity: 0.75;
  cursor: grabbing !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
  z-index: 20 !important;
}

.gantt-resize-handle {
  width: 9px;
  height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  cursor: col-resize;
  z-index: 6;
  transition: background 0.15s ease;
}

.gantt-resize-left {
  left: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.gantt-resize-right {
  right: 0;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.gantt-bar:hover .gantt-resize-handle {
  background: rgba(255, 255, 255, 0.35);
}

.gantt-resize-handle:hover {
  background: rgba(255, 255, 255, 0.75) !important;
}

.gantt-bar-content {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: grab;
}

.gantt-bar-content:active {
  cursor: grabbing;
}

/* DROPDOWNS E POPOVERS DE FILTROS MÚLTIPLOS DO GANTT */
.gantt-filter-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.gantt-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gantt-filter-btn:hover {
  border-color: #003d9c;
  background: #f8fafc;
}

.gantt-filter-btn.active {
  border-color: #003d9c;
  background: #eff6ff;
  color: #003d9c;
}

.gantt-filter-badge {
  background: #003d9c;
  color: #ffffff;
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 700;
}

.gantt-filter-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  width: 280px;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.gantt-filter-popover-header {
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.gantt-filter-popover-actions {
  display: flex;
  gap: 8px;
}

.gantt-filter-popover-actions button {
  background: none;
  border: none;
  font-size: 11px;
  color: #003d9c;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.gantt-filter-popover-actions button:hover {
  text-decoration: underline;
}

.gantt-filter-popover-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0;
}

.gantt-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.1s ease;
}

.gantt-filter-item:hover {
  background: #f1f5f9;
}

.gantt-filter-item input[type="checkbox"] {
  accent-color: #003d9c;
  cursor: pointer;
}

.gantt-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.gantt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.gantt-chip-remove {
  background: none;
  border: none;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.gantt-chip-clear-all {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}

.gantt-chip-clear-all:hover {
  background: #fee2e2;
}

/* MAPA DEMOGRÁFICO DE NEGÓCIOS & USINAS */
#map-container {
  width: 100%;
  height: calc(100vh - 130px);
  min-height: 580px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  background: #f1f5f9;
  z-index: 1;
}

.map-deal-popup {
  font-family: 'Archivo', sans-serif;
  line-height: 1.4;
  padding: 2px;
}

.map-deal-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #001738;
  margin-bottom: 4px;
}

.map-deal-popup-value {
  font-size: 13px;
  font-weight: 800;
  color: #003d9c;
  margin-bottom: 4px;
}

.map-deal-popup-meta {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
}

.map-deal-popup-btn {
  background: #003d9c;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: background 0.15s ease;
}

.map-deal-popup-btn:hover {
  background: #002c70;
}

/* COLUNA SEMANAL COMPILADA (ZOOM OUT) */
.gantt-week-col-header {
  min-width: 90px;
  width: 90px;
  height: 100%;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #475569;
  user-select: none;
  flex-shrink: 0;
  background: #ffffff;
}

.gantt-week-col-header.is-current-week {
  background: #eff6ff;
  color: #003d9c;
  font-weight: 700;
  border-bottom: 2px solid #003d9c;
}

/* SEPARADORES DE STATUS NO GANTT: EM ABERTO / ATRASADAS / CONCLUÍDAS */
.gantt-status-section-header {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.gantt-status-section-delayed {
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

.gantt-status-section-open {
  background: #eff6ff;
  color: #1e40af;
  border-left: 3px solid #3b82f6;
}

.gantt-status-section-done {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid #10b981;
}

/* DIVISOR REDIMENSIONÁVEL ENTRE SIDEBAR E TIMELINE */
.gantt-resizer-divider {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 30;
  background: transparent;
  transition: background 0.15s ease;
}
.gantt-resizer-divider:hover,
.gantt-resizer-divider.is-resizing {
  background: #003d9c;
}

/* SINCRONIZAÇÃO DE SCROLL DO GANTT: OCULTAR SCROLLBAR DUPLA NA SIDEBAR */
#gantt-tasks-tree::-webkit-scrollbar {
  display: none;
  width: 0;
}
#gantt-tasks-tree {
  -ms-overflow-style: none;
  scrollbar-width: none;
}



