/* ===== VARIÁVEIS E RESET ===== */
:root {
  --bg-primary: #0b1220;
  --glass-base: rgba(255, 255, 255, 0.08);
  --glass-light: rgba(255, 255, 255, 0.06);
  --glass-lighter: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.12);
  
  --border-light: rgba(255, 255, 255, 0.12);
  --border-lighter: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.6);
  
  --text-primary: #e5e7eb;
  --text-secondary: rgba(229, 231, 235, 0.85);
  --text-muted: rgba(229, 231, 235, 0.74);
  --text-disabled: rgba(229, 231, 235, 0.6);
  
  --gradient-brand: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-kpi: linear-gradient(135deg, #34d399, #60a5fa);
  
  --shadow-primary: rgba(59, 130, 246, 0.18);
  --shadow-focus: rgba(16, 185, 129, 0.14);
  
  --radius-card: 18px;
  --radius-sm: 14px;
  --radius-xs: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===== FUNDO E LAYOUT BASE ===== */
body {
  background: 
    radial-gradient(1000px 600px at 15% 10%, rgba(16, 185, 129, 0.18), transparent 60%),
    radial-gradient(900px 600px at 90% 20%, rgba(59, 130, 246, 0.14), transparent 55%),
    radial-gradient(900px 600px at 40% 110%, rgba(168, 85, 247, 0.14), transparent 55%),
    var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== COMPONENTES BASE ===== */
.card,
.table,
.alert {
  border: 1px solid var(--border-light) !important;
}

.card {
  background: var(--glass-base) !important;
  backdrop-filter: blur(10px);
  border-radius: var(--radius-card);
  transition: all 0.2s ease;
}

.card:hover {
  background: var(--glass-hover) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ===== NAVBAR ===== */
.navbar {
  border-bottom: 1px solid var(--border-lighter) !important;
  backdrop-filter: blur(8px);
}

.navbar .brand-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #06281f;
  font-weight: 900;
  transition: transform 0.2s ease;
}

.navbar .brand-badge:hover {
  transform: scale(1.05);
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--text-secondary) !important;
  transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--text-primary) !important;
}

.navbar-dark .navbar-nav .nav-link.active {
  color: white !important;
  font-weight: 600;
}

/* ===== HERO E CARDS ESPECIAIS ===== */
.brand-hero {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #06281f;
  font-weight: 900;
  font-size: 26px;
  transition: transform 0.3s ease;
}

.brand-hero:hover {
  transform: rotate(5deg) scale(1.05);
}

.card-glass {
  background: var(--glass-light) !important;
}

/* ===== TIPOGRAFIA ===== */
.text-muted {
  color: var(--text-muted) !important;
}

.small,
.form-text {
  color: var(--text-secondary) !important;
}

.form-label {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.display-1, .display-2, .display-3, .display-4,
h1, h2, h3, h4, h5, h6 {
  color: white;
  letter-spacing: -0.02em;
}

/* ===== FORMULÁRIOS ===== */
.form-control,
.form-select {
  background: var(--glass-light) !important;
  color: white !important;
  border: 1px solid var(--border-lighter) !important;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  transition: all 0.2s ease;
}

.form-control:hover,
.form-select:hover {
  background: var(--glass-base) !important;
}

.form-control:focus,
.form-select:focus {
  background: var(--glass-base) !important;
  color: white !important;
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 0.25rem var(--shadow-focus) !important;
}

textarea::placeholder,
input::placeholder {
  color: var(--text-disabled) !important;
  font-weight: 400;
}

/* ===== TABELAS ===== */
.table {
  color: var(--text-primary) !important;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--glass-lighter) !important;
  color: white !important;
  border-color: var(--border-lighter) !important;
  font-weight: 600;
  padding: 1rem;
}

.table tbody td {
  border-color: var(--border-lighter) !important;
  padding: 1rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--glass-light) !important;
  transition: background 0.2s ease;
}

/* ===== ALERTAS ===== */
.alert {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--bg-primary) !important;
  font-weight: 600;
  border: none !important;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
}

.alert-warning {
  background: linear-gradient(135deg, #fed7aa, #fdba74) !important;
}

/* ===== KPI CARDS ===== */
.kpi-card {
  background: var(--glass-base) !important;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  background: var(--glass-hover) !important;
  transform: translateY(-4px);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-kpi);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== INDICADORES ===== */
.indicator-field {
  background: var(--glass-light) !important;
  border: 1px solid var(--border-lighter) !important;
  border-radius: var(--radius-card);
  padding: 1rem;
  transition: all 0.2s ease;
}

.indicator-field:hover {
  background: var(--glass-base) !important;
  border-color: var(--border-light) !important;
}

/* ===== BOTÕES ===== */
.btn {
  border-radius: var(--radius-xs) !important;
  padding: 0.6rem 1.5rem !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  border: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 8px 16px var(--shadow-primary) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 20px var(--shadow-primary) !important;
}

.btn-outline-secondary,
.btn-outline-primary {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-2px);
}

/* ===== LINKS ===== */
a {
  color: #93c5fd;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #bfdbfe;
  text-decoration: underline;
  text-decoration-color: rgba(147, 197, 253, 0.3);
  text-underline-offset: 4px;
}

/* ===== GRÁFICOS ===== */
canvas {
  image-rendering: auto;
  max-width: 100%;
  height: auto !important;
  border-radius: var(--radius-sm);
}

/* ===== UTILITÁRIOS ===== */
.glass-effect {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .kpi-value {
    font-size: 1.75rem;
  }
  
  .brand-hero {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
  
  .table {
    display: block;
    overflow-x: auto;
  }
}