/* ============================================================
   M&E PASSAGENS AÉREAS · DESIGN SYSTEM & KANBAN FLUIDO (TRELLO STYLE)
   Aéreas com milhas · Inteligência que te leva mais longe
   Fonte da verdade: DESIGN.md (Versão 07)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Cores de Marca Oficiais */
  --navy: #0D1B2A;
  --navy-900: #070F18;
  --navy-700: #1B2B3D;
  --petrol: #0E5F6E;
  --petrol-600: #0B4E5B;
  --petrol-100: #E3F0F2;
  --gold: #C9A227;
  --gold-600: #A88620;
  --gold-100: #F7F0D9;
  --paper: #F7F7F5;
  --white: #FFFFFF;
  --graphite: #3A3F44;
  --gray-light: #E6E8EB;

  /* Semânticas */
  --success: #1F7A4D;
  --warning: #C9A227;
  --danger: #B3261E;
  --info: #0E5F6E;

  /* Tipografia */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Espaçamentos e Raios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(13, 27, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(13, 27, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(13, 27, 42, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR NAVEGAÇÃO */
.app-sidebar {
  width: 270px;
  background-color: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.brand-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-monogram {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--petrol) 0%, var(--navy-900) 100%);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.2);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
  margin: 0;
}

.brand-info p {
  font-size: 10px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 18px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.nav-item.active {
  background-color: var(--petrol);
  color: var(--white);
  border-color: rgba(201, 162, 39, 0.3);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--gold);
}

.nav-badge {
  margin-left: auto;
  background-color: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.nav-badge.danger {
  background-color: var(--danger);
  color: var(--white);
}

.sidebar-user {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--petrol);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  border: 1.5px solid var(--gold);
}

.user-meta h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.user-meta span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* CONTEÚDO PRINCIPAL */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--paper);
}

/* TOPBAR */
.app-topbar {
  height: 68px;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-light);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
}

.topbar-title-wrap p {
  font-size: 12px;
  color: var(--graphite);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  background-color: var(--petrol);
  color: var(--white);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background-color: var(--petrol-600);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-gold {
  background-color: var(--gold);
  color: var(--navy);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-gold:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  color: var(--navy);
  border: 1px solid var(--gray-light);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-outline:hover {
  background-color: var(--gray-light);
}

/* CORPO DO CRM */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* CARDS DE MÉTRICAS RÁPIDAS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--white);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info span {
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
}

.stat-info h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-blue { background-color: var(--petrol-100); color: var(--petrol); }
.icon-gold { background-color: var(--gold-100); color: var(--gold-600); }
.icon-green { background-color: rgba(31, 122, 77, 0.1); color: var(--success); }
.icon-purple { background-color: rgba(13, 27, 42, 0.08); color: var(--navy); }

/* ============================================================
   KANBAN TRELLO STYLE (FLUIDO COM OVERFLOW HORIZONTAL)
   ============================================================ */

.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 20px;
  align-items: flex-start;
  min-height: calc(100vh - 290px);
  scroll-behavior: smooth;
  cursor: default;
}

.kanban-board::-webkit-scrollbar {
  height: 10px;
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 8px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.kanban-col {
  min-width: 295px;
  width: 295px;
  flex-shrink: 0;
  background-color: #EBECF0;
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), border-color 0.2s;
}

.kanban-col.drag-over {
  background-color: #E2E8F0;
  border: 1.5px dashed var(--petrol);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  user-select: none;
}

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.c-blue { background-color: var(--petrol); }
.c-gold { background-color: var(--gold); }
.c-orange { background-color: #D97706; }
.c-purple { background-color: var(--navy); }
.c-green { background-color: var(--success); }
.c-red { background-color: var(--danger); }

.kanban-col-header h4 {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.col-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--graphite);
  background: var(--white);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 120px;
}

/* ============================================================
   CARD DE COTAÇÃO COM FLUIDEZ TOTAL (ESTILO TRELLO)
   ============================================================ */

.quote-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(9, 30, 66, 0.08);
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.12);
  padding: 14px;
  cursor: grab;
  user-select: none;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.18s, opacity 0.15s;
}

.quote-card:hover {
  box-shadow: 0 4px 14px rgba(9, 30, 66, 0.16);
  transform: translateY(-2px);
  border-color: rgba(14, 95, 110, 0.3);
}

.quote-card:active {
  cursor: grabbing;
}

