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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0f4c75 0%, #3282b8 25%, #0f4c75 50%, #1e3a8a 75%, #0f4c75 100%);
  background-size: 400% 400%, 400% 400%, 400% 400%, 400% 400%;
  animation: oceanWave 15s ease infinite, portGlow 8s ease-in-out infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Header da página */
.page-header {
  background: white;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}


.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-ship-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.5px;
}

.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-button {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.header-button:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Animação de ondas do oceano */
@keyframes oceanWave {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Animação de brilho portuário */
@keyframes portGlow {
  0%, 100% { 
    background-position: 0% 50%, 100% 50%, 50% 50%, 0% 50%;
  }
  50% { 
    background-position: 100% 50%, 0% 50%, 0% 50%, 100% 50%;
  }
}

/* Efeito de ondas realistas na parte inferior */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 150'%3E%3Cpath d='M0,150C0,150 50,120 100,130C150,140 200,110 250,125C300,140 350,115 400,130C450,145 500,120 550,135C600,150 650,125 700,140C750,155 800,130 800,130L800,150L0,150Z' fill='%23ffffff' opacity='0.4'/%3E%3Cpath d='M0,150C0,150 30,135 60,140C90,145 120,130 150,135C180,140 210,125 240,130C270,135 300,120 330,125C360,130 390,115 420,120C450,125 480,110 510,115C540,120 570,105 600,110C630,115 660,100 690,105C720,110 750,95 780,100C800,103 800,105 800,105L800,150L0,150Z' fill='%23ffffff' opacity='0.6'/%3E%3Cpath d='M0,150C0,150 20,145 40,147C60,149 80,145 100,147C120,149 140,145 160,147C180,149 200,145 220,147C240,149 260,145 280,147C300,149 320,145 340,147C360,149 380,145 400,147C420,149 440,145 460,147C480,149 500,145 520,147C540,149 560,145 580,147C600,149 620,145 640,147C660,149 680,145 700,147C720,149 740,145 760,147C780,149 800,145 800,145L800,150L0,150Z' fill='%23ffffff' opacity='0.8'/%3E%3C/svg%3E") repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 150'%3E%3Cpath d='M0,150C0,150 40,125 80,135C120,145 160,120 200,130C240,140 280,115 320,125C360,135 400,110 440,120C480,130 520,105 560,115C600,125 600,125 600,125L600,150L0,150Z' fill='%23ffffff' opacity='0.3'/%3E%3Cpath d='M0,150C0,150 25,140 50,143C75,146 100,140 125,143C150,146 175,140 200,143C225,146 250,140 275,143C300,146 325,140 350,143C375,146 400,140 425,143C450,146 475,140 500,143C525,146 550,140 575,143C600,146 600,140 600,140L600,150L0,150Z' fill='%23ffffff' opacity='0.5'/%3E%3C/svg%3E") repeat-x;
  background-size: 800px 150px, 600px 150px;
  animation: waveMove1 20s linear infinite, waveMove2 15s linear infinite reverse;
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
  filter: blur(0.5px);
  box-shadow: 
    inset 0 10px 20px rgba(255, 255, 255, 0.1),
    0 0 30px rgba(59, 130, 246, 0.1);
}

@keyframes waveMove1 {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: -800px 0, -600px 0; }
}

@keyframes waveMove2 {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 600px 0, 800px 0; }
}

.chat-container {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(25px) saturate(180%);
  border-radius: 28px;
  width: 100%;
  max-width: 500px;
  height: 580px;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 100px rgba(59, 130, 246, 0.1);
  overflow: hidden;
  position: fixed;
  top: calc(50% + 40px);
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 5;
}

.chat-container:hover {
  transform: translate(-50%, calc(-50% - 5px));
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 120px rgba(59, 130, 246, 0.15);
}

.chat-header {
  background: 
    linear-gradient(135deg, #1e3a8a 0%, #1e40af 25%, #2563eb 50%, #1e40af 75%, #1e3a8a 100%);
  color: white;
  padding: 20px 22px;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 25px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.ship-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  animation: shipFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6)) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes shipFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg);
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6)) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  }
  50% { 
    transform: translateY(-2px) rotate(1deg);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8)) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.header-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.2;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.header-subtitle {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 2px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
}

.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

.message {
  margin-bottom: 12px;
  animation: slideInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.message.user {
  text-align: right;
}

.message.bot {
  text-align: left;
}

.message-bubble {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
  position: relative;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.2),
    0 3px 6px rgba(0, 0, 0, 0.15);
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border-bottom-right-radius: 6px;
  text-align: left;
}

