/* ----- Environment Banner ----- */

body.env:before {
  background-color: #e3ab00;
  color: #fff;
  display: block;
  font-size: 12px;
  font-weight: normal;
  height: 25px;
  letter-spacing: 5px;
  line-height: 25px;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  z-index: 10003;
}
body.env.local:before {
  background-color: #a0c1b8;
}
body.env.dev:before {
  background-color: #3a8dde;
}
body.env.test:before {
  background-color: #ac65d8;
}
body.env.stage:before {
  background-color: #f09a42;
}
body.env.prod:before {
  background-color: #02363d;
}
body.env.blink:before {
  opacity: 0.25;
}


/* ----- Branding / Header ----- */

#branding .branding-seperator {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 6px;
}


/* ----- Filter Container (top-bar filter layout for change lists) ----- */

.filter-container {
  background: var(--darkened-bg, #f8f8f8);
  border: 1px solid var(--hairline-color, #e7e7e7);
  border-radius: 4px;
  margin: 10px 0;
  padding: 10px;
}
.filter-container li {
  display: inline-block;
}
.filter-container .form-control {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.filter-container .form-control ul {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}
.filter-container .form-control .timezonewarning,
.filter-container .form-control .help {
  display: none;
}
.filter-container .datetimeshortcuts {
  font-size: 0 !important;
  margin-right: 10px;
}
.filter-container .datetimeshortcuts a:first-child {
  display: none;
}
.filter-container .datetimeshortcuts a {
  font-size: 12px;
  margin-left: 5px;
}
.form-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
}
.form-group > span,
.form-group > div,
.form-group > select {
  display: inline-block;
  font-size: 13px;
}
.form-group > label {
  margin: 5px 5px 5px 0;
}
.form-group > div {
  margin: 0 !important;
}


/* ----- Selectize Styles ----- */

.selectize-filter, .dynamic-selectize, .selectize-control {
  min-width: 180px;
  width: 180px;
}
.selectize-filter[multiple="multiple"], .selectize-control.multi {
  min-width: 360px;
  width: 360px;
}

/* Selectize theme integration — override hardcoded light colors with admin CSS vars */
body .selectize-dropdown,
body .selectize-input,
body .selectize-input input {
  color: var(--body-fg);
}
body .selectize-input,
body .selectize-control.single .selectize-input.input-active {
  background-color: var(--body-bg);
  border-color: var(--border-color);
}
body .selectize-input.full {
  background-color: var(--body-bg);
}
body .selectize-input.dropdown-active::before {
  background: var(--body-bg);
}
body .selectize-dropdown,
body .selectize-dropdown.form-control {
  background: var(--body-bg);
  color: var(--body-fg);
  border-color: var(--border-color);
}
body .selectize-dropdown .active {
  background-color: var(--darkened-bg);
  color: var(--body-fg);
}
body .selectize-dropdown .optgroup-header {
  color: var(--body-quiet-color);
  background: var(--body-bg);
}
body .selectize-dropdown-header {
  background: var(--darkened-bg);
  border-color: var(--border-color);
}
body .selectize-control.multi .selectize-input > div {
  background: var(--darkened-bg);
  color: var(--body-fg);
}
body .selectize-control.multi .selectize-input > div.active {
  background: var(--primary);
  color: var(--primary-fg);
}
body .selectize-control .selectize-input.disabled {
  background-color: var(--darkened-bg);
}
body .selectize-control.single .selectize-input:after {
  border-color: var(--body-fg) transparent transparent transparent;
}
body .selectize-control.single .selectize-input.dropdown-active:after {
  border-color: transparent transparent var(--body-fg) transparent;
}


/* ----- Alert Styles (used in custom action templates) ----- */

.alert {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}
.alert-danger {
  background-color: var(--message-error-bg, #f2dede);
  border-color: var(--border-color, #ebccd1);
  color: var(--error-fg, #ba2121);
}
.alert-info {
  background-color: var(--message-info-bg, #d9edf7);
  border-color: var(--border-color, #bce8f1);
  color: var(--body-fg, #31708f);
}
.alert-success {
  background-color: var(--message-success-bg, #dff0d8);
  border-color: var(--border-color, #d6e9c6);
  color: var(--body-fg, #3c763d);
}
.alert-warning {
  background-color: var(--message-warning-bg, #fcf8e3);
  border-color: var(--border-color, #faebcc);
  color: var(--body-fg, #8a6d3b);
}
.alert > .title {
  display: block;
  font-weight: bold;
}


/* ----- Utility Classes ----- */

.center-aligned { text-align: center; }
.pull-left { float: left; }
.pull-right { float: right; }
.bottom-margined { margin-bottom: 20px; }
.top-margined { margin-top: 20px; }
.nowrap { white-space: nowrap; }
.light { color: #aaa; }
.italic { font-style: italic; }
.strike-through { text-decoration: line-through; }
.uppercase { text-transform: uppercase; }
.full-width { width: 100%; }
.half-width { width: 50%; }
.hidden { display: none; }
.unacceptable { color: var(--error-fg, #ba2121); }
.narrow-column { min-width: 50px !important; }
.column { min-width: 100px !important; }
.wide-column { min-width: 200px !important; }
.wider-column { min-width: 300px !important; }
.widest-column { min-width: 400px !important; }

.bigger-font, .bigger-font th, .bigger-font td {
  font-size: 1.1em !important;
  font-weight: 400;
}
.smaller-font, .smaller-font th, .smaller-font td {
  font-size: .95em !important;
}
.empty-table-cell {
  color: #aaa;
  font-style: italic;
  padding: 15px 0;
  text-align: center;
}

.table-bordered { border: 1px solid var(--hairline-color, #ddd); }
.table-striped > tbody > tr:nth-of-type(even) {
  background-color: var(--darkened-bg, #f9f9f9);
}
.table-bordered > thead > tr > td, .table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td, .table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td, .table-bordered > tfoot > tr > th {
  border: 1px solid var(--hairline-color, #ddd);
}

.action {
  background-position-y: center;
  margin-left: auto;
  margin-right: .5em;
}
.pull-right .action {
  margin-left: .5em;
  margin-right: auto;
}


/* ----- Page-Specific Styles ----- */

.column-address, .column-list_address, .column-list_brand,
.column-list_city, .column-list_rule, .column-list_user,
.column-name { min-width: 150px; }

.column-list_client_territory, .column-list_job,
.column-list_job_template, .column-list_parent_company { min-width: 200px; }

.column-feedback, .column-list_bonus, .column-list_reason,
.column-list_store, .column-list_store_chain, .column-store { min-width: 300px; }

.column-list_audit_notes, .column-description, .short-description { min-width: 400px; }

#add_job_audit_note { display: inline-block; margin-bottom: 4px; }

#identifiers-group table.table > thead > tr > th:first-child,
#identifiers-group table.table > tbody > tr.form-row > td:first-child,
#kehedelivery_form #eta_stages-group table.table > thead > tr > th:first-child,
#kehedelivery_form #eta_stages-group table.table > tbody > tr > td:first-child,
#kehedelivery_form #load_stages-group table.table > thead > tr > th:first-child,
#kehedelivery_form #load_stages-group table.table > tbody > tr > td:first-child,
#review_form #responses-group table.table > thead > tr > th:first-child,
#review_form #responses-group table.table > tbody > tr > td:first-child,
#rule_form #rulemembership_set-group table.table > thead > tr > th:first-child,
#rule_form #rulemembership_set-group table.table > tbody > tr > td:first-child,
#rulegroup_form #rulemembership_set-group table.table > thead > tr > th:first-child,
#rulegroup_form #rulemembership_set-group table.table > tbody > tr > td:first-child { display: none; }

#job_form .field-list_notes label { display: none; }
#job_form .field-list_notes div { margin-left: 0; }
#job_form #stats_snapshots-group table.table > thead > tr > th:first-child,
#job_form #stats_snapshots-group table.table > tbody > tr > td:first-child { display: none; }

#adjustcasecounts-form table.table > thead > tr > th { min-width: 130px; }

.inline-actions .inline-action { display: inline-block; }
.inline-actions .inline-action > * { width: auto; }

.flag-responses thead tr th:first-child,
.flag-responses tbody tr td:first-child { width: 20%; }

.description_field { max-width: 100%; }
.date-row input { width: 140px !important; }

.calendarbox, .clockbox { z-index: 11000; }

#changelist-form .django-select2 { width: 400px; }

.aligned .select2-container { min-width: 400px; }

.aligned select[multiple] { width: 100%; max-width: 610px; }
.aligned .selector select[multiple] { max-width: none; }

/* ----- Select2 Theme Integration ----- */
/* body prefix ensures these override the vendored select2.css regardless of load order */

body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple {
  background-color: var(--body-bg);
  border-color: var(--border-color);
  color: var(--body-fg);
}
body .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--body-fg);
}
body .select2-container--default .select2-selection--single .select2-selection__placeholder,
body .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
  color: var(--body-quiet-color);
}
body .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--darkened-bg);
  border-color: var(--border-color);
  color: var(--body-fg);
}
body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--body-quiet-color);
}
body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: var(--body-fg);
}
body .select2-dropdown {
  background-color: var(--body-bg);
  border-color: var(--border-color);
  color: var(--body-fg);
}
body .select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: var(--darkened-bg);
  border-color: var(--border-color);
  color: var(--body-fg);
}
body .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: var(--selected-bg);
  color: var(--body-fg);
}
body .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary);
  color: var(--primary-fg);
}
body .select2-container--default .select2-results__option[aria-disabled=true] {
  color: var(--body-quiet-color);
}
body .select2-container--default.select2-container--disabled .select2-selection--single,
body .select2-container--default.select2-container--disabled .select2-selection--multiple {
  background-color: var(--darkened-bg);
}
body .select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--body-quiet-color);
}

/* ----- NO STYLE BEYOND THIS POINT ----- */
