/**
 * Tema Dark - Integrum Manufatura
 * Aplica quando html tem a classe theme-dark
 */

/* Botão tema - cor no modo light (header claro) */
#btnToggleTheme,
#btnToggleTheme.theme-btn-light {
  color: #002d3d !important;
}

#btnToggleTheme:hover {
  opacity: 0.8;
}
html.theme-dark body {
  background: #1e293b;
  color: #e2e8f0;
}

html.theme-dark a {
  color: #93c5fd;
}

html.theme-dark a:hover {
  color: #bfdbfe;
}

/* Main */
html.theme-dark #main {
  background: #1e293b;
}

/* Page Title */
html.theme-dark .pagetitle h1 {
  color: #f1f5f9;
}

/* Header */
html.theme-dark .header {
  background-color: #0f172a !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

html.theme-dark .header .toggle-sidebar-btn {
  color: #e2e8f0;
}

html.theme-dark .header-logo-link span {
  color: #f1f5f9 !important;
}

html.theme-dark .header-nav .nav-profile,
html.theme-dark .header-nav .nav-profile span {
  color: #e2e8f0 !important;
}

html.theme-dark #btnToggleTheme,
html.theme-dark #btnToggleTheme i {
  color: #57c5e8 !important;
}

html.theme-dark #btnToggleTheme:hover {
  color: #87d4f0 !important;
}

html.theme-dark .header-nav .nav-link,
html.theme-dark .header-nav .nav-link i {
  color: #e2e8f0 !important;
}

html.theme-dark .header-nav .nav-link:hover,
html.theme-dark .header-nav .nav-link:hover i {
  color: #57c5e8 !important;
}

html.theme-dark .header .search-form input {
  color: #e2e8f0;
  background: #334155;
}

