[data-bs-theme="dark"] .table thead, 
[data-bs-theme="dark"] thead tr,
[data-bs-theme="dark"] .card-header {
  background-color: #2b2c40 !important;
  color: #a3a4cc !important;
}

[data-bs-theme="dark"] .table th {
  color: #a3a4cc !important;
}

[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table tr {
  color: #cfd3ed !important;
}

[data-bs-theme="dark"] .card {
  background-color: #2b2c40;
  border-color: #444564;
}

[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .text-dark {
  color: #cfd3ed !important;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #2b2c40;
  color: #cfd3ed;
  border-color: #444564;
}

.table th {
  text-transform: none !important;
  font-weight: 600;
  font-size: 1rem !important;
}

.summary-card {
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  background-color: #c7c7c7;
}

/* Fix sidebar scroll when content doesn't generate page scroll */
.layout-menu .menu-inner {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 64px);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.layout-menu .menu-inner::-webkit-scrollbar {
  display: none;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.rotating-icon {
  display: inline-block;
  animation: rotate 2s linear infinite;
}

/* Fix for drag-target pushing items to the right on mobile */
.drag-target {
  width: 0 !important;
  pointer-events: none;
}

.layout-menu-expanded .drag-target {
  width: 50px !important;
  pointer-events: auto;
}

/* Global CTA alignment to the right */
.justify-content-center.justify-content-md-end {
  justify-content: flex-end !important;
}

@media (max-width: 768px) {
  .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .d-flex.justify-content-between.align-items-center > *:last-child {
    margin-left: auto !important;
  }
}

/* Responsividade para Telas Grandes (TVs, Ultra-wide) */
@media (min-width: 1400px) {
  .container-xxl, .container-xl, .container-lg, .container-md, .container-sm, .container {
    max-width: 95% !important;
  }
}

@media (min-width: 1920px) {
  .container-xxl {
    max-width: 98% !important;
  }
}

/* Melhorias Mobile Gerais */
@media (max-width: 768px) {
  .content-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .container-xxl {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  /* Evitar scroll horizontal */
  body, html {
    overflow-x: hidden;
    width: 100%;
  }

  /* Navbar mobile adjustments */
  .layout-navbar {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* Garantir que tabelas não quebrem o layout */
  .table-responsive {
    border: 0;
  }
}

@media (min-width: 2500px) {
  body {
    font-size: 1.1rem;
  }
  .kpi-value {
    font-size: 42px !important;
  }
  .kpi-title {
    font-size: 16px !important;
  }
  .chart-title {
    font-size: 24px !important;
  }
}

/* Dashboard Tabs Mobile 2 per line */
@media (max-width: 768px) {
  .tabs-container {
    padding: 0 12px !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .tab-item {
    flex: 0 0 50%;
    padding: 12px 8px !important;
    justify-content: center;
    border-bottom: 2px solid var(--gray-200) !important;
    font-size: 12px !important;
  }
  .tab-item.active {
    border-bottom-color: var(--primary) !important;
  }
}
