/* Тёмная тема активируется классом theme-dark на корневом элементе (см. theme-init.js). */

html.theme-dark body {
    background-color: #14161b !important;
    color: #e4e6eb;
}

html.theme-dark body,
html.theme-dark #wrapper,
html.theme-dark #page-wrapper {
    background-color: #14161b !important;
}

html.theme-dark #page-wrapper {
    border-left-color: #2d333b !important;
}

html.theme-dark .navbar-default {
    background-color: #1e2229;
    border-color: #2d333b;
}

html.theme-dark .navbar-default .navbar-brand,
html.theme-dark .navbar-default .navbar-nav > li > a,
html.theme-dark .navbar-default .navbar-top-links > li > a,
html.theme-dark .navbar-default .navbar-top-links > li > a:visited {
    color: #e4e6eb;
}

html.theme-dark .navbar-default .navbar-brand:hover,
html.theme-dark .navbar-default .navbar-brand:focus {
    color: #f5f7fb;
}

html.theme-dark .navbar-default .navbar-nav > li > a:hover,
html.theme-dark .navbar-default .navbar-nav > li > a:focus {
    color: #f5f7fb;
}

html.theme-dark .navbar-default .navbar-top-links > li > a:hover,
html.theme-dark .navbar-default .navbar-top-links > li > a:focus {
    background-color: #2d333b !important;
    color: #f5f7fb !important;
}

html.theme-dark .navbar-default .navbar-top-links > li > a:hover i,
html.theme-dark .navbar-default .navbar-top-links > li > a:focus i {
    color: inherit;
}

html.theme-dark .navbar-top-links > li {
    color: #c9cdd4 !important;
}

html.theme-dark .navbar-default .navbar-toggle {
    border-color: #3d4450;
}

html.theme-dark .navbar-default .navbar-toggle .icon-bar {
    background-color: #e4e6eb;
}

html.theme-dark .sidebar {
    background-color: #181b21;
}

html.theme-dark .sidebar ul li {
    border-bottom-color: #2d333b;
}

html.theme-dark .sidebar ul li a {
    color: #c9cdd4;
    background-color: transparent;
}

html.theme-dark .sidebar ul li a:hover,
html.theme-dark .sidebar ul li a:focus {
    color: #fff;
    background-color: #252a33;
}

html.theme-dark .sidebar ul li a.active {
    background-color: #2d333b;
    color: #fff;
}

html.theme-dark .nav.nav-second-level > li > a {
    color: #b4bac4;
}

html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark h4,
html.theme-dark h5,
html.theme-dark h6 {
    color: #e8eaef;
}

html.theme-dark .page-header {
    border-bottom-color: #3d4450;
}

html.theme-dark a {
    color: #7eb8ff;
}

html.theme-dark a:hover,
html.theme-dark a:focus {
    color: #b8d9ff;
}

html.theme-dark .panel,
html.theme-dark .panel-default {
    background-color: #1e2229;
    border-color: #3d4450;
}

html.theme-dark .panel-default > .panel-heading {
    color: #e8eaef;
    background-color: #252a33;
    border-color: #3d4450;
}

html.theme-dark .panel-body {
    background-color: #1e2229;
    color: #e4e6eb;
}

html.theme-dark .panel-footer {
    background-color: #252a33;
    border-color: #3d4450;
    color: #c9cdd4;
}

html.theme-dark .table {
    color: #e4e6eb;
}

html.theme-dark .table > thead > tr > th,
html.theme-dark .table > tbody > tr > th,
html.theme-dark .table > tfoot > tr > th,
html.theme-dark .table > thead > tr > td,
html.theme-dark .table > tbody > tr > td,
html.theme-dark .table > tfoot > tr > td {
    border-color: #3d4450;
}

html.theme-dark .table > thead > tr > th {
    background-color: #252a33;
    color: #e8eaef;
}

html.theme-dark .table-striped > tbody > tr:nth-of-type(odd),
html.theme-dark table.dataTable.stripe tbody tr.odd,
html.theme-dark table.dataTable.display tbody tr.odd {
    background-color: #181b21;
}

html.theme-dark .table-hover > tbody > tr:hover,
html.theme-dark table.dataTable.hover tbody tr:hover,
html.theme-dark table.dataTable.display tbody tr:hover {
    background-color: #2a303c !important;
}

html.theme-dark .table-bordered {
    border-color: #3d4450;
}

html.theme-dark .form-control {
    background-color: #252a33;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .form-control:focus {
    border-color: #5b8bd9;
    box-shadow: 0 0 0 1px rgba(91, 139, 217, 0.35);
}