/* Sidebar */
html.theme-dark .sidebar {
  background-color: #0f172a !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

html.theme-dark .sidebar::-webkit-scrollbar-thumb {
  background-color: #475569;
}

html.theme-dark .sidebar-nav .nav-heading {
  color: #94a3b8;
}

html.theme-dark .sidebar-nav .nav-link {
  color: #93c5fd;
  background: #1e293b;
}

html.theme-dark .sidebar-nav .nav-link.collapsed {
  color: #cbd5e1;
  background: transparent;
}

html.theme-dark .sidebar-nav .nav-link.collapsed i {
  color: #94a3b8;
}

html.theme-dark .sidebar-nav .nav-link:hover {
  color: #93c5fd;
  background: #1e293b;
}

html.theme-dark .sidebar-nav .nav-content a {
  color: #cbd5e1;
}

html.theme-dark .sidebar-nav .nav-content a:hover,
html.theme-dark .sidebar-nav .nav-content a.active {
  color: #93c5fd;
}

/* Cards */
html.theme-dark .card {
  background-color: #334155;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

html.theme-dark .card-header,
html.theme-dark .card-footer {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

html.theme-dark .card-title {
  color: #f1f5f9 !important;
}

html.theme-dark .card-title span {
  color: #94a3b8 !important;
}

/* Breadcrumb */
html.theme-dark .breadcrumb,
html.theme-dark .breadcrumb a,
html.theme-dark .breadcrumb .breadcrumb-item::before {
  color: #94a3b8 !important;
}

html.theme-dark .breadcrumb .active {
  color: #cbd5e1 !important;
}

/* Dropdown */
html.theme-dark .dropdown-menu {
  background-color: #334155;
  border-color: #475569;
}

html.theme-dark .dropdown-menu .dropdown-item {
  color: #e2e8f0;
}

html.theme-dark .dropdown-menu .dropdown-item:hover {
  background-color: #475569;
}

html.theme-dark .dropdown-menu .dropdown-header h6 {
  color: #f1f5f9;
}

html.theme-dark .dropdown-menu .dropdown-header span {
  color: #94a3b8;
}

/* Tables */
html.theme-dark .table {
  color: #e2e8f0;
}

html.theme-dark .table-light {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
}

html.theme-dark .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(51, 65, 85, 0.5);
}

html.theme-dark .table-hover > tbody > tr:hover {
  background-color: #475569;
}

/* Forms */
html.theme-dark .form-control,
html.theme-dark .form-select {
  background-color: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

html.theme-dark .form-control:focus,
html.theme-dark .form-select:focus {
  background-color: #334155;
  border-color: #93c5fd;
  color: #e2e8f0;
}

html.theme-dark .form-control::placeholder {
  color: #94a3b8;
}

html.theme-dark .form-label,
html.theme-dark label {
  color: #cbd5e1 !important;
}

/* Accordion */
html.theme-dark .accordion-item {
  background-color: #334155;
  border-color: #475569;
}

html.theme-dark .accordion-button {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569;
}

html.theme-dark .accordion-button:not(.collapsed) {
  background-color: #475569 !important;
  color: #f1f5f9 !important;
}

html.theme-dark .accordion-button::after {
  filter: invert(1);
}

html.theme-dark .accordion-body {
  color: #cbd5e1;
  background-color: #1e293b;
}

/* Modals */
html.theme-dark .modal-content {
  background-color: #334155;
  border-color: #475569;
}

html.theme-dark .modal-header {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.theme-dark .modal-body {
  background-color: #334155;
  color: #e2e8f0;
}

html.theme-dark .modal-footer {
  background-color: #334155 !important;
  border-color: #475569 !important;
}

html.theme-dark .btn-close {
  filter: invert(1);
}

/* Footer */
html.theme-dark .footer {
  border-color: #475569;
}

html.theme-dark .footer .copyright,
html.theme-dark .footer .credits {
  color: #94a3b8 !important;
}

/* Alerts */
html.theme-dark .alert-warning {
  background-color: #422006;
  border-color: #854d0e;
  color: #fef3c7;
}

/* Back to top */
html.theme-dark .back-to-top {
  background: #475569;
}

html.theme-dark .back-to-top:hover {
  background: #64748b;
}

/* Nav tabs */
html.theme-dark .nav-tabs-bordered {
  border-color: #475569;
}

html.theme-dark .nav-tabs-bordered .nav-link {
  color: #cbd5e1;
}

html.theme-dark .nav-tabs-bordered .nav-link.active {
  background-color: #334155;
  color: #93c5fd;
  border-color: #93c5fd;
}

/* Text utilities */
html.theme-dark .text-muted {
  color: #94a3b8 !important;
}

/* Página Postos / Mapa da Planta */
html.theme-dark .card-mapa {
  background-color: #334155 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
}

html.theme-dark .planta-scroll {
  background:
    linear-gradient(rgba(51,65,85,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51,65,85,.5) 1px, transparent 1px),
    linear-gradient(160deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
  border-color: #475569 !important;
}

html.theme-dark .planta-canvas {
  background: rgba(30,41,59,.6) !important;
}

html.theme-dark .mapa-toolbar {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  border-color: #475569 !important;
}

html.theme-dark .mapa-toolbar .toolbar-label {
  color: #94a3b8 !important;
}

html.theme-dark .mapa-legenda .legenda-titulo {
  color: #94a3b8 !important;
}

html.theme-dark .mapa-legenda .legenda-item {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #cbd5e1 !important;
}

html.theme-dark .mapa-stat {
  background: #334155 !important;
  border-color: #475569 !important;
}

html.theme-dark .mapa-stat .stat-value {
  color: #f1f5f9 !important;
}

html.theme-dark .mapa-stat .stat-label {
  color: #94a3b8 !important;
}

html.theme-dark .posto-tooltip {
  background: rgba(51,65,85,.98) !important;
  border-color: #475569 !important;
}

html.theme-dark .posto-tooltip .tt-cod {
  color: #f1f5f9 !important;
}

html.theme-dark .posto-tooltip .tt-desc {
  color: #cbd5e1 !important;
}

html.theme-dark .posto-tooltip .tt-sit {
  background: #475569 !important;
  color: #e2e8f0 !important;
  border-left-color: #64748b !important;
}

/* Gráficos ApexCharts - fontes e legendas visíveis no tema dark */
html.theme-dark .apexcharts-legend-text {
  color: #e2e8f0 !important;
}

html.theme-dark .apexcharts-canvas text {
  fill: #e2e8f0 !important;
}

html.theme-dark .apexcharts-tooltip.apexcharts-theme-light {
  border-color: #475569 !important;
  background: rgba(30, 41, 59, 0.96) !important;
  color: #e2e8f0 !important;
}

html.theme-dark .apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
  background: rgba(51, 65, 85, 0.9) !important;
  border-bottom-color: #475569 !important;
  color: #f1f5f9 !important;
}