/* ESTADO AO ARRASTAR (IGUAL TRELLO) */
.quote-card.dragging {
  opacity: 0.35 !important;
  transform: rotate(2.5deg) scale(0.97) !important;
  box-shadow: 0 16px 32px rgba(9, 30, 66, 0.25) !important;
  border: 1.5px dashed var(--petrol) !important;
}

/* PLACEHOLDER VISUAL DE ONDE O CARD VAI CAIR */
.kanban-drop-placeholder {
  background: rgba(14, 95, 110, 0.08);
  border: 2px dashed var(--petrol);
  border-radius: var(--radius-md);
  margin: 6px 0;
  min-height: 80px;
  pointer-events: none;
  animation: pulseGhost 1s infinite alternate;
}

@keyframes pulseGhost {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.quote-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.passenger-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--navy);
}

.passenger-phone {
  font-size: 11px;
  color: var(--graphite);
}

.badge-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.tag-flight { background-color: var(--petrol-100); color: var(--petrol); }
.tag-issued { background-color: rgba(31, 122, 77, 0.12); color: var(--success); }
.tag-expired { background-color: rgba(179, 38, 30, 0.12); color: var(--danger); }

/* ROTA AÉREA */
.flight-route {
  background-color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  border: 1px dashed var(--gray-light);
}

.airport-box {
  text-align: center;
}

.iata-code {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.city-name {
  font-size: 10px;
  color: var(--graphite);
  text-transform: uppercase;
}

.plane-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--gold);
}

.flight-dates {
  font-size: 11.5px;
  color: var(--graphite);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.quote-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-light);
  padding-top: 8px;
  margin-top: 8px;
}

.quote-value {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--petrol);
}

.economy-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--success);
  background-color: rgba(31, 122, 77, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* BOTÃO DE ADICIONAR NOVA COLUNA (ESTILO TRELLO) */
.btn-add-column {
  min-width: 270px;
  width: 270px;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(13, 27, 42, 0.18);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.btn-add-column:hover {
  background-color: var(--white);
  border-color: var(--petrol);
  color: var(--petrol);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* TOAST NOTIFICAÇÃO FLUIDA */
.kanban-toast {
  position: fixed;
  bottom: 24px;
  right: 28px;
  background-color: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   VIEWS DOS DEMAIS MÓDULOS
   ============================================================ */

.module-view {
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. CENTRAL DE ATENDIMENTO (CHATS) */
.chat-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 160px);
  background-color: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-sidebar {
  border-right: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
}

.chat-status-bar {
  padding: 14px 16px;
  background-color: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-status-text {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.chat-item:hover, .chat-item.active {
  background-color: var(--petrol-100);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--petrol);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-info-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.chat-info-top h5 {
  font-size: 13.5px;
  color: var(--navy);
  margin: 0;
}

.chat-info-top span {
  font-size: 11px;
  color: var(--graphite);
}

.chat-preview {
  font-size: 12px;
  color: var(--graphite);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-conversation {
  display: flex;
  flex-direction: column;
  background-color: #ECE5DD;
  background-image: radial-gradient(#D4CEBA 1px, transparent 1px);
  background-size: 20px 20px;
}

.conversation-header {
  padding: 14px 20px;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  position: relative;
  line-height: 1.4;
}

.msg-in {
  align-self: flex-start;
  background-color: var(--white);
  color: var(--navy);
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.msg-out {
  align-self: flex-end;
  background-color: #D9FDD3;
  color: #111B21;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.audio-box {
  background-color: rgba(14, 95, 110, 0.08);
  border-left: 3px solid var(--petrol);
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 6px;
  font-size: 12px;
}

.chat-input-bar {
  padding: 12px 20px;
  background-color: #F0F2F5;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-input-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #E0E0E0;
  border-radius: var(--radius-pill);
  outline: none;
  font-size: 13.5px;
}

/* 2. TABELAS DE DADOS (Propostas, Anúncios, Sem Resposta, Produtos) */
.data-table-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.table-header-box h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background-color: var(--paper);
  color: var(--graphite);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-light);
}

.custom-table td {
  padding: 14px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-light);
  color: var(--navy);
}

.custom-table tr:hover {
  background-color: rgba(247, 247, 245, 0.6);
}

/* BADGES DE STATUS */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.pill-success { background-color: rgba(31, 122, 77, 0.12); color: var(--success); }
.pill-warning { background-color: rgba(201, 162, 39, 0.15); color: #9E7D17; }
.pill-danger { background-color: rgba(179, 38, 30, 0.12); color: var(--danger); }
.pill-petrol { background-color: var(--petrol-100); color: var(--petrol); }

/* QR CODE MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(13, 27, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-light);
  text-align: center;
}