.message.bot .message-bubble {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
  color: #1f2937;
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-bottom-left-radius: 6px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.message.bot .message-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: white;
  border-bottom: none;
}

.message.user .message-bubble::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-left-color: #3b82f6;
  border-bottom: none;
}

.input-area {
  padding: 16px 18px;
  background: white;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  gap: 10px;
  align-items: center;
}

#messageInput {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: #f8fafc;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  touch-action: manipulation;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.4;
  height: 44px;
  width: 100%;
  box-sizing: border-box;
}

#messageInput:focus {
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

#messageInput::placeholder {
  color: #94a3b8;
}

#sendButton {
  padding: 12px 18px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}

#sendButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

#sendButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

#sendButton:hover::before {
  left: 100%;
}

#sendButton:active {
  transform: translateY(0);
}

#sendButton:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.loading {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  animation: pulse 1.4s infinite ease-in-out;
  margin: 0 3px;
  vertical-align: middle;
}

.loading:nth-child(2) {
  animation-delay: 0.2s;
}

.loading:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.error-message {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 16px;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 12px;
  border-left: 3px solid #dc2626;
}

/* Tabelas responsivas no chat */
/* Texto introdutório da tabela */
.table-intro {
  margin: 0 0 12px 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-left: 3px solid #3b82f6;
  border-radius: 8px;
  color: #1e40af;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
}

.chart-intro {
  margin: 0 0 12px 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-left: 3px solid #8b5cf6;
  border-radius: 8px;
  color: #6d28d9;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
}

.table-container {
  overflow-x: auto;
  margin: 8px 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: white;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Cabeçalho da tabela com botão de download */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 12px 12px 0 0;
}

.table-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botão de download para CSV */
.download-csv-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.download-csv-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.4);
}

.download-csv-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.download-icon {
  font-size: 14px;
}

.download-text {
  font-size: 11px;
}

/* Feedback de download */
.download-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.download-feedback.show {
  opacity: 1;
  transform: translateX(0);
}

.feedback-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  font-size: 13px;
  font-weight: 600;
}

.feedback-icon {
  font-size: 16px;
}

.feedback-text {
  font-size: 12px;
}

.responsive-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 12px;
  min-width: 600px;
  border-radius: 12px;
  overflow: hidden;
}

