/* ============================================
   CHESTDBWEB - ADMIN LAYOUT & COMPONENTS
   ============================================ */

/* === Layout === */
#wrapper {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background-color: #f8f9fc;
}

#content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.bg-primary-custom {
  background-color: #4e73df;
  color: #fff;
}

.active>.page-link, .page-link.active {
  background-color: #4e73df !important;
}

.page-link {
  color: #4e73df;
}

.btn-link {
  color: #4e73df;
}

/* === Sidebar === */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
  color: #fff;
  min-height: 100vh;
  padding-top: 1rem;
}

.sidebar .nav-link {
  color: #ffffffcc;
  padding: 0.75rem 1rem;
  transition: background 0.3s;
  font-size: var(--sidebar-font-size);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar .nav-link i {
  text-align: center;
  font-size: var(--icon-size);
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1rem 1.5rem;
  text-align: center;
}

.sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 1rem 0;
}

/* === Topbar === */
.navbar-topbar {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e3e6f0;
}

.navbar-topbar .btn-circle {
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-topbar .img-profile {
  object-fit: cover;
}

/* === Dropdown === */
.dropdown-menu-right {
  right: 0;
  left: auto;
}

.dropdown-item {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
}

.dropdown-item i {
  margin-right: 0.5rem;
  color: #858796;
}

/* === Responsive Sidebar Toggle === */
.sidebar.toggled {
  width: 0;
  overflow: hidden;
}

body.sidebar-toggled .sidebar {
  width: 0 !important;
}

/* === Utilities === */
.text-gray-600 {
  color: #858796 !important;
}

.shadow {
  box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15) !important;
}

/* === Dark Mode (optional) === */
.navbar-dark {
  background-color: #343a40 !important;
}

.bg-dark {
  background-color: #343a40 !important;
  color: #fff;
}

.bg-white {
  background-color: #fff !important;
}

/* ============================================
   DARK MODE THEME
   ============================================ */

.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-color-dark);
}

/* Layout */
.dark-mode .navbar,
.dark-mode .footer,
.dark-mode #wrapper #content-wrapper #content,
.dark-mode #content-wrapper,
.dark-mode .bg-light {
  background-color: #2e2e3a !important;
}

/* Sidebar - força cor escura */
.dark-mode .sidebar,
.dark-mode #accordionSidebar,
.dark-mode .bg-gradient-primary {
  background-color: #374151 !important;
  background-image: none !important;
}

.dark-mode .sidebar .nav-item .nav-link {
  color: #d1d5db !important;
}

.dark-mode .sidebar .nav-item .nav-link:hover {
  color: #ffffff !important;
  background-color: #374151 !important;
}

.dark-mode .sidebar .nav-item .nav-link.active {
  color: #ffffff !important;
  background-color: #4a5568 !important;
}

.dark-mode .sidebar-brand {
  color: #ffffff !important;
}

.dark-mode .sidebar hr.sidebar-divider {
  border-color: #4a5568 !important;
}

.dark-mode .sidebar-heading {
  color: #9ca3af !important;
}

/* Botões */
.dark-mode .btn-primary {
  background-color: #4e73df;
  border-color: #4e73df;
}

.dark-mode .btn-outline-primary {
  color: #ffffff;
  border-color: #ffffff;
}

.dark-mode .btn-link {
  color: #4e73df;
}

.dark-mode .btn-link:hover {
  color: #2e59d9;
}

/* Ícone do toggle dark mode */
.dark-mode .fa-moon,
.dark-mode .toggle-dark-mode i {
  color: #ffffff !important;
}

/* Textos */
.dark-mode .d-flex .flex-column,
.dark-mode .text-gray-800 {
  color: #ffffff !important;
}

.dark-mode .text-dark {
  color: #f8f9fc !important;
}

.dark-mode .text-muted {
  color: #adb5bd !important;
}

/* Cards */
.dark-mode .card {
  background-color: #6c757d !important;
  border-color: #4a5568;
  border-width: 1px;
}

.dark-mode .card-header {
  background-color: #495057 !important;
  color: #f8f9fc;
  border-color: #4a5568;
}

.dark-mode .card-body,
.dark-mode .card-footer {
  background-color: #3a3a4a !important;
  color: #f8f9fc;
  border-color: #4a5568;
}

