/* Básico e grid */
.md-wrapper { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  padding: 24px;
  font-size: 16px;
  line-height: 1.6;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

.md-wrapper::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.md-wrapper > * {
  position: relative;
  z-index: 1;
}

/* Cabeçalho do Dashboard */
.md-header {
  margin-bottom: 40px;
  padding: 40px 36px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(248, 250, 252, 0.95) 100%);
  border-radius: 24px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.md-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #10B981, #F59E0B, #EF4444);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.md-title {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 50%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 16px 0;
  line-height: 1.1;
  letter-spacing: -1px;
  position: relative;
  text-shadow: 0 4px 30px rgba(59, 130, 246, 0.3);
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

.md-subtitle {
  font-size: 17px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

/* Wrapper de Filtros */
.md-filters-wrapper {
  margin-bottom: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-radius: 20px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.md-filters-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    #3B82F6 0%, 
    #10B981 25%, 
    #F59E0B 50%, 
    #EF4444 75%, 
    #3B82F6 100%);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  opacity: 0.8;
}

.md-filters-wrapper:hover {
  box-shadow: 
    0 12px 20px -3px rgba(0, 0, 0, 0.12),
    0 6px 10px -2px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.md-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px 28px 20px 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(226, 232, 240, 0.6);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.md-filters-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.md-collapse-btn {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.12) 0%, 
    rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #475569;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
  position: relative;
  overflow: hidden;
}

.md-collapse-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  transition: left 0.5s ease;
}

.md-collapse-btn:hover {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.25) 0%, 
    rgba(16, 185, 129, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-3px);
  box-shadow: 
    0 6px 16px rgba(59, 130, 246, 0.3),
    0 2px 8px rgba(16, 185, 129, 0.2);
  color: #1e293b;
}

.md-collapse-btn:hover::before {
  left: 100%;
}

.md-collapse-btn:active {
  transform: translateY(-1px);
}

.md-filters-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.md-filters-content.collapsed {
  display: none;
}

.md-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.md-filter-section {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  padding: 18px 24px 12px;
  background: rgba(248, 250, 252, 0.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.md-filter-section + .md-filter-section {
  margin-top: 12px;
}

.md-filter-section-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.md-filter-section-label span {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.md-filter-section-label small {
  font-size: 13px;
  color: #64748b;
}

.md-filter-section-actions {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.02);
}

.md-filter-section-actions .md-filters-row {
  grid-template-columns: 1fr;
}

.md-section { 
  margin: 48px 0;
  animation: fadeInUp 0.6s ease-out;
}

.md-section:nth-child(1) { animation-delay: 0s; }
.md-section:nth-child(2) { animation-delay: 0.1s; }
.md-section:nth-child(3) { animation-delay: 0.2s; }
.md-section:nth-child(4) { animation-delay: 0.3s; }
.md-section:nth-child(5) { animation-delay: 0.4s; }

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

.card { 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  padding: 32px; 
  border-radius: 20px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(59, 130, 246, 0.4) 25%, 
    rgba(16, 185, 129, 0.4) 50%, 
    rgba(59, 130, 246, 0.4) 75%, 
    transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px 20px 0 0;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 25px 30px -5px rgba(0, 0, 0, 0.15),
    0 15px 15px -5px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.4);
}

.card:hover::before {
  transform: translateX(100%);
}

.card:hover::after {
  opacity: 1;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin: 0 0 4px 0;
}

.card-heading h3 {
  margin: 0;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions .button,
.card-actions .button-secondary {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-actions .button:hover,
.card-actions .button-secondary:hover {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 20px rgba(59, 130, 246, 0.3),
    0 4px 8px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.card-actions .button:active,
.card-actions .button-secondary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.row-2 { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 24px; 
  animation: fadeInUp 0.6s ease-out;
}

.md-subsection {
  margin-bottom: 32px;
}

.md-subsection:last-child {
  margin-bottom: 0;
}

.row-4 { 
  display: grid; 
  grid-template-columns: repeat(4, minmax(0,1fr)); 
  gap: 20px; 
}

.md-kpis { 
  display: grid; 
  grid-template-columns: repeat(3, minmax(0,1fr)); 
  gap: 24px; 
  animation: fadeInUp 0.8s ease-out;
}

.kpi { 
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #1e293b;
  border-radius: 20px; 
  padding: 32px 28px; 
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 20px;
}

.kpi::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.kpi:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 
    0 25px 30px -5px rgba(0, 0, 0, 0.15),
    0 15px 15px -5px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.5);
}

.kpi:hover::before {
  opacity: 1;
}

.kpi:hover::after {
  opacity: 1;
}

/* Ícones temáticos para cada KPI */
.kpi[data-kpi="total"]::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.kpi[data-kpi="concluidas"]::before {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.08) 100%);
}

