/* Dev-only light/dark theme switch for adm2.infox.ru / adm2.infox.sg. */
#infox-theme-toggle a {
  cursor: pointer;
}

#infox-theme-toggle .infox-theme-label {
  display: none;
}

html.infox-dark-theme,
html.infox-dark-theme body,
body.infox-dark-theme,
body.infox-dark-theme #main {
  background: #151a21 !important;
  color: #d8dee9 !important;
}

body.infox-dark-theme #header,
body.infox-dark-theme .page-footer,
body.infox-dark-theme #ribbon {
  background: #1d2430 !important;
  border-color: #303a49 !important;
}

body.infox-dark-theme #left-panel,
body.infox-dark-theme aside,
body.infox-dark-theme .login-info,
body.infox-dark-theme nav ul ul {
  background: #11161d !important;
}

body.infox-dark-theme #content,
body.infox-dark-theme .well,
body.infox-dark-theme .widget-body,
body.infox-dark-theme .jarviswidget > div,
body.infox-dark-theme .modal-content,
body.infox-dark-theme .dropdown-menu,
body.infox-dark-theme .popover,
body.infox-dark-theme .panel,
body.infox-dark-theme .panel-body,
body.infox-dark-theme .filter-form,
body.infox-dark-theme .smart-form fieldset,
body.infox-dark-theme .smart-form footer {
  background: #1c232d !important;
  color: #d8dee9 !important;
  border-color: #364151 !important;
}

body.infox-dark-theme .jarviswidget > header,
body.infox-dark-theme .panel-heading,
body.infox-dark-theme .modal-header,
body.infox-dark-theme .modal-footer,
body.infox-dark-theme .smart-form header {
  background: #252e3a !important;
  color: #eef2f7 !important;
  border-color: #3b4655 !important;
}

body.infox-dark-theme table,
body.infox-dark-theme .table,
body.infox-dark-theme .table > thead > tr > th,
body.infox-dark-theme .table > tbody > tr > td,
body.infox-dark-theme .table > tfoot > tr > td,
body.infox-dark-theme table.dataTable,
body.infox-dark-theme table.dataTable td,
body.infox-dark-theme table.dataTable th {
  background-color: #1c232d !important;
  color: #d8dee9 !important;
  border-color: #364151 !important;
}

body.infox-dark-theme .table-striped > tbody > tr:nth-child(odd) > td,
body.infox-dark-theme table.dataTable tr.odd td {
  background-color: #202936 !important;
}

body.infox-dark-theme .table-hover > tbody > tr:hover > td,
body.infox-dark-theme table.dataTable tbody tr:hover td {
  background-color: #293647 !important;
}

body.infox-dark-theme input,
body.infox-dark-theme select,
body.infox-dark-theme textarea,
body.infox-dark-theme .form-control,
body.infox-dark-theme .filter-form .input input,
body.infox-dark-theme .filter-form .select select,
body.infox-dark-theme .select2-container .select2-choice,
body.infox-dark-theme .select2-container-multi .select2-choices,
body.infox-dark-theme .select2-drop,
body.infox-dark-theme .select2-search input {
  background: #111821 !important;
  color: #e4e9f0 !important;
  border-color: #455264 !important;
}

body.infox-dark-theme input::placeholder,
body.infox-dark-theme textarea::placeholder {
  color: #8e99a8 !important;
}

body.infox-dark-theme .label,
body.infox-dark-theme label,
body.infox-dark-theme .filter-form label.label,
body.infox-dark-theme h1,
body.infox-dark-theme h2,
body.infox-dark-theme h3,
body.infox-dark-theme h4,
body.infox-dark-theme h5,
body.infox-dark-theme h6,
body.infox-dark-theme p,
body.infox-dark-theme .pagination > li > a,
body.infox-dark-theme .pagination > li > span {
  color: #d8dee9 !important;
}

body.infox-dark-theme a:not(.btn) {
  color: #7fbcff;
}

body.infox-dark-theme hr,
body.infox-dark-theme .well,
body.infox-dark-theme .nav-tabs,
body.infox-dark-theme .nav-tabs > li > a,
body.infox-dark-theme .pagination > li > a,
body.infox-dark-theme .pagination > li > span {
  border-color: #364151 !important;
}

body.infox-dark-theme .nav-tabs > li.active > a,
body.infox-dark-theme .pagination > .active > a,
body.infox-dark-theme .pagination > .active > span {
  background: #34465c !important;
  color: #fff !important;
}

