/* Fix oversized logo on login page */
.login-box {
    width: 400px !important;
}

.login-logo {
    margin-bottom: 25px !important;
    text-align: center;
}

.login-logo img {
    max-width: 280px !important;
    max-height: 120px !important;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Sidebar brand logo Fix */
.brand-link img {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
}

/* Admin Filter Section UI Improvements */
#change-list-filters {
    background-color: #1a1e21;
    border-bottom: 2px solid #343a40 !important;
    padding: 1.25rem !important;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#changelist-search {
    gap: 12px !important;
    display: flex !important;
    align-items: center !important;

    flex-wrap: wrap;
}


/* Force consistent height and alignment for ALL filter elements */
#changelist-search .form-group {
    margin-bottom: 0 !important;
}

#changelist-search select,
#changelist-search input#searchbar,
#changelist-search button[type="submit"],
#changelist-search .select2-container--default .select2-selection--single {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    line-height: 38px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#changelist-search select,
#changelist-search input#searchbar,
#changelist-search .select2-container--default .select2-selection--single {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    color: #e9ecef !important;
    border-radius: 6px !important;
    padding-left: 12px;
}

/* ── Fix filter select arrow always pinned at right edge ── */
#changelist-search select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23aab4c4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    padding-right: 30px !important;
    max-width: 160px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

#changelist-search input#searchbar {
    padding-right: 12px;
    min-width: 250px;
}

/* Specific Select2 adjustments to center text vertically */
#changelist-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    /* Slightly less than container height */
    padding-left: 0 !important;
    color: #e9ecef !important;
    display: block !important;
}

#changelist-search .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    top: 1px !important;
}

/* ── Cap Select2 filter pill width so arrow is never misplaced ── */
#changelist-search .select2-container {
    max-width: 160px !important;
    min-width: 80px !important;
}

#changelist-search .select2-container .select2-selection--single {
    width: 100% !important;
}

#changelist-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding-right: 24px !important;
}

/* Style the Search Button */
#changelist-search button[type="submit"] {
    justify-content: center !important;
    background-color: #0d6efd !important;
    color: white !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    border: none !important;
    padding: 0 25px !important;
    cursor: pointer;
    transition: background-color 0.2s;
}

#changelist-search button[type="submit"]:hover {
    background-color: #0b5ed7 !important;
}

/* Actions Section Styling */
.change-list-actions {
    margin-top: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid #0d6efd;
    display: flex !important;
    align-items: center !important;
    gap: 12px;
}

.change-list-actions select,
.change-list-actions .button {
    height: 34px !important;
    min-height: 34px !important;
    line-height: 34px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.change-list-actions select {
    min-width: 180px;
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    color: #fff !important;
    border-radius: 4px;
    padding-left: 10px;
}

.change-list-actions .button {
    background-color: #0d6efd !important;
    border: none !important;
    padding: 0 18px !important;
    border-radius: 4px !important;
    font-weight: 600;
    color: white !important;
    justify-content: center !important;
    cursor: pointer;
}

/* Table results header improvement */
#changelist table thead th {
    background-color: #1a1e21;
    color: #8bb9fe !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 14px 10px !important;
    vertical-align: middle !important;
}

/* Allow action dropdowns to overflow the table bounds */
#result_list,
#result_list tbody,
#result_list tbody tr,
#result_list tbody td {
    overflow: visible !important;
}

/* Hide left chevron icons in sidebar, keep only right chevrons */
.sidebar .nav-link .nav-icon:first-child {
    display: none !important;
}

/* Alternative: Hide all left-side icons except the right chevron */
.sidebar .nav-treeview .nav-icon {
    display: none !important;
}

/* Add left margin to submenu items */
.sidebar-wrapper .sidebar-menu > .nav-item > .nav-treeview {
    margin-left: 10px;
}


/* Global select field visibility fix */
select,
.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    color: #e9ecef !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
}

/* Ensure select dropdowns are visible */
select option {
    background-color: #2b3035 !important;
    color: #e9ecef !important;
}

/* Fix for Django admin inline forms and change forms */
.form-row select,
.inline-related select,
.related-widget-wrapper select {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
    color: #e9ecef !important;
    min-height: 34px !important;
}

/* Fix for autocomplete/select2 fields */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: #2b3035 !important;
    border: 1px solid #495057 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: #e9ecef !important;
}

/* Dropdown results */
.select2-container--default .select2-results__option {
    background-color: #2b3035 !important;
    color: #e9ecef !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd !important;
    color: white !important;
}