html.theme-dark .btn-default {
    background-color: #2d333b;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .btn-default:hover,
html.theme-dark .btn-default:focus {
    background-color: #3a424d;
    border-color: #4a5563;
    color: #fff;
}

html.theme-dark .btn-link {
    color: #7eb8ff;
}

html.theme-dark .btn-link:hover,
html.theme-dark .btn-link:focus {
    color: #b8d9ff;
}

html.theme-dark .well {
    background-color: #1e2229;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark hr {
    border-top-color: #3d4450;
}

html.theme-dark .text-muted {
    color: #9aa0ab !important;
}

html.theme-dark .close {
    color: #fff;
    text-shadow: none;
    opacity: 0.75;
}

html.theme-dark .alert {
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .alert-danger {
    background-color: #3d2226;
    border-color: #6b2f36;
    color: #f5c6cb;
}

html.theme-dark .alert-warning {
    background-color: #2f2a1f;
    border-color: #5c4f2e;
    color: #e8dcc4;
}

html.theme-dark .nav-tabs {
    border-bottom-color: #3d4450;
}

html.theme-dark .nav-tabs > li > a {
    color: #c9cdd4;
    background-color: #181b21;
    border-color: #3d4450;
}

html.theme-dark .nav-tabs > li > a:hover {
    border-color: #3d4450;
    background-color: #252a33;
}

html.theme-dark .nav-tabs > li.active > a,
html.theme-dark .nav-tabs > li.active > a:hover,
html.theme-dark .nav-tabs > li.active > a:focus {
    color: #e8eaef;
    background-color: #1e2229;
    border-color: #3d4450 #3d4450 transparent;
}

html.theme-dark .dropdown-menu {
    background-color: #252a33;
    border-color: #3d4450;
}

html.theme-dark .dropdown-menu > li > a {
    color: #e4e6eb;
}

html.theme-dark .dropdown-menu > li > a:hover,
html.theme-dark .dropdown-menu > li > a:focus {
    color: #fff;
    background-color: #3a424d;
}

html.theme-dark .list-group-item {
    background-color: #1e2229;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .modal-content {
    background-color: #1e2229;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .modal-header {
    border-bottom-color: #3d4450;
}

html.theme-dark .modal-footer {
    border-top-color: #3d4450;
}

html.theme-dark .login-panel {
    background-color: #1e2229;
    border-color: #3d4450;
}

html.theme-dark .login-panel .panel-heading {
    background-color: #252a33;
    border-color: #3d4450;
    color: #e8eaef;
}

html.theme-dark .login-panel .panel-body {
    background-color: #1e2229;
    color: #e4e6eb;
}

html.theme-dark .pagination > li > a,
html.theme-dark .pagination > li > span {
    background-color: #252a33;
    border-color: #3d4450;
    color: #7eb8ff;
}

html.theme-dark .pagination > li > a:hover {
    background-color: #3a424d;
    border-color: #4a5563;
    color: #fff;
}

html.theme-dark .pagination > .active > a,
html.theme-dark .pagination > .active > span {
    background-color: #3d5a80;
    border-color: #4a6fa3;
    color: #fff;
}

html.theme-dark .label-default {
    background-color: #3d4450;
}

html.theme-dark pre,
html.theme-dark code {
    background-color: #181b21;
    border-color: #3d4450;
    color: #d8dce3;
}

html.theme-dark .dataTables_wrapper .dataTables_length,
html.theme-dark .dataTables_wrapper .dataTables_filter,
html.theme-dark .dataTables_wrapper .dataTables_info,
html.theme-dark .dataTables_wrapper .dataTables_paginate {
    color: #c9cdd4;
}

html.theme-dark .dataTables_wrapper .dataTables_processing {
    color: #e4e6eb !important;
    background: rgba(24, 27, 33, 0.94) !important;
    background-color: rgba(24, 27, 33, 0.94) !important;
    background-image: none !important;
    border: 1px solid #3d4450 !important;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html.theme-dark table.dataTable tbody td.dataTables_empty,
html.theme-dark table.dataTable tbody tr td.dataTables_empty {
    background-color: #1a1d24 !important;
    color: #a8b0bd !important;
}

html.theme-dark .dataTables_wrapper .dataTables_scrollBody {
    background-color: #1e2229;
}

html.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #7eb8ff !important;
}

html.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    background: #3d5a80 !important;
    border-color: #4a6fa3 !important;
}

html.theme-dark .ui-widget-content {
    background-color: #1e2229;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .ui-widget-header {
    background-color: #252a33;
    border-color: #3d4450;
    color: #e8eaef;
}

html.theme-dark .ui-state-default,
html.theme-dark .ui-widget-content .ui-state-default {
    background-color: #2d333b;
    border-color: #3d4450;
    color: #e4e6eb;
}

html.theme-dark .ui-state-hover,
html.theme-dark .ui-widget-content .ui-state-hover {
    background-color: #3a424d;
    border-color: #4a5563;
    color: #fff;
}

/* Перебиваем глобальные стили ссылок для верхней панели (читаемый текст при наведении). */
html.theme-dark .navbar-default .navbar-top-links > li > a,
html.theme-dark .navbar-default .navbar-top-links > li > a:visited {
    color: #e4e6eb !important;
}

html.theme-dark .navbar-default .navbar-top-links > li > a:hover,
html.theme-dark .navbar-default .navbar-top-links > li > a:focus {
    background-color: #343b48 !important;
    color: #f5f7fb !important;
}

html.theme-dark .navbar-default .navbar-top-links > li > a:hover i,
html.theme-dark .navbar-default .navbar-top-links > li > a:focus i {
    color: inherit !important;
}

/* Поле даты: addon с иконкой календаря */
html.theme-dark .input-group-addon {
    background-color: #2d333b !important;
    border-color: #3d4450 !important;
    color: #e4e6eb !important;
}

html.theme-dark .input-group-addon .glyphicon {
    color: inherit;
}

html.theme-dark .input-group-addon:hover,
html.theme-dark .input-group-addon:focus {
    background-color: #3a424d !important;
    color: #fff !important;
}

/* Bootstrap datetimepicker */
html.theme-dark .bootstrap-datetimepicker-widget {
    background-color: #1e2229;
    color: #e4e6eb;
    border-color: #3d4450;
}

html.theme-dark .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
    border-bottom-color: #1e2229;
}

