/* ==========================================================================
   BÚSSOLA SOCIAL — ESTILOS CORPORATIVOS PETROBRAS DE ALTA FIDELIDADE
   ========================================================================== */

:root {
  --primary: #008542;
  --primary-dark: #006834;
  --primary-light: #e6f4ed;
  --secondary: #005691;
  --secondary-light: #e6f0f7;
  --yellow: #f59e0b;
  --yellow-dark: #d97706;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Top Header Bar */
header {
  background: linear-gradient(135deg, #004d25 0%, #008542 60%, #005691 100%);
  color: #ffffff;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: #ffffff;
  color: #008542;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-title p {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Badges e Status de Alto Contraste */
.live-badge,
.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Cores de Alto Contraste para Estágios */
.badge-finalizado,
.badge-concluido,
.status-finalizado {
  background-color: #008542 !important;
  color: #ffffff !important;
}

.badge-execucao,
.status-execucao {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.badge-avaliacao,
.badge-formalizacao,
.badge-alteracao,
.status-avaliacao {
  background-color: #d97706 !important;
  color: #ffffff !important;
}

.badge-inelegivel,
.badge-reprovado,
.status-reprovado {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 2rem 0.5rem 2rem;
}

.kpi-card {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.35rem 0;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

/* Global Filter Controls Bar */
.filter-bar {
  padding: 0.75rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.select-input, .select-input-sm {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.select-input:hover, .select-input:focus {
  border-color: var(--primary);
}

.select-input-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.search-input {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
}

/* Navigation Tabs Bar */
.nav-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 1rem 2rem 0 2rem;
  overflow-x: auto;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-main);
}

.tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-bottom: none;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
  font-weight: 700;
}

/* Tab Content Panels */
.content-area {
  padding: 1.5rem 2rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Layout Grids */
.grid-container {
  display: grid;
  gap: 1.5rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-mapa { grid-template-columns: 2fr 1fr; }

@media (max-width: 1024px) {
  .grid-2, .grid-mapa { grid-template-columns: 1fr; }
}

/* Panel Box Container */
.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  margin-bottom: 1rem;
}

.panel-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.panel-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Charts and Map Div Containers */
.chart-box {
  width: 100%;
  height: 340px;
}

#mapa-container {
  width: 100%;
  height: 480px;
  border-radius: var(--radius-sm);
  z-index: 1;
}

/* Controls and Legends for Graphs */
.graph-control-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f1f5f9;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.graph-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.graph-legend-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.legend-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-btn {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.legend-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.legend-btn.off {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #cbd5e1 !important;
  border-left-color: #cbd5e1 !important;
  text-decoration: line-through;
  opacity: 0.55;
  box-shadow: none;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
}

.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

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

.table-scroll-container {
  max-height: 480px;
  overflow-y: auto;
}

/* Card Status List & Summaries */
.card-status-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-summary-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  background: #f8fafc;
}

.status-summary-card.green { border-left-color: #008542; }
.status-summary-card.yellow { border-left-color: #f59e0b; }
.status-summary-card.blue { border-left-color: #2563eb; }

.status-summary-card h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.status-summary-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dedicated Full-Page Chatbot Panel Styling (Aba 10) */
.chat-tab-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 560px;
  padding: 0;
  overflow: hidden;
}

.chat-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #004d25 0%, #008542 100%);
  color: #ffffff;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.chat-tab-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-avatar-lg {
  width: 40px;
  height: 40px;
  background: #ffffff;
  color: #008542;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.chat-tab-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.chat-tab-title p {
  font-size: 0.78rem;
  opacity: 0.9;
}

.chat-tab-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.35);
}

.chat-tab-history {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  max-width: 80%;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.chat-message.assistant-msg {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.chat-message.user-msg {
  align-self: flex-end;
  background: #008542;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-chips-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
}

.chat-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.chat-tab-input-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}

.chat-tab-input-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
}

.chat-tab-input-bar input:focus {
  border-color: var(--primary);
}

.btn-primary-chat {
  background: #008542;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary-chat:hover {
  background: #006834;
}

/* Badge de Projeto em Destaque no Chat */
.badge-projeto-pill {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 11px;
}