.kpi[data-kpi="taxa"]::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
}

.kpi[data-kpi="nota"]::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
}

.kpi[data-kpi="tempo"]::before {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(219, 39, 119, 0.08) 100%);
}

.kpi[data-kpi="tpc"]::before {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(2, 132, 199, 0.08) 100%);
}

.kpi .label { 
  font-size: 13px; 
  color: #64748b; 
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.kpi .label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

.kpi .value { 
  font-size: 42px; 
  font-weight: 900; 
  margin-top: 4px;
  background: linear-gradient(135deg, #1e293b 0%, #3B82F6 50%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  letter-spacing: -2px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 50px;
  position: relative;
  z-index: 1;
  animation: countUp 0.8s ease-out;
  text-shadow: 0 2px 20px rgba(59, 130, 246, 0.2);
}

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

/* Filtros - mantido para compatibilidade */
.md-filters { 
  display: grid; 
  grid-template-columns: repeat(5, minmax(0,1fr)); 
  gap: 16px; 
  margin: 20px 0 24px 0; 
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

.md-filter label { 
  display: block; 
  font-size: 14px; 
  color: #1e293b; 
  margin-bottom: 10px; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.5;
}

.md-filter select, 
.md-filter input[type=date], 
.md-filter input[type=text],
.md-filter input[type=number] { 
  width: 100%; 
  padding: 12px 16px; 
  border-radius: 12px; 
  border: 2px solid #e5e7eb; 
  background: #fff; 
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
  height: 48px;
}

/* Novos estilos para os campos de filtro */
.md-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
  height: 48px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.md-select:focus,
.md-input:focus,
.md-input-date:focus,
.md-input-search:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 4px 12px -1px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.md-select:hover,
.md-input:hover,
.md-input-date:hover,
.md-input-search:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.md-input-search,
.md-input-date {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
  height: 48px;
}

.md-input-search:focus,
.md-input-date:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.md-input-search::placeholder {
  color: #9ca3af;
}

/* Container para campos de data do período */
.md-filter .date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.md-filter .date-range input[type=date] {
  flex: 1;
  min-width: 0;
}

.md-filter .date-range span {
  color: #64748b;
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}

.md-filter select:focus, 
.md-filter input[type=date]:focus, 
.md-filter input[type=text]:focus,
.md-filter input[type=number]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.md-filter input[type=text]::placeholder,
.md-filter input[type=number]::placeholder {
  color: #9ca3af;
  font-style: italic;
}

.md-input-wide {
  width: 100%;
  min-width: 220px;
  max-width: 320px;
}

@media (max-width: 768px) {
  .md-input-wide {
    min-width: 100%;
    max-width: 100%;
  }
}

/* Dropdown com campo de busca integrado */
.searchable-dropdown {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.searchable-dropdown .dropdown-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.searchable-dropdown .dropdown-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #6b7280;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.searchable-dropdown.active .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown de sugestões */
.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestions-dropdown.show {
  display: block;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
}

.suggestion-item:hover {
  background-color: #f8fafc;
}

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

.suggestion-item.highlighted {
  background-color: #e0e7ff;
  color: #1e293b;
}

.md-filter {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.md-filter.actions { 
  display: flex; 
  align-items: flex-end; 
  gap: 12px; 
  justify-content: flex-end;
}

.md-filter .button {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  height: 48px;
  box-sizing: border-box;
  white-space: nowrap;
}

.md-filter .button-primary {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
  border: 1px solid #334155;
}

.md-filter .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.md-filter .button:not(.button-primary) {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
}

.md-filter .button:not(.button-primary):hover {
  background: #cbd5e1;
  transform: translateY(-1px);
  color: #334155;
}

/* Tabelas */
.dataTables_wrapper {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.dataTables_wrapper:hover {
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Padronização de espaçamento das tabelas */
.dataTables_wrapper table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 0;
}

.dataTables_wrapper th,
.dataTables_wrapper td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.dataTables_wrapper th {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.5;
}

.dataTables_wrapper td {
  color: #1e293b;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

.dataTables_wrapper tbody tr {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
  position: relative;
}

.dataTables_wrapper tbody tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3B82F6 0%, #10B981 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.dataTables_wrapper tbody tr:hover {
  background: linear-gradient(90deg, 
    rgba(59, 130, 246, 0.08) 0%, 
    rgba(16, 185, 129, 0.06) 50%,
    rgba(255, 255, 255, 0.95) 100%);
  transform: translateX(6px);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  border-left-color: transparent;
}

.dataTables_wrapper tbody tr:hover::before {
  opacity: 1;
}

.dataTables_wrapper tbody tr:hover td {
  color: #1e293b;
  font-weight: 500;
}

/* Espaçamento consistente entre elementos da tabela */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin: 16px 0;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-left: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
}

.dataTables_wrapper .dataTables_length select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin: 0 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
  font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button { 
  padding: 12px 20px; 
  margin: 0 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid rgba(226, 232, 240, 0.8);
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.dataTables_wrapper .dataTables_paginate .paginate_button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent);
  transition: left 0.4s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 
    0 6px 16px rgba(59, 130, 246, 0.4),
    0 2px 8px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  border-color: transparent;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover::before {
  left: 100%;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  color: white;
  border-color: transparent;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.5),
    0 2px 6px rgba(16, 185, 129, 0.4),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
  transform: translateY(-1px) scale(1.02);
}

.export-actions { 
  margin-top: 16px; 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
}

.export-actions .button {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  border: 2px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.export-actions .button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.export-actions .button:hover::before {
  left: 100%;
}

.export-actions .button:hover {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 
    0 10px 15px -3px rgba(59, 130, 246, 0.4),
    0 4px 6px -2px rgba(59, 130, 246, 0.3);
  border-color: transparent;
}

.export-actions .button-primary {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
}

.export-actions .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Títulos e seções */
.md-section h2 {
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, #1e293b 0%, #3B82F6 50%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, #3B82F6, #10B981, #F59E0B) 1;
  position: relative;
  letter-spacing: -1px;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.md-section h2::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #10B981, #F59E0B);
  border-radius: 2px;
  animation: expandWidth 0.8s ease-out;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.md-section h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  border-radius: 2px;
  animation: expandWidth 0.8s ease-out;
  opacity: 0.6;
}

@keyframes expandWidth {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100px;
    opacity: 1;
  }
}

.md-section h3 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, #3B82F6, #10B981) 1;
  line-height: 1.4;
  letter-spacing: -0.3px;
  position: relative;
}

.md-section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3B82F6, #10B981);
  border-radius: 2px;
}

.md-section p {
  font-size: 16px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 12px;
}

/* Melhorias gerais de legibilidade */
.md-wrapper ul,
.md-wrapper ol {
  font-size: 16px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 16px;
}

.md-wrapper li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.md-wrapper code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 14px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1e293b;
  font-weight: 500;
}

.md-wrapper strong {
  font-weight: 600;
  color: #0f172a;
}

/* Canvas dos gráficos */
canvas {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100%;
}

/* Garantir visibilidade dos elementos do dashboard */
#md-dashboard .md-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#md-dashboard .card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#md-dashboard .kpi {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Gráficos Comerciais */
.comercial-chart-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chart-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

/* Seção de gráfico reutilizável */
.chart-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-section-title {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.chart-container {
  flex: 1;
  min-height: 320px;
  position: relative;
  margin-bottom: 20px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(248, 250, 252, 0.95) 50%,
    rgba(243, 246, 251, 0.98) 100%);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 20px 40px -10px rgba(15, 23, 42, 0.3),
    0 8px 16px -4px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(59, 130, 246, 0.5) 25%,
    rgba(16, 185, 129, 0.5) 50%,
    rgba(59, 130, 246, 0.5) 75%,
    transparent 100%);
  border-radius: 24px 24px 0 0;
}

