﻿/* Явные стили для светлой темы */
[data-bs-theme="light"],
[data-bs-theme="light"] body {
  background-color: #fafbfc !important;
  color: var(--gray-800) !important;
}

html[data-bs-theme="light"] .card {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

html[data-bs-theme="light"] .card-header {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

html[data-bs-theme="light"] .card-body {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="light"] .table {
  --bs-table-bg: white;
  --bs-table-color: var(--gray-800);
  background-color: white !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table thead th {
  background-color: #f8f9fa !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table tbody tr {
  background-color: white !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table tbody tr td {
  background-color: white !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .text-muted {
  color: var(--gray-700) !important;
}

[data-bs-theme="light"] .text-gray-600,
[data-bs-theme="light"] .text-gray-700,
[data-bs-theme="light"] .text-gray-800 {
  color: var(--gray-800) !important;
}

/* Дополнительные стили для светлой темы - переопределение темной */
[data-bs-theme="light"] .bg-light {
  background-color: #f8f9fa !important;
}

[data-bs-theme="light"] .bg-white {
  background-color: white !important;
}

[data-bs-theme="light"] .navbar-light {
  background-color: white !important;
}

[data-bs-theme="light"] .navbar-light .navbar-nav .nav-link {
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .sidebar {
  background-color: #f8f9fa !important;
  border-right-color: var(--gray-200) !important;
}

[data-bs-theme="light"] .sidebar .nav-link {
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .sidebar .nav-link:hover {
  background-color: var(--gray-200) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .sidebar .nav-link.active {
  background-color: var(--gray-200) !important;
  color: var(--primary) !important;
}

[data-bs-theme="light"] .dropdown-menu {
  background-color: white !important;
  border-color: var(--gray-200) !important;
}

[data-bs-theme="light"] .dropdown-item {
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .dropdown-item:hover,
[data-bs-theme="light"] .dropdown-item:focus {
  background-color: var(--gray-100) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .modal-content {
  background-color: white !important;
  border-color: var(--gray-200) !important;
}

[data-bs-theme="light"] .modal-header {
  border-bottom-color: var(--gray-200) !important;
}

[data-bs-theme="light"] .modal-footer {
  border-top-color: var(--gray-200) !important;
}

[data-bs-theme="light"] .list-group-item {
  background-color: white !important;
  border-color: var(--gray-200) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .list-group-item:hover {
  background-color: var(--gray-100) !important;
}

[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
  background-color: white !important;
  color: var(--gray-800) !important;
  border-color: var(--gray-300) !important;
}

[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
  background-color: white !important;
  color: var(--gray-800) !important;
  border-color: var(--primary) !important;
}

[data-bs-theme="light"] .btn-outline-light {
  border-color: var(--gray-300) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .btn-outline-light:hover {
  background-color: var(--gray-100) !important;
  border-color: var(--gray-300) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] h1,
[data-bs-theme="light"] h2,
[data-bs-theme="light"] h3,
[data-bs-theme="light"] h4,
[data-bs-theme="light"] h5,
[data-bs-theme="light"] h6 {
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] p,
[data-bs-theme="light"] span,
[data-bs-theme="light"] div {
  color: inherit;
}

[data-bs-theme="light"] .table-secondary {
  background-color: var(--gray-100) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table-secondary td,
[data-bs-theme="light"] .table-secondary th {
  background-color: var(--gray-100) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table-warning {
  background-color: rgba(247, 37, 133, 0.1) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table-warning td,
[data-bs-theme="light"] .table-warning th {
  background-color: rgba(247, 37, 133, 0.1) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table-danger {
  background-color: rgba(230, 57, 70, 0.1) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table-danger td,
[data-bs-theme="light"] .table-danger th {
  background-color: rgba(230, 57, 70, 0.1) !important;
  color: var(--gray-800) !important;
}

[data-bs-theme="light"] .table tbody tr:hover {
  background-color: var(--gray-100) !important;
}

[data-bs-theme="light"] .table tbody tr:hover td {
  background-color: var(--gray-100) !important;
  color: var(--gray-800) !important;
}

/* КРИТИЧЕСКИ ВАЖНО: Стили для светлой темы должны быть ПОСЛЕ темной темы */
/* Переопределяем все стили темной темы для светлой темы */

html[data-bs-theme="light"] body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

html[data-bs-theme="light"] .navbar-light {
  background-color: white !important;
}

html[data-bs-theme="light"] .navbar-light .navbar-nav .nav-link {
  color: var(--text-primary) !important;
}

html[data-bs-theme="light"] .sidebar {
  background-color: var(--bg-tertiary) !important;
  border-right-color: var(--border-color) !important;
}

html[data-bs-theme="light"] .sidebar .nav-link {
  color: var(--text-primary) !important;
}

/* Белый разделитель в сайдбаре для светлой темы */
html[data-bs-theme="light"] .sidebar hr,
html[data-bs-theme="light"] .sidebar .nav-item hr,
html[data-bs-theme="light"] .custom-sidebar hr,
html[data-bs-theme="light"] .custom-sidebar .nav-item hr {
    border-top: 1px solid #ffffff !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    opacity: 1 !important;
    background-color: transparent !important;
    height: 0 !important;
    margin: 1rem 0.5rem !important;
}

html[data-bs-theme="light"] .sidebar .nav-link:hover {
  background-color: var(--gray-200) !important;
  color: var(--text-primary) !important;
}

html[data-bs-theme="light"] .sidebar .nav-link.active {
  background-color: var(--gray-200) !important;
  color: var(--primary) !important;
}

/* Стили для графиков Chart.js */
.chart-container canvas {
  max-width: 100% !important;
  height: auto !important;
}

.card-body canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Улучшенная типографика */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-weight: 700;
  line-height: 1.1;
}

.lead {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--gray-600);
}

[data-bs-theme="light"] .lead {
  color: var(--gray-700) !important;
}

[data-bs-theme="dark"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .card {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .card-header {
  background-color: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .table {
  --bs-table-bg: var(--bg-secondary);
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border-color);
  --bs-table-hover-bg: var(--bg-tertiary);
  --bs-table-hover-color: var(--text-primary);
}

[data-bs-theme="dark"] .table thead th {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .table thead {
  background-color: var(--bg-tertiary) !important;
}

[data-bs-theme="dark"] .table thead.table-light {
  background-color: var(--bg-tertiary) !important;
}

[data-bs-theme="dark"] .table thead.table-light th {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table th {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .table td {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .text-muted {
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .text-gray-600,
[data-bs-theme="dark"] .text-gray-700,
[data-bs-theme="dark"] .text-gray-800 {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .text-secondary {
  color: var(--text-secondary) !important;
}

/* Улучшаем видимость серого текста в темной теме */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .small {
  color: #cbd5e0 !important;
  opacity: 1 !important;
}

[data-bs-theme="dark"] .text-body-secondary {
  color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .text-gray-600,
[data-bs-theme="dark"] .text-gray-700,
[data-bs-theme="dark"] .text-gray-800 {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .font-weight-bold {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .text-xs {
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .text-uppercase {
  color: var(--text-secondary) !important;
}

/* Дополнительные стили для таблиц в темной теме */
[data-bs-theme="dark"] .table-sm th,
[data-bs-theme="dark"] .table-sm td {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover td,
[data-bs-theme="dark"] .table-hover tbody tr:hover th {
  color: var(--text-primary) !important;
}

/* Карточки статистики - одинаковые цвета в обеих темах */
[data-bs-theme="dark"] .border-left-primary,
html[data-bs-theme="dark"] .border-left-primary {
  border-left-color: #4361ee !important;
}

[data-bs-theme="dark"] .border-left-primary .text-primary,
html[data-bs-theme="dark"] .border-left-primary .text-primary {
  color: #4361ee !important;
}

[data-bs-theme="dark"] .border-left-success,
html[data-bs-theme="dark"] .border-left-success {
  border-left-color: #28a745 !important;
}

[data-bs-theme="dark"] .border-left-success .text-success,
html[data-bs-theme="dark"] .border-left-success .text-success {
  color: #28a745 !important;
}

[data-bs-theme="dark"] .border-left-warning,
html[data-bs-theme="dark"] .border-left-warning {
  border-left-color: #ff9800 !important;
}

[data-bs-theme="dark"] .border-left-warning .text-warning,
html[data-bs-theme="dark"] .border-left-warning .text-warning {
  color: #ff9800 !important;
}

[data-bs-theme="dark"] .border-left-danger,
html[data-bs-theme="dark"] .border-left-danger {
  border-left-color: #dc3545 !important;
}

[data-bs-theme="dark"] .border-left-danger .text-danger,
html[data-bs-theme="dark"] .border-left-danger .text-danger {
  color: #dc3545 !important;
}

[data-bs-theme="dark"] .text-primary {
  color: var(--primary) !important;
}

[data-bs-theme="dark"] .text-success {
  color: var(--success) !important;
}

[data-bs-theme="dark"] .text-warning {
  color: var(--warning) !important;
}

[data-bs-theme="dark"] .text-danger {
  color: var(--danger) !important;
}

/* Улучшаем видимость всех текстовых элементов */
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] div {
  color: inherit;
}

[data-bs-theme="dark"] .card-body .text-muted,
[data-bs-theme="dark"] .card-body small {
  color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .table .text-muted {
  color: #cbd5e0 !important;
}

/* Стили для строк таблиц с предупреждениями */
[data-bs-theme="dark"] .table-warning {
  background-color: rgba(247, 37, 133, 0.1) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-warning td,
[data-bs-theme="dark"] .table-warning th {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-danger {
  background-color: rgba(230, 57, 70, 0.1) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-danger td,
[data-bs-theme="dark"] .table-danger th {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-secondary {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table-secondary td,
[data-bs-theme="dark"] .table-secondary th {
  color: var(--text-primary) !important;
}

/* Стили для всех строк таблиц в темной теме */
[data-bs-theme="dark"] .table tbody tr {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table tbody tr td {
  background-color: inherit !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background-color: var(--bg-tertiary) !important;
}

[data-bs-theme="dark"] .table tbody tr:hover td {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .bg-white {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .border {
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .modal-content {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .modal-header {
  border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .modal-footer {
  border-top-color: var(--border-color);
}

[data-bs-theme="dark"] .list-group-item {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .list-group-item:hover {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .alert {
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .alert-info {
  background-color: rgba(76, 201, 240, 0.15);
  color: #4cc9f0;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(247, 37, 133, 0.15);
  color: #f72585;
}

[data-bs-theme="dark"] .alert-success {
  background-color: rgba(76, 201, 240, 0.15);
  color: #4cc9f0;
}

[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(230, 57, 70, 0.15);
  color: #e63946;
}

[data-bs-theme="dark"] .stat-card {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .stat-card .stat-label {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .navbar-light {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
  color: var(--primary) !important;
}

[data-bs-theme="dark"] code {
  background-color: var(--bg-tertiary);
  color: #4cc9f0;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

[data-bs-theme="dark"] pre {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .badge {
  border-color: transparent;
}

[data-bs-theme="dark"] .sidebar {
  background-color: var(--bg-secondary);
  border-right-color: var(--border-color);
}

[data-bs-theme="dark"] .sidebar .nav-link {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .sidebar .nav-link.active {
  background-color: var(--bg-tertiary);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

[data-bs-theme="dark"] .btn-outline-light {
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .btn-outline-light:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: var(--primary);
  color: white;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--text-secondary);
  color: var(--bg-primary);
}

[data-bs-theme="dark"] .btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
  background-color: var(--danger);
  color: white;
}

[data-bs-theme="dark"] .btn-outline-success {
  border-color: var(--success);
  color: var(--success);
}

[data-bs-theme="dark"] .btn-outline-success:hover {
  background-color: var(--success);
  color: white;
}

[data-bs-theme="dark"] .pagination .page-link {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .pagination .page-link:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
}

[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .admin-sidebar {
  background-color: var(--bg-secondary);
}

[data-bs-theme="dark"] .admin-sidebar .nav-link {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .admin-sidebar .nav-link:hover {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .admin-sidebar .nav-link.active {
  background-color: var(--bg-tertiary);
}

/* Дополнительные стили для темной темы */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .lead {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .text-dark {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .text-gray-800 {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .text-gray-300 {
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .small,
[data-bs-theme="dark"] small {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .card-footer {
  background-color: var(--bg-tertiary);
  border-top-color: var(--border-color);
}

[data-bs-theme="dark"] .card-title {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .card-text {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .navbar-light .navbar-brand {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-toggler {
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28226, 232, 240, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] footer {
  background-color: var(--bg-secondary) !important;
  border-top-color: var(--border-color);
}

[data-bs-theme="dark"] footer .text-muted {
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .testimonial-card {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .demo-card {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary);
}

[data-bs-theme="dark"] .feature-card {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .feature-card .text-muted {
  color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .demo-container {
  background-color: rgba(26, 31, 46, 0.5);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .cta-section {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .border-left-primary,
[data-bs-theme="dark"] .border-left-success,
[data-bs-theme="dark"] .border-left-warning,
[data-bs-theme="dark"] .border-left-danger {
  border-left-color: var(--primary) !important;
}

[data-bs-theme="dark"] .shadow {
  box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .bg-white {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .bg-gray-100 {
  background-color: var(--bg-tertiary) !important;
}

[data-bs-theme="dark"] .bg-gray-200 {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .border-gray-300 {
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .rounded {
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .input-group-text {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-label {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .form-text {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .nav-tabs {
  border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: var(--text-primary);
  border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: var(--border-color);
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--bg-secondary);
  border-color: var(--border-color) var(--border-color) var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .breadcrumb {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .breadcrumb-item a {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .badge {
  color: white;
}

[data-bs-theme="dark"] .badge.bg-secondary {
  background-color: var(--text-secondary) !important;
}

[data-bs-theme="dark"] .progress {
  background-color: var(--bg-tertiary);
}

[data-bs-theme="dark"] .tooltip .tooltip-inner {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .popover {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .popover-header {
  background-color: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .popover-body {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .accordion-item {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .accordion-button {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .accordion-body {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .offcanvas {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .offcanvas-header {
  border-bottom-color: var(--border-color);
}

[data-bs-theme="dark"] .offcanvas-body {
  color: var(--text-primary);
}

/* Навигация для главной страницы */
[data-bs-theme="dark"] #mainNavbar {
  background-color: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color);
}

[data-bs-theme="dark"] #mainNavbar .navbar-brand {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] #mainNavbar .nav-link {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] #mainNavbar .nav-link:hover {
  color: var(--primary) !important;
}

/* Секции с bg-light */
[data-bs-theme="dark"] section.bg-light {
  background-color: var(--bg-secondary) !important;
}

/* Карточки тарифов */
[data-bs-theme="dark"] .card-header.bg-white {
  background-color: var(--bg-tertiary) !important;
}

[data-bs-theme="dark"] .card-header.bg-white h4,
[data-bs-theme="dark"] .card-header.bg-white .display-4,
[data-bs-theme="dark"] .card-header.bg-white small {
  color: var(--text-primary) !important;
}

/* Плавные переходы для основных элементов */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .btn,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .table {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Дополнительные стили для навигации */
[data-bs-theme="dark"] .navbar-light {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-brand {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
  color: var(--primary) !important;
  background-color: rgba(67, 97, 238, 0.1);
}

[data-bs-theme="dark"] .navbar-light .navbar-toggler {
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28226, 232, 240, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Стили для футера */
[data-bs-theme="dark"] footer.bg-dark {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] footer.bg-light {
  background-color: var(--bg-secondary) !important;
}

/* Футер с цветом бокового меню - не перезаписываем градиент */
[data-bs-theme="dark"] footer.footer-sidebar {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%) !important;
}

/* Белый цвет текста в футере для темной темы */
[data-bs-theme="dark"] footer.footer-sidebar p,
[data-bs-theme="dark"] footer.footer-sidebar .text-white {
  color: #ffffff !important;
}

/* Стили для секций */
[data-bs-theme="dark"] section {
  color: var(--text-primary);
}

[data-bs-theme="dark"] section.bg-light {
  background-color: var(--bg-secondary) !important;
}

/* Стили для карточек тарифов */
[data-bs-theme="dark"] .card-header.bg-white {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .card-header.bg-white h4,
[data-bs-theme="dark"] .card-header.bg-white .display-4,
[data-bs-theme="dark"] .card-header.bg-white small {
  color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .card-body .text-muted {
  color: var(--text-secondary) !important;
}

/* Стили для демо-карточек */
[data-bs-theme="dark"] .demo-card.bg-white {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary);
}

/* Стили для отзывов */
[data-bs-theme="dark"] .testimonial-card {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Стили для hero секции (оставляем градиент, но делаем темнее) */
[data-bs-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
}

/* Стили для feature-card */
[data-bs-theme="dark"] .feature-card {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary);
}

[data-bs-theme="dark"] .feature-card h4 {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .feature-card .text-muted {
  color: var(--text-secondary) !important;
}

/* Стили для счетчиков */
[data-bs-theme="dark"] .counter {
  color: var(--text-primary) !important;
}

/* Стили для текста */
[data-bs-theme="dark"] .text-white-50 {
  color: rgba(226, 232, 240, 0.5) !important;
}

[data-bs-theme="dark"] .text-light-emphasis {
  color: var(--text-secondary) !important;
}
/* ============================================
   КРИТИЧЕСКИ ВАЖНО: Стили светлой темы в конце файла
   для переопределения всех темных стилей
   ============================================ */

/* Принудительное переопределение всех элементов для светлой темы */
html[data-bs-theme="light"] body {
    background-color: #fafbfc !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .card,
html[data-bs-theme="light"] .card-header,
html[data-bs-theme="light"] .card-body,
html[data-bs-theme="light"] .card-footer {
    background-color: #ffffff !important;
    color: #343a40 !important;
    border-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .table,
html[data-bs-theme="light"] .table thead,
html[data-bs-theme="light"] .table tbody,
html[data-bs-theme="light"] .table th,
html[data-bs-theme="light"] .table td {
    background-color: #ffffff !important;
    color: #343a40 !important;
    border-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .table thead th {
    background-color: #f8f9fa !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .table tbody tr {
    background-color: #ffffff !important;
}

html[data-bs-theme="light"] .table tbody tr:hover {
    background-color: #f8f9fa !important;
}

html[data-bs-theme="light"] .navbar-light {
    background-color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-light .navbar-nav .nav-link {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .sidebar {
    background-color: #f8f9fa !important;
}

html[data-bs-theme="light"] .sidebar .nav-link {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .text-muted,
html[data-bs-theme="light"] small {
    color: #495057 !important;
}

html[data-bs-theme="light"] .form-control,
html[data-bs-theme="light"] .form-select {
    background-color: #ffffff !important;
    color: #343a40 !important;
    border-color: #ced4da !important;
}

html[data-bs-theme="light"] .dropdown-menu {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .dropdown-item {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .modal-content {
    background-color: #ffffff !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .bg-light {
    background-color: #f8f9fa !important;
}

html[data-bs-theme="light"] .bg-white {
    background-color: #ffffff !important;
}

/* Переопределение всех текстовых элементов для светлой темы */
html[data-bs-theme="light"] .text-muted,
html[data-bs-theme="light"] small,
html[data-bs-theme="light"] .small,
html[data-bs-theme="light"] .text-body-secondary {
    color: #495057 !important;
    opacity: 1 !important;
}

html[data-bs-theme="light"] .text-gray-600,
html[data-bs-theme="light"] .text-gray-700,
html[data-bs-theme="light"] .text-gray-800,
html[data-bs-theme="light"] * .text-gray-600,
html[data-bs-theme="light"] * .text-gray-700,
html[data-bs-theme="light"] * .text-gray-800,
html[data-bs-theme="light"] .card .text-gray-800,
html[data-bs-theme="light"] .card-body .text-gray-800,
html[data-bs-theme="light"] .h5.text-gray-800,
html[data-bs-theme="light"] div.text-gray-800,
html[data-bs-theme="light"] span.text-gray-800 {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .text-secondary {
    color: #495057 !important;
}

html[data-bs-theme="light"] p,
html[data-bs-theme="light"] span,
html[data-bs-theme="light"] div,
html[data-bs-theme="light"] h1,
html[data-bs-theme="light"] h2,
html[data-bs-theme="light"] h3,
html[data-bs-theme="light"] h4,
html[data-bs-theme="light"] h5,
html[data-bs-theme="light"] h6 {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .card-body .text-muted,
html[data-bs-theme="light"] .card-body small {
    color: #495057 !important;
}

html[data-bs-theme="light"] .table .text-muted {
    color: #495057 !important;
}

/* Таблицы - полное переопределение */
html[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-bs-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: #f8f9fa !important;
}

html[data-bs-theme="light"] .table-hover tbody tr:hover {
    background-color: #f8f9fa !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .table-hover tbody tr:hover td,
html[data-bs-theme="light"] .table-hover tbody tr:hover th {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .table-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

html[data-bs-theme="light"] .table-warning td,
html[data-bs-theme="light"] .table-warning th {
    color: #856404 !important;
}

html[data-bs-theme="light"] .table-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

html[data-bs-theme="light"] .table-danger td,
html[data-bs-theme="light"] .table-danger th {
    color: #721c24 !important;
}

html[data-bs-theme="light"] .table-secondary {
    background-color: #e9ecef !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .table-secondary td,
html[data-bs-theme="light"] .table-secondary th {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .table-sm th,
html[data-bs-theme="light"] .table-sm td {
    color: #343a40 !important;
}

/* Формы */
html[data-bs-theme="light"] .form-control:focus,
html[data-bs-theme="light"] .form-select:focus {
    background-color: #ffffff !important;
    border-color: #80bdff !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .form-control::placeholder {
    color: #6c757d !important;
}

html[data-bs-theme="light"] .lead {
    color: #495057 !important;
}

/* Dropdown */
html[data-bs-theme="light"] .dropdown-item:hover,
html[data-bs-theme="light"] .dropdown-item:focus {
    background-color: #f8f9fa !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .dropdown-divider {
    border-color: #dee2e6 !important;
}

/* Modal */
html[data-bs-theme="light"] .modal-header {
    border-bottom-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .modal-footer {
    border-top-color: #dee2e6 !important;
}

/* List group */
html[data-bs-theme="light"] .list-group-item {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .list-group-item:hover {
    background-color: #f8f9fa !important;
}

/* Alerts */
html[data-bs-theme="light"] .alert {
    border-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .alert-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

html[data-bs-theme="light"] .alert-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

html[data-bs-theme="light"] .alert-success {
    background-color: #d4edda !important;
    color: #155724 !important;
}

html[data-bs-theme="light"] .alert-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Stat cards */
html[data-bs-theme="light"] .stat-card {
    background-color: #ffffff !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .stat-card .stat-label {
    color: #495057 !important;
}

/* Navbar */
html[data-bs-theme="light"] .navbar-light .navbar-nav .nav-link:hover {
    color: #0d6efd !important;
}

/* Sidebar */
html[data-bs-theme="light"] .sidebar {
    border-right-color: #dee2e6 !important;
}

html[data-bs-theme="light"] .sidebar .nav-link:hover {
    background-color: #e9ecef !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .sidebar .nav-link.active {
    background-color: #e9ecef !important;
    color: #0d6efd !important;
    border-left-color: #0d6efd !important;
}

/* Buttons */
html[data-bs-theme="light"] .btn-outline-light {
    border-color: #dee2e6 !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .btn-outline-light:hover {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #343a40 !important;
}

html[data-bs-theme="light"] .btn-outline-primary {
    border-color: #0d6efd !important;
    color: #0d6efd !important;
}

html[data-bs-theme="light"] .btn-outline-primary:hover {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

html[data-bs-theme="light"] .btn-outline-secondary {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

html[data-bs-theme="light"] .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-bs-theme="light"] .btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

html[data-bs-theme="light"] .btn-outline-danger:hover {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

html[data-bs-theme="light"] .btn-outline-success {
    border-color: #198754 !important;
    color: #198754 !important;
}

html[data-bs-theme="light"] .btn-outline-success:hover {
    background-color: #198754 !important;
    color: #ffffff !important;
}

/* Pagination */
html[data-bs-theme="light"] .pagination .page-link {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
    color: #0d6efd !important;
}

html[data-bs-theme="light"] .pagination .page-link:hover {
    background-color: #e9ecef !important;
    border-color: #dee2e6 !important;
    color: #0a58ca !important;
}

html[data-bs-theme="light"] .pagination .page-item.active .page-link {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Code */
html[data-bs-theme="light"] code {
    background-color: #f8f9fa !important;
    color: #e83e8c !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.25rem !important;
}

html[data-bs-theme="light"] pre {
    background-color: #f8f9fa !important;
    color: #343a40 !important;
    border-color: #dee2e6 !important;
}

/* Badge */
html[data-bs-theme="light"] .badge {
    border-color: transparent !important;
}

/* Белый текст для статусов Онлайн/Офлайн в светлой теме */
html[data-bs-theme="light"] .badge.bg-success,
html[data-bs-theme="light"] .badge.bg-primary,
html[data-bs-theme="light"] .badge.bg-secondary,
html[data-bs-theme="light"] .badge.bg-danger,
html[data-bs-theme="light"] .badge.bg-warning {
    color: #ffffff !important;
}

/* Border */
html[data-bs-theme="light"] .border {
    border-color: #dee2e6 !important;
}

/* Карточки статистики - одинаковые цвета в обеих темах */
/* Карточки статистики - одинаковые цвета в обеих темах */
html[data-bs-theme="light"] .border-left-primary {
    border-left-color: #4361ee !important;
}

html[data-bs-theme="light"] .border-left-primary .text-primary {
    color: #4361ee !important;
}

html[data-bs-theme="light"] .border-left-primary .fa-server,
html[data-bs-theme="light"] .border-left-primary .text-gray-300 {
    color: #4361ee !important;
    opacity: 0.3;
}

html[data-bs-theme="light"] .border-left-success {
    border-left-color: #28a745 !important;
}

html[data-bs-theme="light"] .border-left-success .text-success {
    color: #28a745 !important;
}

html[data-bs-theme="light"] .border-left-success .fa-wifi,
html[data-bs-theme="light"] .border-left-success .text-gray-300 {
    color: #28a745 !important;
    opacity: 0.3;
}

html[data-bs-theme="light"] .border-left-warning {
    border-left-color: #ff9800 !important;
}

html[data-bs-theme="light"] .border-left-warning .text-warning {
    color: #ff9800 !important;
}

html[data-bs-theme="light"] .border-left-warning .fa-bell,
html[data-bs-theme="light"] .border-left-warning .text-gray-300 {
    color: #ff9800 !important;
    opacity: 0.3;
}

html[data-bs-theme="light"] .border-left-danger {
    border-left-color: #dc3545 !important;
}

html[data-bs-theme="light"] .border-left-danger .text-danger {
    color: #dc3545 !important;
}

html[data-bs-theme="light"] .border-left-danger .fa-exclamation-triangle,
html[data-bs-theme="light"] .border-left-danger .text-gray-300 {
    color: #dc3545 !important;
    opacity: 0.3;
}

/* Иконки в карточках статистики для темной темы */
[data-bs-theme="dark"] .border-left-primary .fa-server,
[data-bs-theme="dark"] .border-left-primary .text-gray-300,
html[data-bs-theme="dark"] .border-left-primary .fa-server,
html[data-bs-theme="dark"] .border-left-primary .text-gray-300 {
    color: #4361ee !important;
    opacity: 0.3;
}

[data-bs-theme="dark"] .border-left-success .fa-wifi,
[data-bs-theme="dark"] .border-left-success .text-gray-300,
html[data-bs-theme="dark"] .border-left-success .fa-wifi,
html[data-bs-theme="dark"] .border-left-success .text-gray-300 {
    color: #28a745 !important;
    opacity: 0.3;
}

[data-bs-theme="dark"] .border-left-warning .fa-bell,
[data-bs-theme="dark"] .border-left-warning .text-gray-300,
html[data-bs-theme="dark"] .border-left-warning .fa-bell,
html[data-bs-theme="dark"] .border-left-warning .text-gray-300 {
    color: #ff9800 !important;
    opacity: 0.3;
}

[data-bs-theme="dark"] .border-left-danger .fa-exclamation-triangle,
[data-bs-theme="dark"] .border-left-danger .text-gray-300,
html[data-bs-theme="dark"] .border-left-danger .fa-exclamation-triangle,
html[data-bs-theme="dark"] .border-left-danger .text-gray-300 {
    color: #dc3545 !important;
    opacity: 0.3;
}

/* Числа в карточках статистики - одинаковый цвет в обеих темах */
.border-left-primary .h5,
.border-left-primary .text-gray-800 {
    color: #343a40 !important;
}

[data-bs-theme="dark"] .border-left-primary .h5,
[data-bs-theme="dark"] .border-left-primary .text-gray-800,
html[data-bs-theme="dark"] .border-left-primary .h5,
html[data-bs-theme="dark"] .border-left-primary .text-gray-800 {
    color: #e2e8f0 !important;
}

.border-left-success .h5,
.border-left-success .text-gray-800 {
    color: #343a40 !important;
}

[data-bs-theme="dark"] .border-left-success .h5,
[data-bs-theme="dark"] .border-left-success .text-gray-800,
html[data-bs-theme="dark"] .border-left-success .h5,
html[data-bs-theme="dark"] .border-left-success .text-gray-800 {
    color: #e2e8f0 !important;
}

.border-left-warning .h5,
.border-left-warning .text-gray-800 {
    color: #343a40 !important;
}

[data-bs-theme="dark"] .border-left-warning .h5,
[data-bs-theme="dark"] .border-left-warning .text-gray-800,
html[data-bs-theme="dark"] .border-left-warning .h5,
html[data-bs-theme="dark"] .border-left-warning .text-gray-800 {
    color: #e2e8f0 !important;
}

.border-left-danger .h5,
.border-left-danger .text-gray-800 {
    color: #343a40 !important;
}

[data-bs-theme="dark"] .border-left-danger .h5,
[data-bs-theme="dark"] .border-left-danger .text-gray-800,
html[data-bs-theme="dark"] .border-left-danger .h5,
html[data-bs-theme="dark"] .border-left-danger .text-gray-800 {
    color: #e2e8f0 !important;
}

/* Text colors */
html[data-bs-theme="light"] .text-primary {
    color: #0d6efd !important;
}


html[data-bs-theme="light"] .font-weight-bold {
    color: #343a40 !important;
}

html[data-bs-theme="light"] .text-xs {
    color: #495057 !important;
}

html[data-bs-theme="light"] .text-uppercase {
    color: inherit !important;
}

/* СПЕЦИФИЧНОЕ ПЕРЕОПРЕДЕЛЕНИЕ ТОЛЬКО ДЛЯ СЕРЫХ ТЕКСТОВ */
/* Применяется только к элементам с классом text-muted БЕЗ цветных классов */
/* Используем более простой подход - применяем только к элементам с text-muted и без цветных классов */
html[data-bs-theme="light"] .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] span.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] small.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .small.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] p.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] div.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] td.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] th.text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .card .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .card-body .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .card-header .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .table .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .table td .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .table th .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .table tbody .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .table thead .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .navbar .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .modal .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .modal-body .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .dropdown-menu .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .list-group .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .alert .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .btn .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .form-control .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .form-label .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info) {
    color: #495057 !important;
    opacity: 1 !important;
}

/* Заголовок "Администрирование" в сайдбаре должен быть белым */
html[data-bs-theme="light"] .sidebar .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info),
html[data-bs-theme="light"] .custom-sidebar .text-muted:not(.text-success):not(.text-warning):not(.text-danger):not(.text-primary):not(.text-info) {
    color: #ffffff !important;
    opacity: 1 !important;
}

html[data-bs-theme="light"] * .text-secondary,
html[data-bs-theme="light"] .text-secondary *,
html[data-bs-theme="light"] span.text-secondary,
html[data-bs-theme="light"] small.text-secondary,
html[data-bs-theme="light"] .small.text-secondary,
html[data-bs-theme="light"] p.text-secondary,
html[data-bs-theme="light"] div.text-secondary {
    color: #495057 !important;
}

html[data-bs-theme="light"] * .text-gray-600,
html[data-bs-theme="light"] * .text-gray-700,
html[data-bs-theme="light"] * .text-gray-800,
html[data-bs-theme="light"] .card .text-gray-800,
html[data-bs-theme="light"] .card-body .text-gray-800,
html[data-bs-theme="light"] .h5.text-gray-800,
html[data-bs-theme="light"] div.text-gray-800,
html[data-bs-theme="light"] span.text-gray-800 {
    color: #343a40 !important;
}

/* Переопределение для всех элементов с классом lead */
html[data-bs-theme="light"] .lead,
html[data-bs-theme="light"] p.lead,
html[data-bs-theme="light"] div.lead,
html[data-bs-theme="light"] .card .lead,
html[data-bs-theme="light"] .card-body .lead {
    color: #495057 !important;
}

/* Переопределение для всех элементов с классом stat-label */
html[data-bs-theme="light"] .stat-label,
html[data-bs-theme="light"] .stat-card .stat-label,
html[data-bs-theme="light"] * .stat-label {
    color: #495057 !important;
}

/* Переопределение для всех элементов с классом form-label */
html[data-bs-theme="light"] .form-label,
html[data-bs-theme="light"] label.form-label,
html[data-bs-theme="light"] * .form-label {
    color: #343a40 !important;
}

/* КРИТИЧЕСКИ ВАЖНО: Цветные статусы в самом конце для переопределения всех серых стилей */
/* Эти стили должны быть ПОСЛЕ всех остальных стилей для светлой темы */
html[data-bs-theme="light"] .text-success,
html[data-bs-theme="light"] * .text-success,
html[data-bs-theme="light"] span.text-success,
html[data-bs-theme="light"] small.text-success,
html[data-bs-theme="light"] .small.text-success,
html[data-bs-theme="light"] span.small.text-success,
html[data-bs-theme="light"] .text-success *,
html[data-bs-theme="light"] .card .text-success,
html[data-bs-theme="light"] .card-body .text-success,
html[data-bs-theme="light"] .table .text-success,
html[data-bs-theme="light"] .table td .text-success,
html[data-bs-theme="light"] .table th .text-success,
html[data-bs-theme="light"] .table tbody .text-success,
html[data-bs-theme="light"] .table thead .text-success {
    color: #198754 !important;
}

html[data-bs-theme="light"] .text-warning,
html[data-bs-theme="light"] * .text-warning,
html[data-bs-theme="light"] span.text-warning,
html[data-bs-theme="light"] small.text-warning,
html[data-bs-theme="light"] .small.text-warning,
html[data-bs-theme="light"] span.small.text-warning,
html[data-bs-theme="light"] .text-warning *,
html[data-bs-theme="light"] .card .text-warning,
html[data-bs-theme="light"] .card-body .text-warning,
html[data-bs-theme="light"] .table .text-warning,
html[data-bs-theme="light"] .table td .text-warning,
html[data-bs-theme="light"] .table th .text-warning,
html[data-bs-theme="light"] .table tbody .text-warning,
html[data-bs-theme="light"] .table thead .text-warning {
    color: #ffc107 !important;
}

html[data-bs-theme="light"] .text-danger,
html[data-bs-theme="light"] * .text-danger,
html[data-bs-theme="light"] span.text-danger,
html[data-bs-theme="light"] small.text-danger,
html[data-bs-theme="light"] .small.text-danger,
html[data-bs-theme="light"] span.small.text-danger,
html[data-bs-theme="light"] .text-danger *,
html[data-bs-theme="light"] .card .text-danger,
html[data-bs-theme="light"] .card-body .text-danger,
html[data-bs-theme="light"] .table .text-danger,
html[data-bs-theme="light"] .table td .text-danger,
html[data-bs-theme="light"] .table th .text-danger,
html[data-bs-theme="light"] .table tbody .text-danger,
html[data-bs-theme="light"] .table thead .text-danger {
    color: #dc3545 !important;
}

/* Стили для навбара в светлой теме - белые иконки и текст на синем фоне */
html[data-bs-theme="light"] .navbar-dark i,
html[data-bs-theme="light"] .navbar-dark .fa,
html[data-bs-theme="light"] .navbar-dark .fas,
html[data-bs-theme="light"] .navbar-dark .far,
html[data-bs-theme="light"] .navbar-dark .fab,
html[data-bs-theme="light"] .navbar-dark .fal,
html[data-bs-theme="light"] .navbar.bg-primary i,
html[data-bs-theme="light"] .navbar.bg-primary .fa,
html[data-bs-theme="light"] .navbar.bg-primary .fas,
html[data-bs-theme="light"] .navbar.bg-primary .far,
html[data-bs-theme="light"] .navbar.bg-primary .fab {
    color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-dark .btn-outline-light,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light i,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light .fa,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light .fas,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light i,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light .fa,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light .fas {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

html[data-bs-theme="light"] .navbar-dark .btn-outline-light:hover,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light:hover i,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light:hover .fa,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light:hover .fas,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light:hover,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light:hover i,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light:hover .fa,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light:hover .fas {
    color: #ffffff !important;
    border-color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-bs-theme="light"] .navbar-dark .nav-link,
html[data-bs-theme="light"] .navbar-dark .nav-link i,
html[data-bs-theme="light"] .navbar-dark .nav-link .fa,
html[data-bs-theme="light"] .navbar-dark .nav-link .fas,
html[data-bs-theme="light"] .navbar.bg-primary .nav-link,
html[data-bs-theme="light"] .navbar.bg-primary .nav-link i,
html[data-bs-theme="light"] .navbar.bg-primary .nav-link .fa,
html[data-bs-theme="light"] .navbar.bg-primary .nav-link .fas {
    color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-dark .dropdown-toggle,
html[data-bs-theme="light"] .navbar-dark .dropdown-toggle i,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle i {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Стрелка dropdown (::after) - только цвет границы, не весь border */
html[data-bs-theme="light"] .navbar-dark .dropdown-toggle::after,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle::after {
    border-top-color: #ffffff !important;
}

/* Кнопки остаются белыми при открытом меню (состояние show) */
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show i,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show .fa,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show .fas,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show i,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show .fa,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show .fas {
    color: #ffffff !important;
    border-color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show:hover,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show:hover i,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show:hover .fa,
html[data-bs-theme="light"] .navbar-dark .btn-outline-light.show:hover .fas,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show:hover,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show:hover i,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show:hover .fa,
html[data-bs-theme="light"] .navbar.bg-primary .btn-outline-light.show:hover .fas {
    color: #ffffff !important;
    border-color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Кнопки dropdown-toggle остаются белыми при открытом меню */
html[data-bs-theme="light"] .navbar-dark .dropdown-toggle.show,
html[data-bs-theme="light"] .navbar-dark .dropdown-toggle.show i,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle.show,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle.show i {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Стрелка dropdown при открытом меню */
html[data-bs-theme="light"] .navbar-dark .dropdown-toggle.show::after,
html[data-bs-theme="light"] .navbar.bg-primary .dropdown-toggle.show::after {
    border-top-color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-dark .navbar-text,
html[data-bs-theme="light"] .navbar-dark .navbar-brand,
html[data-bs-theme="light"] .navbar-dark .navbar-brand i,
html[data-bs-theme="light"] .navbar.bg-primary .navbar-text,
html[data-bs-theme="light"] .navbar.bg-primary .navbar-brand,
html[data-bs-theme="light"] .navbar.bg-primary .navbar-brand i {
    color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-dark .badge,
html[data-bs-theme="light"] .navbar.bg-primary .badge {
    color: #ffffff !important;
}

/* Дополнительные стили для текста в навбаре */
html[data-bs-theme="light"] .navbar-dark,
html[data-bs-theme="light"] .navbar.bg-primary {
    color: #ffffff !important;
}

html[data-bs-theme="light"] .navbar-dark *,
html[data-bs-theme="light"] .navbar.bg-primary * {
    color: inherit;
}

html[data-bs-theme="light"] .navbar-dark span:not(.badge),
html[data-bs-theme="light"] .navbar.bg-primary span:not(.badge) {
    color: #ffffff !important;
}

/* Белый текст для hero-section в светлой теме */
html[data-bs-theme="light"] .hero-section,
html[data-bs-theme="light"] .hero-section *,
html[data-bs-theme="light"] .hero-section h1,
html[data-bs-theme="light"] .hero-section h2,
html[data-bs-theme="light"] .hero-section h3,
html[data-bs-theme="light"] .hero-section h4,
html[data-bs-theme="light"] .hero-section h5,
html[data-bs-theme="light"] .hero-section h6,
html[data-bs-theme="light"] .hero-section p,
html[data-bs-theme="light"] .hero-section .lead,
html[data-bs-theme="light"] .hero-section .text-white,
html[data-bs-theme="light"] .hero-section .text-white-50,
html[data-bs-theme="light"] .hero-section i,
html[data-bs-theme="light"] .hero-section .fa,
html[data-bs-theme="light"] .hero-section .fas,
html[data-bs-theme="light"] .hero-section .far,
html[data-bs-theme="light"] .hero-section .fab {
    color: #ffffff !important;
}

html[data-bs-theme="light"] .hero-section .text-white-50 {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Черный текст для кнопки btn-light в hero-section в светлой теме */
html[data-bs-theme="light"] .hero-section .btn-light,
html[data-bs-theme="light"] .hero-section .btn-light *,
html[data-bs-theme="light"] .hero-section .btn-light i,
html[data-bs-theme="light"] .hero-section .btn-light .fa,
html[data-bs-theme="light"] .hero-section .btn-light .fas {
    color: #000000 !important;
}

/* Темная иконка справа в hero-section в светлой теме для лучшей видимости */
html[data-bs-theme="light"] .hero-section .bg-white.bg-opacity-10 i,
html[data-bs-theme="light"] .hero-section .bg-white.bg-opacity-10 .fa,
html[data-bs-theme="light"] .hero-section .bg-white.bg-opacity-10 .fas,
html[data-bs-theme="light"] .hero-section .bg-white.bg-opacity-10 .text-white-50 {
    color: rgba(0, 0, 0, 0.7) !important;
}

/* Более контрастный фон для контейнера с иконкой в светлой теме */
html[data-bs-theme="light"] .hero-section .bg-white.bg-opacity-10 {
    background-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}