html.theme-dark .bootstrap-datetimepicker-widget.dropdown-menu.top:after {
    border-top-color: #1e2229;
}

html.theme-dark .bootstrap-datetimepicker-widget table thead tr:first-child th,
html.theme-dark .bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
    background-color: #252a33;
    color: #e8eaef;
    border-color: #3d4450;
}

html.theme-dark .bootstrap-datetimepicker-widget table th,
html.theme-dark .bootstrap-datetimepicker-widget table td {
    border-color: #3d4450;
}

html.theme-dark .bootstrap-datetimepicker-widget table td.day {
    background-color: #1e2229;
    color: #d8dce3;
}

html.theme-dark .bootstrap-datetimepicker-widget table td.day:hover,
html.theme-dark .bootstrap-datetimepicker-widget table td.hour:hover,
html.theme-dark .bootstrap-datetimepicker-widget table td.minute:hover,
html.theme-dark .bootstrap-datetimepicker-widget table td.second:hover {
    background-color: #3a424d !important;
    color: #fff !important;
}

html.theme-dark .bootstrap-datetimepicker-widget table td.old,
html.theme-dark .bootstrap-datetimepicker-widget table td.new {
    color: #6b7280;
}

html.theme-dark .bootstrap-datetimepicker-widget table td.today:before {
    border-bottom-color: #7eb8ff;
}

html.theme-dark .bootstrap-datetimepicker-widget table td.active,
html.theme-dark .bootstrap-datetimepicker-widget table td.active:hover {
    background-color: #3d5a80 !important;
    color: #fff !important;
    text-shadow: none;
}

html.theme-dark .bootstrap-datetimepicker-widget table td span:hover,
html.theme-dark .bootstrap-datetimepicker-widget table td span.active {
    background-color: #3d5a80 !important;
    color: #fff !important;
}

html.theme-dark .bootstrap-datetimepicker-widget .picker-switch a,
html.theme-dark .bootstrap-datetimepicker-widget a[data-action] {
    color: #7eb8ff;
}

html.theme-dark .bootstrap-datetimepicker-widget .picker-switch a:hover,
html.theme-dark .bootstrap-datetimepicker-widget a[data-action]:hover {
    color: #b8d9ff;
}

html.theme-dark .bootstrap-datetimepicker-widget .timepicker-picker .btn,
html.theme-dark .bootstrap-datetimepicker-widget .timepicker-picker .btn:hover {
    background-color: #2d333b;
    border-color: #3d4450;
    color: #e4e6eb;
}

/* Страница входа — переключатель темы */
.login-page-container {
    position: relative;
    padding-top: 56px;
}

.login-theme-toggle {
    position: absolute;
    top: 16px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(160deg, #ffffff 0%, #eef1f6 100%);
    color: #4a5568;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.login-theme-toggle:hover,
.login-theme-toggle:focus {
    text-decoration: none;
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

html.theme-dark .login-theme-toggle {
    border-color: #4a5563;
    background: linear-gradient(160deg, #2f3540 0%, #252a33 100%);
    color: #d2d9e8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html.theme-dark .login-theme-toggle:hover,
html.theme-dark .login-theme-toggle:focus {
    color: #fff;
    border-color: #6b7588;
    background: linear-gradient(160deg, #3a4250 0%, #2d333b 100%);
}

/* Детальные страницы без навбара — кнопка темы */
.theme-toggle-toolbar {
    padding: 8px 0 4px;
}

.theme-toggle-toolbar__btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #d8dee9;
    background: linear-gradient(180deg, #fff 0%, #f3f5f9 100%);
    color: #3d4a5c;
    font-size: 13px;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle-toolbar__btn:hover,
.theme-toggle-toolbar__btn:focus {
    text-decoration: none;
    color: #1a202c;
    border-color: #c5cdd8;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.theme-toggle-toolbar__label {
    font-weight: 500;
    margin-left: 6px;
}

html.theme-dark .theme-toggle-toolbar__btn {
    border-color: #4a5563;
    background: linear-gradient(180deg, #343b48 0%, #2a303c 100%);
    color: #e4e6eb;
}

html.theme-dark .theme-toggle-toolbar__btn:hover,
html.theme-dark .theme-toggle-toolbar__btn:focus {
    color: #fff;
    border-color: #6b7588;
    background: linear-gradient(180deg, #3d4654 0%, #323844 100%);
}