.chart-container::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, 
    rgba(59, 130, 246, 0.12) 0%, 
    rgba(16, 185, 129, 0.08) 50%,
    transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  animation: floatGlow 4s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(10px, -10px) scale(1.1);
    opacity: 0.8;
  }
}

.chart-container canvas {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.chart-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.chart-control label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #64748b;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.md-select-compact {
  min-width: 160px;
  width: 160px;
  height: 42px;
  padding: 8px 40px 8px 16px;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
  appearance: none;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  line-height: 1.5;
}


.md-select-compact:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.md-select-compact:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.12),
    0 4px 12px -1px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233b82f6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.md-input-compact {
  min-width: 160px;
  width: 160px;
  height: 42px;
  padding: 8px 20px;
  font-size: 16px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  overflow: visible;
  white-space: nowrap;
}

.md-input-compact::-webkit-inner-spin-button,
.md-input-compact::-webkit-outer-spin-button {
  opacity: 1;
  height: 24px;
  width: 20px;
  cursor: pointer;
  margin-right: 4px;
}

.md-input-compact:focus {
  width: 180px;
  min-width: 180px;
  padding: 8px 24px;
}

.md-input-compact::placeholder {
  font-weight: 500;
  color: #94a3b8;
  font-size: 14px;
}

.chart-highlight {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  min-height: 42px;
  display: flex;
  align-items: center;
}