.responsive-table th {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  border: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.responsive-table td {
  padding: 10px;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  line-height: 1.4;
  vertical-align: top;
  transition: background-color 0.2s ease;
}

.responsive-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.responsive-table tr:hover {
  background-color: #f1f5f9;
}

.responsive-table tr:hover td {
  background-color: #f1f5f9;
}

/* Mensagem de erro para tabelas */
.table-error {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #dc2626;
  font-size: 12px;
  margin: 8px 0;
  text-align: center;
}

/* Status específicos com cores */
.responsive-table td:last-child {
  font-weight: 600;
}

/* Classes de status com cores específicas */
.status-completo {
  color: #059669 !important;
  background-color: rgba(5, 150, 105, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(5, 150, 105, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-pendente {
  color: #d97706 !important;
  background-color: rgba(217, 119, 6, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(217, 119, 6, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-cancelado {
  color: #dc2626 !important;
  background-color: rgba(220, 38, 38, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-incompleto {
  color: #dc2626 !important;
  background-color: rgba(220, 38, 38, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-problema {
  color: #dc2626 !important;
  background-color: rgba(220, 38, 38, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(220, 38, 38, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-aguardando {
  color: #7c3aed !important;
  background-color: rgba(124, 58, 237, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 600;
  border: 1px solid rgba(124, 58, 237, 0.3);
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

/* ==================== SISTEMA DE GRÁFICOS ==================== */

/* Container do gráfico */
.chart-container {
  margin: 12px 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: white;
  border: 1px solid rgba(59, 130, 246, 0.1);
  overflow: hidden;
}

/* Cabeçalho do gráfico com botão de download */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.chart-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botão de download para PNG */
.download-chart-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.download-chart-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.download-chart-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.download-icon {
  font-size: 14px;
}

.download-text {
  font-size: 12px;
  font-weight: 600;
}

/* Wrapper do canvas do gráfico */
.chart-wrapper {
  padding: 10px; /* Margens menores */
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  max-height: 800px; /* Limitar altura máxima */
  overflow: auto; /* Scroll se necessário */
  width: 100%;
}

/* Canvas do gráfico */
.chart-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  width: auto; /* Permitir largura automática baseada no conteúdo */
}

/* Responsividade dos gráficos */
@media (max-width: 768px) {
  .chart-wrapper {
    padding: 8px; /* Margens ainda menores */
    min-height: 350px;
    max-height: 700px;
  }
  
  .chart-canvas {
    width: 100%;
    max-width: 500px;
  }
  
  .chart-title {
    font-size: 13px;
  }
  
  .download-chart-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .chart-wrapper {
    padding: 5px; /* Margens mínimas */
    min-height: 300px;
    max-height: 700px; /* Mais espaço para legenda abaixo */
  }
  
  .chart-canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  
  .chart-header {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .chart-title {
    font-size: 12px;
    flex: 1 1 100%;
    text-align: center;
  }
  
  .download-chart-btn {
    margin: 0 auto;
  }
  
  .download-text {
    display: none; /* Ocultar texto em telas pequenas */
  }
}

/* ==================== FIM DO SISTEMA DE GRÁFICOS ==================== */

/* Responsividade para diferentes dispositivos */

/* Desktop Large (1440px+) */
@media (min-width: 1440px) {
  .chat-container {
    max-width: 600px;
    height: 650px;
  }
  
  .header-content {
    max-width: 1400px;
  }
  
  .page-title {
    font-size: 36px;
  }
  
  .page-ship-logo {
    width: 55px;
    height: 55px;
  }
}

/* Desktop Standard (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .chat-container {
    max-width: 500px;
    height: 580px;
  }
  
  .header-content {
    max-width: 1200px;
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .page-title {
    font-size: 28px;
  }
  
  .page-ship-logo {
    width: 45px;
    height: 45px;
  }
  
  .header-content {
    padding: 0 20px;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-section {
    gap: 3px;
  }
  
  .header-buttons {
    gap: 8px;
  }
  
  .header-button {
    padding: 11px 18px;
    font-size: 13px;
  }
  
  .chat-container {
    max-width: 450px;
    height: 550px;
    margin: 20px auto;
  }
  
  .chat-header {
    padding: 18px 20px;
    font-size: 16px;
  }
  
  .header-title {
    font-size: 18px;
  }
  
  .header-subtitle {
    font-size: 11px;
  }
  
  .messages {
    padding: 15px 18px;
  }
  
  .input-area {
    padding: 15px 18px;
  }
  
  .message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* Tablet Portrait (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .page-header {
    padding: 18px 0;
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .page-ship-logo {
    width: 40px;
    height: 40px;
  }
  
  .header-content {
    padding: 0 15px;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-section {
    gap: 5px;
  }
  
  .header-buttons {
    gap: 6px;
  }
  
  .header-button {
    padding: 10px 14px;
    font-size: 12px;
  }
  
  .chat-container {
    max-width: 400px;
    height: 500px;
    margin: 15px auto;
  }
  
  .chat-header {
    padding: 16px 18px;
    font-size: 15px;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .header-subtitle {
    font-size: 10px;
  }
  
  .ship-logo {
    width: 44px;
    height: 44px;
  }
  
  .messages {
    padding: 14px 16px;
  }
  
  .input-area {
    padding: 14px 16px;
  }
  
  .message-bubble {
    max-width: 80%;
    padding: 11px 15px;
    font-size: 13px;
  }
}

/* Samsung Galaxy S24 Ultra e similares (360px - 430px) */
@media (min-width: 360px) and (max-width: 430px) {
  .page-header {
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }
  
  .page-title {
    font-size: 17px;
  }
  
  .page-ship-logo {
    width: 30px;
    height: 30px;
  }
  
  .header-content {
    padding: 0 12px;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-section {
    gap: 4px;
  }
  
  .header-buttons {
    gap: 6px;
  }
  
  .header-button {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .chat-container {
    height: calc(100vh - 160px);
    border-radius: 20px;
    max-width: 92vw;
    width: 92vw;
    max-height: calc(100vh - 160px);
    top: calc(50% + 30px);
  }
  
  .chat-header {
    padding: 14px 16px;
    font-size: 15px;
    justify-content: center;
    text-align: center;
  }
  
  .messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
  }
  
  .input-area {
    flex-shrink: 0;
    padding: 12px 14px;
  }
  
  .header-title {
    font-size: 15px;
    text-align: center;
  }
  
  .header-subtitle {
    font-size: 10px;
    text-align: center;
  }
  
  .ship-logo {
    width: 42px;
    height: 42px;
  }
  
  .message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 13px;
  }
  
  #messageInput {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
    max-height: 100px;
    height: 40px;
  }
  
  #sendButton {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  /* Tabelas responsivas para Galaxy S24 Ultra */
  .responsive-table {
    font-size: 10px;
    min-width: 500px;
  }
  
  .responsive-table th {
    padding: 6px 4px;
    font-size: 9px;
  }
  
  .responsive-table td {
    padding: 4px;
    font-size: 9px;
  }
  
  /* Cabeçalho e botão para Galaxy S24 Ultra */
  .table-header {
    padding: 8px 12px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  
  .table-title {
    font-size: 12px;
    justify-content: center;
  }
  
  .download-csv-btn {
    padding: 6px 10px;
    font-size: 11px;
    justify-content: center;
  }
  
  .download-text {
    font-size: 10px;
  }
}

/* Xiaomi Poco X7 Pro e similares (390px - 480px) */
@media (min-width: 390px) and (max-width: 480px) {
  /* Tabelas responsivas para Xiaomi Poco X7 Pro */
  .responsive-table {
    font-size: 11px;
    min-width: 550px;
  }
  
  .responsive-table th {
    padding: 8px 6px;
    font-size: 10px;
  }
  
  .responsive-table td {
    padding: 6px;
    font-size: 10px;
  }
  
  /* Cabeçalho e botão para Xiaomi Poco X7 Pro */
  .table-header {
    padding: 10px 14px;
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }
  
  .table-title {
    font-size: 13px;
    justify-content: flex-start;
  }
  
  .download-csv-btn {
    padding: 7px 11px;
    font-size: 11px;
    justify-content: center;
  }
  
  .download-text {
    font-size: 10px;
  }
  .page-header {
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .page-ship-logo {
    width: 32px;
    height: 32px;
  }
  
  .header-content {
    padding: 0 12px;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-section {
    gap: 4px;
  }
  
  .header-buttons {
    gap: 6px;
  }
  
  .header-button {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  .chat-container {
    height: calc(100vh - 160px);
    border-radius: 20px;
    max-width: 92vw;
    width: 92vw;
    max-height: calc(100vh - 160px);
    top: calc(50% + 30px);
  }
  
  .chat-header {
    padding: 14px 16px;
    font-size: 15px;
    justify-content: center;
    text-align: center;
  }
  
  .messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
  }
  
  .input-area {
    flex-shrink: 0;
    padding: 12px 14px;
  }
  
  .header-title {
    font-size: 15px;
    text-align: center;
  }
  
  .header-subtitle {
    font-size: 10px;
    text-align: center;
  }
  
  .ship-logo {
    width: 42px;
    height: 42px;
  }
  
  .message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 13px;
  }
  
  #messageInput {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 42px;
    max-height: 110px;
    height: 42px;
  }
  
  #sendButton {
    padding: 10px 16px;
    font-size: 12px;
  }
}

/* iPhone e Android Large (376px - 389px) */
@media (min-width: 376px) and (max-width: 389px) {
  .page-header {
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }
  
  
  .page-title {
    font-size: 20px;
  }
  
  .page-ship-logo {
    width: 35px;
    height: 35px;
  }
  
  .header-content {
    padding: 0 12px;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo-section {
    gap: 4px;
  }
  
  .header-buttons {
    gap: 5px;
  }
  
  .header-button {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  
  .chat-container {
    height: calc(100vh - 180px);
    border-radius: 0;
    max-width: 95vw;
    width: 95vw;
    max-height: calc(100vh - 180px);
    top: calc(50% + 40px);
  }
  
  .chat-header {
    padding: 12px 16px;
    font-size: 14px;
    justify-content: center;
    text-align: center;
  }
  
  .messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  
  .input-area {
    flex-shrink: 0;
    padding: 12px 16px;
  }
  
  .header-title {
    font-size: 14px;
    text-align: center;
  }
  
  .header-subtitle {
    font-size: 9px;
    text-align: center;
  }
  
  .ship-logo {
    width: 38px;
    height: 38px;
  }
  
  .messages {
    padding: 12px 14px;
  }
  
  .input-area {
    padding: 12px 14px;
  }
  
  .message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 12px;
  }
  
  #messageInput {
    padding: 10px 14px;
    font-size: 12px;
    min-height: 40px;
    max-height: 100px;
    height: 40px;
  }
  
  #sendButton {
    padding: 10px 16px;
    font-size: 12px;
  }
}

/* iPhone e Android Small (320px - 375px) */
@media (max-width: 375px) {
  /* Tabelas responsivas para mobile pequeno */
  .responsive-table {
    font-size: 9px;
    min-width: 450px;
  }
  
  .responsive-table th {
    padding: 4px 2px;
    font-size: 8px;
  }
  
  .responsive-table td {
    padding: 3px;
    font-size: 8px;
  }
  
  /* Cabeçalho e botão para mobile pequeno */
  .table-header {
    padding: 6px 10px;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }
  
  .table-title {
    font-size: 11px;
    justify-content: center;
  }
  
  .download-csv-btn {
    padding: 5px 8px;
    font-size: 10px;
    justify-content: center;
  }
  
  .download-text {
    font-size: 9px;
  }
  .page-header {
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
  }
  
  
  .page-title {
    font-size: 18px;
  }
  
  .page-ship-logo {
    width: 32px;
    height: 32px;
  }
  
  .header-content {
    padding: 0 10px;
    flex-direction: column;
    gap: 10px;
  }
  
  .logo-section {
    gap: 3px;
  }
  
  .header-buttons {
    gap: 4px;
    justify-content: center;
    width: 100%;
  }
  
  .header-button {
    padding: 8px 10px;
    font-size: 10px;
    flex: 1;
    text-align: center;
  }
  
  
  .chat-container {
    height: calc(100vh - 180px);
    border-radius: 0;
    max-width: 95vw;
    width: 95vw;
    max-height: calc(100vh - 180px);
    top: calc(50% + 40px);
  }
  
  .chat-header {
    padding: 10px 14px;
    font-size: 13px;
    justify-content: center;
    text-align: center;
  }
  
  .messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px;
  }
  
  .input-area {
    flex-shrink: 0;
    padding: 10px 12px;
  }
  
  .header-title {
    font-size: 13px;
    text-align: center;
  }
  
  .header-subtitle {
    font-size: 8px;
    text-align: center;
  }
  
  .ship-logo {
    width: 34px;
    height: 34px;
  }
  
  .messages {
    padding: 10px 12px;
  }
  
  .input-area {
    padding: 10px 12px;
    gap: 8px;
  }
  
  .message-bubble {
    max-width: 90%;
    padding: 9px 12px;
    font-size: 11px;
  }
  
  #messageInput {
    padding: 8px 12px;
    font-size: 11px;
    min-height: 36px;
    max-height: 80px;
    height: 36px;
  }
  
  #sendButton {
    padding: 8px 14px;
    font-size: 11px;
  }
  
  /* Ajustes para partículas em telas pequenas */
  .particle {
    width: 3px;
    height: 3px;
  }
  
  .floating-particles {
    opacity: 0.7;
  }
}

/* Telas muito altas (Xiaomi Poco X7 Pro, Samsung Galaxy S24 Ultra, etc.) */
@media (min-height: 2000px) {
  .chat-container {
    height: 600px;
    max-height: 600px;
    top: calc(50% + 20px);
  }
  
  .messages {
    max-height: 450px;
    padding: 16px 18px;
  }
  
  .page-header {
    padding: 16px 0;
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .page-ship-logo {
    width: 40px;
    height: 40px;
  }
  
  .header-title {
    font-size: 18px;
  }
  
  .header-subtitle {
    font-size: 12px;
  }
  
  .ship-logo {
    width: 50px;
    height: 50px;
  }
  
  .message-bubble {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  #messageInput {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  #sendButton {
    font-size: 14px;
    padding: 12px 18px;
  }
}

/* Landscape Orientation para mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .page-header {
    padding: 8px 0;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .page-ship-logo {
    width: 28px;
    height: 28px;
  }
  
  .header-button {
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .chat-container {
    height: calc(100vh - 50px);
    margin: 5px;
  }
  
  .chat-header {
    padding: 10px 14px;
    font-size: 12px;
  }
  
  .header-title {
    font-size: 12px;
  }
  
  .header-subtitle {
    font-size: 8px;
  }
  
  .ship-logo {
    width: 30px;
    height: 30px;
  }
  
  .messages {
    padding: 8px 12px;
  }
  
  .input-area {
    padding: 8px 12px;
  }
  
  .message-bubble {
    padding: 8px 12px;
    font-size: 11px;
  }
}


/* Efeito de partículas flutuantes */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: floatParticle 8s infinite linear;
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(100px);
    opacity: 0;
  }
}
