/* Force dark admin theme (Django 2.1) — stronger override */
:root { color-scheme: dark; }

html, body {
  background: #0f1115 !important;
  color: #e6e6e6 !important;
}

a, a:visited { color: #7aa2ff !important; }
a:hover { color: #9bb8ff !important; }

/* Header */
#header {
  background: #151a22 !important;
  color: #e6e6e6 !important;
  border-bottom: 1px solid #2a3240 !important;
}
#branding h1, #branding h1 a { color: #e6e6e6 !important; }
#user-tools, #user-tools a { color: #cfd8ff !important; }

/* Breadcrumbs (часто там “цветные полосы”) */
div.breadcrumbs {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border-bottom: 1px solid #2a3240 !important;
}
div.breadcrumbs a { color: #a9c1ff !important; }

/* Main wrappers */
#content, #content-main, #content-related, .content {
  background: transparent !important;
  color: #e6e6e6 !important;
}

.module, .inline-group, .dashboard .module, .app-*, .grp-module {
  background: #141922 !important;
  border: 1px solid #2a3240 !important;
}

.module h2, .module caption, .inline-group h2 {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border-bottom: 1px solid #2a3240 !important;
}

/* Tables */
table { background: #141922 !important; }
thead th {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border-bottom: 1px solid #2a3240 !important;
}
tbody th, tbody td { border-bottom: 1px solid #2a3240 !important; }
tr:nth-child(odd) td, tr:nth-child(odd) th { background: #121723 !important; }
tr:nth-child(even) td, tr:nth-child(even) th { background: #101520 !important; }

/* Forms */
fieldset { border: 1px solid #2a3240 !important; }
.form-row, .aligned .form-row { border-bottom: 1px solid #2a3240 !important; }
label, .aligned label { color: #e6e6e6 !important; }
.help, p.help, .help-tooltip { color: #aab3c7 !important; }

input, select, textarea, .vTextField {
  background: #0f141d !important;
  color: #e6e6e6 !important;
  border: 1px solid #2a3240 !important;
}
select option { background: #0f141d !important; color: #e6e6e6 !important; }

/* Buttons + object tools */
.button, input[type=submit], input[type=button], .submit-row input, .object-tools a, .button.default {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border: 1px solid #2a3240 !important;
  box-shadow: none !important;
}
.button:hover, input[type=submit]:hover, .object-tools a:hover {
  background: #232c3d !important;
}

/* Submit row */
.submit-row {
  background: #141922 !important;
  border-top: 1px solid #2a3240 !important;
}

/* Messages (success/warn/error) */
ul.messagelist li {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border: 1px solid #2a3240 !important;
}
ul.messagelist li.success { border-left: 4px solid #4caf50 !important; }
ul.messagelist li.warning { border-left: 4px solid #ffb300 !important; }
ul.messagelist li.error   { border-left: 4px solid #ef5350 !important; }

/* Filters sidebar */
#changelist-filter, #changelist-filter h2, #changelist-filter h3 {
  background: #141922 !important;
  color: #e6e6e6 !important;
  border: 1px solid #2a3240 !important;
}
#changelist-filter ul { background: transparent !important; }

/* Toolbar / search */
#toolbar, .toolbar {
  background: #141922 !important;
  border: 1px solid #2a3240 !important;
}
#toolbar input[type="text"] { background: #0f141d !important; color: #e6e6e6 !important; }

/* Pagination */
.paginator, .paginator a, .paginator span { color: #e6e6e6 !important; }

/* Selected / highlight */
tr.selected td, tr.selected th { background: #232c3d !important; }

/* ---- PATCH V2: fix white pages / changelist / filters ---- */
#container, #content, .content, #content-main, #content-related,
#changelist, #changelist-form, #changelist .results, #changelist .paginator,
.change-list #content, .change-list #content-main, .change-form #content,
.colM, .colSM, .colMS, .colSM #content, .colM #content {
  background: #0f1115 !important;
  color: #e6e6e6 !important;
}

/* Action bar + table wrapper */
#changelist .actions, #changelist .actions label, #changelist .actions select,
#changelist .actions .button, #changelist .actions input,
#toolbar, .toolbar {
  background: #141922 !important;
  color: #e6e6e6 !important;
  border-color: #2a3240 !important;
}

/* Results table container */
#result_list, #result_list tbody, #result_list thead,
.results, .results table {
  background: #141922 !important;
  color: #e6e6e6 !important;
}
#result_list td, #result_list th {
  border-color: #2a3240 !important;
}

/* Filters sidebar: force dark */
#changelist-filter {
  background: #141922 !important;
  border: 1px solid #2a3240 !important;
}
#changelist-filter h2, #changelist-filter h3 {
  background: #1b2230 !important;
  color: #e6e6e6 !important;
  border-bottom: 1px solid #2a3240 !important;
}
#changelist-filter li a, #changelist-filter li.selected a {
  color: #a9c1ff !important;
}

/* Multi-select widgets + selector */
.selector, .selector-available, .selector-chosen,
.selector select, select[multiple] {
  background: #0f141d !important;
  color: #e6e6e6 !important;
  border: 1px solid #2a3240 !important;
}

/* Fix the annoying white strip under headers in some pages */
#content > h1, .module > h2, .module caption {
  background: #1b2230 !important;
}

/* Django 2.1 “white admin” leftovers */
fieldset.module, .aligned, .inline-related, .inline-group,
.dashboard #content, .dashboard .module {
  background: #141922 !important;
  border-color: #2a3240 !important;
}