.chart-legend {
  max-height: 280px;
  overflow-y: auto;
  padding: 20px;
  border-top: 2px solid rgba(226, 232, 240, 0.6);
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.5) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-radius: 0 0 20px 20px;
}

.chart-legend::-webkit-scrollbar {
  width: 10px;
}

.chart-legend::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.chart-legend::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  border-radius: 10px;
  border: 2px solid #f1f5f9;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.chart-legend::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2563EB 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  margin: 8px 0;
  font-size: 15px;
  color: #1e293b;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-radius: 14px;
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
}

.legend-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #3B82F6 0%, #10B981 100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 14px 0 0 14px;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.legend-item::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.legend-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 
    0 8px 20px rgba(59, 130, 246, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  transform: translateX(6px) translateY(-2px);
}

.legend-item:hover::before {
  opacity: 1;
  width: 6px;
}

.legend-item:hover::after {
  opacity: 1;
}

.legend-item-selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
  box-shadow: 
    0 8px 24px rgba(59, 130, 246, 0.25),
    0 4px 12px rgba(16, 185, 129, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9) !important;
  transform: translateX(6px) translateY(-2px);
}

.legend-item-selected::before {
  opacity: 1 !important;
  width: 6px !important;
  background: linear-gradient(180deg, #3B82F6 0%, #10B981 100%) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6) !important;
}

.legend-item-selected::after {
  opacity: 1 !important;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-item:hover .legend-color {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

.legend-text {
  flex: 1;
  line-height: 1.7;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-text strong {
  font-weight: 700;
  color: #0f172a;
  font-size: 15px;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.legend-text span:not(strong) {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.legend-item:hover .legend-text strong {
  color: #1e293b;
}

.legend-item:hover .legend-text span:not(strong) {
  color: #475569;
}

/* Gráfico Donut */
.donut-chart-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.donut-container {
  flex: 1;
  min-height: 300px;
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

/* Mapa */
#map {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Tooltips do mapa */
.leaflet-tooltip.custom-tooltip {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #1e293b;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 12px 16px;
}

.leaflet-tooltip.custom-tooltip::before {
  border-top-color: #1e293b;
}

/* Loading state */
.md-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  font-size: 16px;
  color: #64748b;
  font-weight: 600;
  gap: 16px;
}

.md-loading::before {
  content: '';
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top: 4px solid #3B82F6;
  border-right: 4px solid #10B981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.md-loading::after {
  content: 'Carregando dados...';
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Skeleton loading para cards */
.card.loading {
  position: relative;
  overflow: hidden;
}

.card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

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

/* Informações sobre integração */
.md-info-section {
  margin-bottom: 30px;
}

.md-info-section h3 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  line-height: 1.4;
}

.md-info-section p {
  font-size: 16px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 12px;
}

.info-badges {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.4;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: #047857;
}

.badge-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-color: #1d4ed8;
}

.badge-primary {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-color: #334155;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* CSS relacionado a upload de CSV removido - integração direta com banco de dados */

/* Filtros de Evolução */
.md-filters-evolucao {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.md-filters-evolucao .md-filter {
  display: flex;
  flex-direction: column;
}

.md-filters-evolucao .md-filter label {
  display: block;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.5;
}

.md-filters-evolucao .md-filter input[type="month"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.md-filters-evolucao .md-filter input[type="month"]:focus {
  outline: none;
  border-color: #1e293b;
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
  transform: translateY(-1px);
}

.md-filters-evolucao .md-filter.actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.md-filters-evolucao .md-filter .button {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.md-filters-evolucao .md-filter .button-primary {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
  border: 1px solid #334155;
}

.md-filters-evolucao .md-filter .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.md-filters-evolucao .md-filter .button:not(.button-primary) {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #cbd5e1;
}

.md-filters-evolucao .md-filter .button:not(.button-primary):hover {
  background: #cbd5e1;
  transform: translateY(-1px);
  color: #334155;
}

/* Responsivo */
@media (max-width: 1024px) {
  .row-2 { grid-template-columns: 1fr; }
  .row-4 { grid-template-columns: 1fr 1fr; }
  .md-kpis { 
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .md-filters { grid-template-columns: 1fr 1fr; }
  .md-filters-evolucao { grid-template-columns: 1fr; }
  .md-filters-row {
    grid-template-columns: 1fr;
  }
  .md-filters-row:last-child {
    grid-template-columns: 1fr;
  }
  .md-header {
    padding: 32px 28px;
  }
  .card {
    padding: 24px;
  }
  .chart-container {
    padding: 20px;
    min-height: 280px;
  }
}

@media (max-width: 768px) {
  .md-wrapper {
    padding: 16px;
  }
  
  .md-title {
    font-size: 32px;
    letter-spacing: -0.8px;
  }
  
  .md-subtitle {
    font-size: 15px;
  }
  
  .md-header {
    padding: 24px 20px;
    margin-bottom: 28px;
    border-radius: 20px;
  }
  
  /* Ajustar layout do header em mobile */
  .md-header > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }
  
  .md-header #export-relatorio-geral {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    text-align: center;
    white-space: normal;
  }
  
  .md-header .md-title {
    font-size: 28px;
    margin-bottom: 8px;
  }
  
  .md-header .md-subtitle {
    font-size: 14px;
  }
  
  /* Ocultar seções que devem aparecer apenas em desktop */
  .md-desktop-only {
    display: none !important;
  }
  
  /* Garantir que Visão Geral e Header sempre apareçam em mobile */
  .md-mobile-visible {
    display: block !important;
  }
  
  .md-kpis { 
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .kpi {
    padding: 24px 20px;
  }
  
  .kpi .value {
    font-size: 36px;
    letter-spacing: -1.5px;
  }
  
  .md-filters { 
    grid-template-columns: 1fr; 
  }
  
  .md-filters-wrapper {
    border-radius: 16px;
  }
  
  .md-filters-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .md-filters-row:last-child {
    grid-template-columns: 1fr;
  }
  
  .row-4 { 
    grid-template-columns: 1fr; 
  }
  
  .card {
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
  }
  
  .chart-container {
    padding: 16px;
    min-height: 250px;
    border-radius: 16px;
  }
  
  .md-section h2 {
    font-size: 28px;
    margin-bottom: 24px;
  }
  
  .md-section h3 {
    font-size: 20px;
  }
  
  .md-section p {
    font-size: 15px;
  }
  
  .chart-title {
    font-size: 18px;
  }
  
  .card-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .card-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .chart-header-actions {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-end;
  }
  
  .chart-control {
    flex: 1;
    min-width: 140px;
  }
}

@media (max-width: 480px) {
  .md-wrapper {
    padding: 12px;
  }
  
  .md-title {
    font-size: 28px;
  }
  
  .md-header {
    padding: 20px 16px;
  }
  
  .kpi .value {
    font-size: 32px;
  }
  
  .kpi .label {
    font-size: 12px;
  }
  
  .card {
    padding: 16px;
  }
  
  .chart-container {
    padding: 12px;
    min-height: 220px;
  }
}

/* ============================================
   NOVAS FUNCIONALIDADES - ESTILOS
   ============================================ */

/* Barra de Ações Rápidas */
.md-quick-actions {
  margin-bottom: 32px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.quick-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-actions-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.quick-actions-buttons {
  display: flex;
  gap: 8px;
}

.button-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.button-icon:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Comparação de Períodos */
.md-comparison-controls {
  margin-bottom: 24px;
}

.md-kpis-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.md-kpis-compact .kpi {
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.md-kpis-compact .kpi .label {
  font-size: 12px;
  margin-bottom: 4px;
}

.md-kpis-compact .kpi .value {
  font-size: 20px;
}

/* Alertas e Notificações */
#md-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md-alert {
  padding: 20px;
  border-radius: 12px;
  border-left: 5px solid;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.md-alert:hover {
  transform: translateX(4px);
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.md-alert.warning {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.md-alert.error {
  border-color: #EF4444;
  background: #FEE2E2;
}

.md-alert.info {
  border-color: #3B82F6;
  background: #DBEAFE;
}

.md-alert.success {
  border-color: #10B981;
  background: #D1FAE5;
}

.md-alert-icon {
  font-size: 24px;
}

.md-alert-content {
  flex: 1;
}

.md-alert-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.md-alert-message {
  font-size: 13px;
  color: #475569;
}

/* Chart Header com Botão de Exportação */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  gap: 20px;
}

.chart-export-btn {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.12) 0%, 
    rgba(16, 185, 129, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  align-self: flex-end;
}

.chart-export-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.chart-export-btn:hover {
  background: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.25) 0%, 
    rgba(16, 185, 129, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.6);
  transform: scale(1.15) rotate(5deg);
  box-shadow: 
    0 6px 20px rgba(59, 130, 246, 0.4),
    0 2px 8px rgba(16, 185, 129, 0.3);
}

.chart-export-btn:hover::before {
  width: 200px;
  height: 200px;
}

.chart-export-btn:active {
  transform: scale(1.05) rotate(2deg);
}

/* Ranking Tabs */
.ranking-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.ranking-tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.ranking-tab:hover {
  color: #1e293b;
}

.ranking-tab.active {
  color: #3B82F6;
  border-bottom-color: #3B82F6;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
  font-weight: 700;
}

/* Modais */
.md-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s;
}

.md-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  margin: auto;
  padding: 40px;
  border-radius: 20px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.md-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s;
}

.md-modal-close:hover {
  color: #1e293b;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modo Apresentação */
.md-presentation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-presentation-content {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-presentation-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 100000;
  transition: background 0.2s;
}

.md-presentation-close:hover {
  background: rgba(255,255,255,0.3);
}

#md-presentation-slides {
  width: 90%;
  height: 90%;
  overflow: auto;
}

/* Tema Escuro */
.md-wrapper.dark-theme {
  background: #0f172a;
  color: #e2e8f0;
}

.md-wrapper.dark-theme .card {
  background: #1e293b;
  border-color: #334155;
}

.md-wrapper.dark-theme .kpi {
  background: #1e293b;
  border-color: #334155;
}

.md-wrapper.dark-theme .md-input,
.md-wrapper.dark-theme .md-select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.md-wrapper.dark-theme .button {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}

.md-wrapper.dark-theme .button:hover {
  background: #475569;
}

/* Inputs adicionais */
.md-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.md-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.button-secondary {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  border: 1px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.button-secondary:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Filtros Salvos */
#md-saved-filters-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.saved-filter-item {
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.saved-filter-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.saved-filter-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.saved-filter-preview {
  font-size: 12px;
  color: #64748b;
}

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

/* Agendamentos */
#md-schedules-list {
  margin-top: 20px;
}

.schedule-item {
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.schedule-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.schedule-info {
  flex: 1;
}

.schedule-frequency {
  font-weight: 600;
  margin-bottom: 4px;
}

.schedule-email {
  font-size: 13px;
  color: #64748b;
}

/* Mapa Interativo */
#map-container {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

/* Botões pequenos */
.button-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  border-radius: 12px;
  border: 2px solid #f1f5f9;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2563EB 0%, #059669 100%);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    0 2px 8px rgba(59, 130, 246, 0.3);
  transform: scale(1.1);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #1d4ed8 0%, #047857 100%);
}

/* Efeitos de loading */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Melhorias nos inputs */

/* Efeito de shimmer nos cards */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Responsividade para novas funcionalidades */
@media (max-width: 768px) {
  .quick-actions-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .md-kpis-compact {
    grid-template-columns: 1fr;
  }
  
  .ranking-tabs {
    flex-wrap: wrap;
  }
  
  .md-modal-content {
    max-width: 95%;
    padding: 20px;
  }
  
  .md-title {
    font-size: 28px;
  }
  
  .md-section h2 {
    font-size: 24px;
  }
  
  .kpi .value {
    font-size: 28px;
  }
}