/* Tabelas */
.dark-mode .table > :not(caption) > * > *,
.dark-mode table > :not(caption) > * > * {
  background-color: #3a3a4a !important;
  color: #f8f9fc !important;
  border-color: #495057 !important;
}

/* Alertas */
.dark-mode .alert-warning {
  background-color: #664d03;
  border-color: #805d09;
  color: #ffecb5;
}

.dark-mode .alert-info {
  background-color: #055160;
  border-color: #087990;
  color: #b6effb;
}

.dark-mode .alert-danger {
  background-color: #842029;
  border-color: #a52834;
  color: #f8d7da;
}

/* Forms */
.dark-mode .form-control,
.dark-mode .form-select {
  background-color: #3a3a4a;
  border-color: #495057;
  color: #f8f9fc;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
  background-color: #3a3a4a;
  border-color: #4e73df;
  color: #f8f9fc;
}

/* Badges */
.dark-mode .badge {
  color: #ffffff;
}

/* Charts */
.dark-mode .chart-container,
.dark-mode .chart-container-doughnut,
.dark-mode .chart-container-pie {
  background-color: transparent;
}

/* Code */
.dark-mode pre {
  background-color: #3a3a4a;
  color: #f8f9fc;
  border: 1px solid #495057;
  padding: 8px;
  border-radius: 4px;
}

/* Dashboard - Melhorias no modo dark */

/* Títulos principais */
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
  color: #f8f9fc !important;
}

/* Cards de estatísticas - cores vibrantes e sombras */
.dark-mode .card.shadow-sm {
  background-color: #2d3748 !important;
  box-shadow: 0 0.25rem 1rem 0 rgba(0, 0, 0, 0.5) !important;
  border: 1px solid #4a5568 !important;
}

.dark-mode .card-body {
  background-color: #2d3748 !important;
}

/* Card headers com fundo levemente diferente */
.dark-mode .card-header {
  background-color: #374151 !important;
  border-bottom: 1px solid #4a5568 !important;
  color: #e5e7eb !important;
}

.dark-mode .card-header.bg-transparent {
  background-color: transparent !important;
  border-bottom: 1px solid #4a5568 !important;
}

/* Números dos cards de estatísticas - mais brilhantes */
.dark-mode .text-primary {
  color: #60a5fa !important;
}

.dark-mode .text-success {
  color: #34d399 !important;
}

.dark-mode .text-warning {
  color: #fbbf24 !important;
}

.dark-mode .text-info {
  color: #22d3ee !important;
}

/* Ícones com melhor contraste */
.dark-mode .opacity-25 {
  opacity: 0.2 !important;
}

/* Texto muted mais visível */
.dark-mode .text-muted {
  color: #9ca3af !important;
}

/* Small text */
.dark-mode small.text-muted {
  color: #9ca3af !important;
}

/* Select e inputs mais bonitos */
.dark-mode .form-select,
.dark-mode .form-control {
  background-color: #374151 !important;
  border-color: #4a5568 !important;
  color: #f3f4f6 !important;
}

.dark-mode .form-select:focus,
.dark-mode .form-control:focus {
  background-color: #374151 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25) !important;
}

.dark-mode .form-select option {
  background-color: #374151 !important;
  color: #f3f4f6 !important;
}

/* Labels */
.dark-mode label {
  color: #d1d5db !important;
}

/* Container fluid */
.dark-mode .container-fluid {
  background-color: transparent !important;
}

/* === Media Queries === */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .sidebar.toggled {
    display: block;
    width: 100%;
    position: absolute;
    z-index: 1000;
  }
}

/* === Estilos para Toast.jsx === */

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast-container {
  position: fixed;
  top: 0;
  right: 0;
  padding: 20px;
  z-index: 9999;
  pointer-events: none;
}

.toast-container > * {
  pointer-events: auto;
  margin-bottom: 10px;
}

/* Estilos responsivos para mobile */
@media (max-width: 768px) {
  .toast-container {
    left: 0;
    right: 0;
    padding: 10px;
  }
  
  .toast-container > div {
    min-width: auto !important;
    margin: 0 10px 10px 10px;
  }
}