body.infox-dark-theme .ui-widget-content,
body.infox-dark-theme .ui-datepicker,
body.infox-dark-theme .xdsoft_datetimepicker {
  background: #1c232d !important;
  color: #d8dee9 !important;
  border-color: #455264 !important;
}

/* Comfortable typography: light, but softer than pure white. */
body.infox-dark-theme,
body.infox-dark-theme #main,
body.infox-dark-theme #content,
body.infox-dark-theme article,
body.infox-dark-theme section,
body.infox-dark-theme header,
body.infox-dark-theme footer,
body.infox-dark-theme div,
body.infox-dark-theme span,
body.infox-dark-theme td,
body.infox-dark-theme th,
body.infox-dark-theme li,
body.infox-dark-theme dt,
body.infox-dark-theme dd,
body.infox-dark-theme strong,
body.infox-dark-theme em,
body.infox-dark-theme small,
body.infox-dark-theme .help-block,
body.infox-dark-theme .note,
body.infox-dark-theme .dataTables_info,
body.infox-dark-theme .dataTables_length,
body.infox-dark-theme .dataTables_filter,
body.infox-dark-theme .dataTables_paginate {
  color: #d7dde6 !important;
}

body.infox-dark-theme .text-muted,
body.infox-dark-theme .muted,
body.infox-dark-theme .help-block,
body.infox-dark-theme small,
body.infox-dark-theme .note,
body.infox-dark-theme .adUrl,
body.infox-dark-theme .adSource,
body.infox-dark-theme .tags,
body.infox-dark-theme .ui-state-disabled {
  color: #aeb8c6 !important;
}

body.infox-dark-theme input,
body.infox-dark-theme select,
body.infox-dark-theme textarea,
body.infox-dark-theme option,
body.infox-dark-theme button,
body.infox-dark-theme .select2-chosen,
body.infox-dark-theme .select2-result-label,
body.infox-dark-theme .select2-search-choice,
body.infox-dark-theme .ui-menu-item,
body.infox-dark-theme .ui-datepicker td a,
body.infox-dark-theme .xdsoft_datetimepicker td,
body.infox-dark-theme .xdsoft_datetimepicker th {
  color: #e1e6ed !important;
}

body.infox-dark-theme nav a,
body.infox-dark-theme nav a span,
body.infox-dark-theme .login-info a,
body.infox-dark-theme #ribbon,
body.infox-dark-theme #ribbon a,
body.infox-dark-theme .page-footer {
  color: #cbd3df !important;
}

body.infox-dark-theme nav li.active > a,
body.infox-dark-theme nav a:hover,
body.infox-dark-theme a:not(.btn):hover {
  color: #9bcbff !important;
}

/* Replace the skin's high-saturation red header controls with calm slate. */
body.infox-dark-theme #header .btn-header > :first-child > a,
body.infox-dark-theme #header .btn-header > span > a {
  background: #2d3948 !important;
  border-color: #46566a !important;
  color: #dce3ec !important;
}

body.infox-dark-theme #header .btn-header > :first-child > a:hover,
body.infox-dark-theme #header .btn-header > span > a:hover {
  background: #3a4a5d !important;
  color: #fff !important;
}

/* Charts remain readable without glowing against the dark background. */
body.infox-dark-theme .morris-hover,
body.infox-dark-theme .morris-hover-point,
body.infox-dark-theme .morris-hover-row-label {
  color: #d7dde6 !important;
}

body.infox-dark-theme svg {
  filter: saturate(.78) brightness(.92);
}

/* Character counter next to the teaser title input. */
body.infox-dark-theme #adForm input[name="header"] + .input-group-addon {
  background-color: #263342;
  border-color: #455264;
}

/* Teaser list on /ads: soften the metadata dividers. */
body.infox-dark-theme .adsTable tr[id^="ad"] > td.infoTd > .adUrl,
body.infox-dark-theme .adsTable tr[id^="ad"] > td.infoTd > .adSource {
  border-top-color: rgba(204, 204, 204, 0.33);
}

/* Article category/color badges on /scjnews. */
body.infox-dark-theme .adCategory,
body.infox-dark-theme .adColor-white {
  display: block;
  width: 90px;
  max-width: 100%;
  box-sizing: border-box;
  margin: 2px 0;
  padding: 2px 7px;
  background: #2a3442 !important;
  color: #dbe2eb !important;
  border: 1px solid #526176 !important;
  border-radius: 3px;
  text-align: center;
  line-height: 1.25;
}

