*, *::before, *::after {
    transition: background-color 0.3s ease, color 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease !important;
}
img, svg { transition: none !important; }



html:not(.dark) body {
    background-color: #f0fdf4 !important;
    color: #111827 !important;
}


html:not(.dark) header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #6ee7b7 !important;
    box-shadow: 0 1px 16px rgba(5,150,105,0.13), 0 1px 0 rgba(16,185,129,0.10) !important;
}
html:not(.dark) header a,
html:not(.dark) header button {
    color: #374151 !important;
}
html:not(.dark) header a:hover,
html:not(.dark) header button:hover {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}
html:not(.dark) header .text-primary-400 {
    color: #047857 !important;
}

html:not(.dark) .bg-gray-900 { background-color: #f0fdf4 !important; }
html:not(.dark) .bg-gray-800 {
    background-color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(5,150,105,0.08), 0 0 0 1px rgba(110,231,183,0.35) !important;
}
html:not(.dark) .bg-gray-700 { background-color: #ecfdf5 !important; }
html:not(.dark) .bg-gray-750 { background-color: #f0fdf4 !important; }
html:not(.dark) .bg-gray-600 { background-color: #d1fae5 !important; }
html:not(.dark) .bg-gray-500 { background-color: #bbf7d0 !important; }

html:not(.dark) .hover\:bg-gray-700:hover { background-color: #d1fae5 !important; }
html:not(.dark) .hover\:bg-gray-600:hover { background-color: #bbf7d0 !important; }
html:not(.dark) .hover\:bg-gray-800:hover { background-color: #ecfdf5 !important; }
html:not(.dark) .hover\:bg-gray-750:hover { background-color: #ecfdf5 !important; }


html:not(.dark) .text-white    { color: #111827 !important; }
html:not(.dark) .text-gray-100 { color: #1f2937 !important; }
html:not(.dark) .text-gray-200 { color: #374151 !important; }
html:not(.dark) .text-gray-300 { color: #4b5563 !important; }
html:not(.dark) .text-gray-400 { color: #6b7280 !important; }
html:not(.dark) .text-gray-500 { color: #9ca3af !important; }
html:not(.dark) .text-gray-600 { color: #9ca3af !important; }

html:not(.dark) .hover\:text-white:hover    { color: #065f46 !important; }
html:not(.dark) .hover\:text-gray-100:hover { color: #1f2937 !important; }
html:not(.dark) .hover\:text-gray-300:hover { color: #4b5563 !important; }


html:not(.dark) .text-primary-400 { color: #047857 !important; }
html:not(.dark) .hover\:underline  { color: #047857 !important; }


html:not(.dark) .bg-blue-600,
html:not(.dark) .bg-primary-600 {
    background-color: #059669 !important;
}
html:not(.dark) .bg-blue-600:hover,
html:not(.dark) .hover\:bg-blue-600:hover,
html:not(.dark) .bg-primary-600:hover,
html:not(.dark) .hover\:bg-primary-600:hover,
html:not(.dark) .hover\:bg-primary-700:hover,
html:not(.dark) .hover\:bg-blue-500:hover {
    background-color: #047857 !important;
}
html:not(.dark) .bg-blue-500 { background-color: #10b981 !important; }


html:not(.dark) .text-blue-400,
html:not(.dark) .text-blue-600 { color: #059669 !important; }
html:not(.dark) .hover\:text-blue-300:hover,
html:not(.dark) .hover\:text-blue-400:hover { color: #047857 !important; }


html:not(.dark) .border-blue-600 { border-color: #059669 !important; }


html:not(.dark) .focus\:ring-blue-500:focus {
    --tw-ring-color: rgba(5,150,105,0.35) !important;
}
html:not(.dark) .focus\:border-blue-500:focus {
    border-color: #059669 !important;
}


html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) input[type="password"],
html:not(.dark) input[type="number"],
html:not(.dark) input[type="search"],
html:not(.dark) input[type="tel"],
html:not(.dark) textarea,
html:not(.dark) select {
    background-color: #f0fdf4 !important;
    color: #111827 !important;
    border-color: #a7f3d0 !important;
}
html:not(.dark) input:focus,
html:not(.dark) textarea:focus,
html:not(.dark) select:focus {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12) !important;
    outline: none !important;
}
html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder { color: #9ca3af !important; }


html:not(.dark) .border-gray-700 { border-color: #bbf7d0 !important; }
html:not(.dark) .border-gray-600 { border-color: #a7f3d0 !important; }
html:not(.dark) .border-gray-500 { border-color: #a7f3d0 !important; }
html:not(.dark) .divide-gray-700 > * + * { border-color: #bbf7d0 !important; }
html:not(.dark) .divide-gray-600 > * + * { border-color: #a7f3d0 !important; }


html:not(.dark) .shadow-sm  { box-shadow: 0 1px 3px rgba(5,150,105,0.07) !important; }
html:not(.dark) .shadow     { box-shadow: 0 1px 6px rgba(5,150,105,0.09) !important; }
html:not(.dark) .shadow-md  { box-shadow: 0 2px 10px rgba(5,150,105,0.10) !important; }
html:not(.dark) .shadow-lg  { box-shadow: 0 4px 18px rgba(5,150,105,0.12) !important; }
html:not(.dark) .shadow-xl  { box-shadow: 0 8px 28px rgba(5,150,105,0.14) !important; }
html:not(.dark) .shadow-2xl { box-shadow: 0 12px 40px rgba(5,150,105,0.16) !important; }
html:not(.dark) .hover\:shadow-primary-500\/20:hover {
    box-shadow: 0 6px 24px rgba(5,150,105,0.22) !important;
}


html:not(.dark) #authModal > div,
html:not(.dark) #resetKeyModal > div,
html:not(.dark) #logoutModal > div {
    background-color: #ffffff !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: 0 12px 40px rgba(5,150,105,0.15) !important;
}


html:not(.dark) .animate-pulse .bg-gray-700 { background-color: #d1fae5 !important; }
html:not(.dark) .animate-pulse .bg-gray-600 { background-color: #bbf7d0 !important; }


html:not(.dark) aside .bg-gray-800 {
    background-color: #ffffff !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: 0 2px 8px rgba(5,150,105,0.07) !important;
}


html:not(.dark) .bg-gray-700\/60 { background-color: rgba(209,250,229,0.8) !important; }
html:not(.dark) .hover\:bg-primary-600\/20:hover { background-color: rgba(5,150,105,0.15) !important; }


html:not(.dark) section.mb-12.rounded-2xl.bg-gradient-to-r {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%) !important;
    border: 1px solid #6ee7b7 !important;
    box-shadow: none !important;
}
html:not(.dark) section.mb-12.rounded-2xl.bg-gradient-to-r h1 { color: #064e3b !important; }
html:not(.dark) section.mb-12.rounded-2xl.bg-gradient-to-r p  { color: #065f46 !important; }
html:not(.dark) section.mb-12.rounded-2xl.bg-gradient-to-r .text-primary-400 { color: #059669 !important; }


html:not(.dark) ::-webkit-scrollbar { width: 8px; height: 8px; }
html:not(.dark) ::-webkit-scrollbar-track { background: #f0fdf4; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: #a7f3d0; border-radius: 4px; }
html:not(.dark) ::-webkit-scrollbar-thumb:hover { background: #6ee7b7; }


html:not(.dark) .select2-container--default .select2-selection--single,
html:not(.dark) .select2-container--default .select2-selection--multiple {
    background-color: #f0fdf4 !important;
    border-color: #a7f3d0 !important;
    color: #111827 !important;
}
html:not(.dark) .select2-dropdown {
    background-color: #ffffff !important;
    border-color: #a7f3d0 !important;
    box-shadow: 0 4px 16px rgba(5,150,105,0.12) !important;
}
html:not(.dark) .select2-results__option { color: #111827 !important; }
html:not(.dark) .select2-results__option--highlighted {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}




html:not(.dark) footer {
    background-color: #ffffff !important;
    border-top: 1px solid #6ee7b7 !important;
    box-shadow: 0 -1px 16px rgba(5,150,105,0.13),
                0 -1px 0 rgba(16,185,129,0.10) !important;
}

html:not(.dark) footer,
html:not(.dark) footer p,
html:not(.dark) footer span,
html:not(.dark) footer a {
    color: #374151 !important;
}

html:not(.dark) footer a:hover {
    color: #047857 !important;
}


html:not(.dark) .bg-blue-600,
html:not(.dark) .bg-blue-500,
html:not(.dark) .bg-red-600,
html:not(.dark) .bg-red-500,
html:not(.dark) .bg-primary-600,
html:not(.dark) .bg-primary-700,
html:not(.dark) .bg-primary-500 {
    color: #ffffff !important;
}


html:not(.dark) .bg-blue-600 * ,
html:not(.dark) .bg-blue-500 * ,
html:not(.dark) .bg-red-600 * ,
html:not(.dark) .bg-red-500 * ,
html:not(.dark) .bg-primary-600 * ,
html:not(.dark) .bg-primary-700 * ,
html:not(.dark) .bg-primary-500 * {
    color:  #ffffff !important;
    fill:   #ffffff !important;
    stroke: #ffffff !important;
}


html:not(.dark) a[title][class*="icon-"],
html:not(.dark) a[title][class*=" icon-"],
html:not(.dark) a[class*="icon-"][href*="login"] {
    color: #ffffff !important;
}

html:not(.dark) a[title][class*="icon-"] *,
html:not(.dark) a[class*="icon-"][href*="login"] * {
    color:  #ffffff !important;
    fill:   #ffffff !important;
    stroke: #ffffff !important;
}

html:not(.dark) .bg-zinc-500\/20 {
    background-color: #e5e7eb !important;
    color: #374151 !important;
    border-color: #9ca3af !important;
}


html:not(.dark) .bg-sky-500\/20 {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #7dd3fc !important;
}


html:not(.dark) .bg-indigo-500\/20 {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
    border-color: #a5b4fc !important;
}


html:not(.dark) .bg-emerald-500\/20,
html:not(.dark) .bg-emerald-500\/25 {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border-color: #6ee7b7 !important;
}


html:not(.dark) .bg-red-500\/20,
html:not(.dark) .bg-red-500\/25 {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}


html:not(.dark) .bg-amber-500\/20 {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
}

/* ===== SELECT2 dark theme fix ===== */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: #1f2937 !important; /* gray-800 */
    border: 1px solid #4b5563 !important; /* gray-600 */
    color: #f3f4f6 !important;
    border-radius: 0.5rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #374151 !important; /* gray-700 */
    border: 1px solid #6b7280 !important;
    color: #e5e7eb !important;
}

.select2-container--default .select2-selection__rendered {
    color: #f3f4f6 !important;
}

.select2-container--default .select2-selection__placeholder {
    color: #9ca3af !important; /* gray-400 */
}

.select2-dropdown {
    background-color: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #f3f4f6 !important;
}

.select2-container--default .select2-results__option {
    color: #e5e7eb !important;
    background-color: #1f2937 !important;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: #3b82f6 !important; /* primary-500 */
    color: #ffffff !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: #111827 !important; /* gray-900 */
    border: 1px solid #4b5563 !important;
    color: #f3f4f6 !important;
    border-radius: 0.375rem;
}

/* Нативные select в тёмной теме */
select {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

/* =====================================================
   ТЁМНАЯ ТЕМА
   ...

 */

html.dark header {
    box-shadow: 0 1px 20px rgba(37,99,235,0.25), 0 1px 0 rgba(96,165,250,0.10) !important;
    border-bottom: 1px solid rgba(96,165,250,0.12) !important;
}

/* ===== SCROLLBAR — тёмная тема ===== */
html.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
html.dark ::-webkit-scrollbar-track {
    background: #111827;
}
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.5);
    border-radius: 4px;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.75);
    border-radius: 4px;
}


/* ===== FILE INPUT BUTTON ===== */
input[type="file"]::file-selector-button {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.2s ease;
}

/* Тёмная тема — синий primary */
html.dark input[type="file"]::file-selector-button {
    background-color: #2563eb;
    color: #ffffff;
}
html.dark input[type="file"]::file-selector-button:hover {
    background-color: #1d4ed8;
}

/* Светлая тема — зелёный */
html:not(.dark) input[type="file"]::file-selector-button {
    background-color: #059669;
    color: #ffffff;
}
html:not(.dark) input[type="file"]::file-selector-button:hover {
    background-color: #047857;
}