/* Headline colors and sizing shared by /ads and /scjnews. */
body.infox-dark-theme .adsTable tr[id^="ad"] > td.infoTd > a + a,
body.infox-dark-theme #wid-id-daily-graph tr[id^="scj"] .scjEditHide > div > a:first-child {
  color: #e4edf7 !important;
  font-size: 15px;
}

body.infox-dark-theme .adsTable tr[id^="ad"] > td.infoTd > a + a:hover,
body.infox-dark-theme .adsTable tr[id^="ad"] > td.infoTd > a + a:focus-visible,
body.infox-dark-theme #wid-id-daily-graph tr[id^="scj"] .scjEditHide > div > a:first-child:hover,
body.infox-dark-theme #wid-id-daily-graph tr[id^="scj"] .scjEditHide > div > a:first-child:focus-visible {
  color: #f0f6fc !important;
}

/* /scjnews article spacing and backgrounds. */
body.infox-dark-theme #wid-id-daily-graph .dt-toolbar-footer:has(> .pagination-alt a[href^="/scjnews"]) {
  background: #1c232d !important;
  border-color: #364151 !important;
  color: #aeb8c6 !important;
}

body.infox-dark-theme #wid-id-daily-graph .dt-toolbar-footer:has(> .pagination-alt a[href^="/scjnews"]) > div {
  color: #aeb8c6 !important;
}

body.infox-dark-theme #wid-id-daily-graph .dt-toolbar-footer .pagination-alt:has(a[href^="/scjnews"]) > li > :is(a, span) {
  background: #202936 !important;
  color: #d7dde6 !important;
  border-color: #455264 !important;
}

body.infox-dark-theme #wid-id-daily-graph .dt-toolbar-footer .pagination-alt:has(a[href^="/scjnews"]) > li > a:is(:hover, :focus-visible),
body.infox-dark-theme #wid-id-daily-graph .dt-toolbar-footer .pagination-alt:has(a[href^="/scjnews"]) > .active > :is(a, span) {
  background: #34465c !important;
  color: #f0f6fc !important;
}

body.infox-dark-theme #wid-id-daily-graph tr[id^="scj"] .scjEditHide > div > a:first-child {
  letter-spacing: 0.02em;
}

body.infox-dark-theme tr[id^="scj"] > td { background: #1b2430 !important; border-color: #344253 !important; }
body.infox-dark-theme tr[id^="scj"]:nth-child(odd) > td { background: #1f2936 !important; }
body.infox-dark-theme tr[id^="scj"]:hover > td { background: #263445 !important; }

body.infox-dark-theme tr[id^="scj"] .scjEditHide > div[style*="max-height"] {
  padding: 7px 9px;
  background: #18212b !important;
  color: #c7d0dc !important;
  border-color: #48586b !important;
  border-radius: 3px;
  line-height: 1.45;
  scrollbar-color: #56667a #18212b;
}

body.infox-dark-theme tr[id^="scj"] .scjEditHide > a[style*="font-size"] { color: #91a2b6 !important; }
body.infox-dark-theme tr[id^="scj"] .tags span { background: #222d3a !important; color: #cbd5e1 !important; border-color: #526176 !important; }
body.infox-dark-theme tr[id^="scj"] .imgTd img { filter: brightness(.9) saturate(.88); }

body.infox-dark-theme .alert-danger,
body.infox-dark-theme .alert-error { background: #5b3d43 !important; color: #efdadd !important; border-color: #76515a !important; }
body.infox-dark-theme .alert-success { background: #304b3d !important; color: #d8eadf !important; border-color: #486a58 !important; }

body.infox-dark-theme .btn-success { background: #456f59 !important; border-color: #567f68 !important; color: #eef5f0 !important; }
body.infox-dark-theme .btn-success:hover,
body.infox-dark-theme .btn-success:focus { background: #527e66 !important; }
body.infox-dark-theme .btn-default { background: #303b49 !important; border-color: #526176 !important; color: #dce3ec !important; }

body.infox-dark-theme .select2-container .select2-choice .select2-arrow { background: #263342 !important; border-color: #455264 !important; }

@media (max-width: 767px) {
  #infox-theme-toggle .infox-theme-label {
    display: none;
  }
}
