:root {
    --user-primary: #002E6D;
    --user-accent: #9ACAEB;
    --user-light-bg: #f8f9fa;
    --user-border: #e0e0e0;
    --user-text-muted: #6c757d;
}

.users-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.users-page-header h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.btn-add-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: transparent;
    color: var(--user-primary);
    border: 2px solid var(--user-primary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-add-user:hover {
    background-color: var(--user-primary);
    color: white;
    text-decoration: none;
}

.users-main-container {
    background: white;
    border: 1px solid var(--user-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.users-filter-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--user-border);
}

.users-filter-section .filter-item {
    margin-bottom: 0;
}

.users-filter-section .filter-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--user-text-muted);
    margin-bottom: 6px;
    font-weight: 400;
}

.users-filter-section .filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
}

.users-filter-section .form-control {
    border: 1px solid var(--user-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.users-filter-section .form-control:focus {
    border-color: var(--user-primary);
    box-shadow: 0 0 0 2px rgba(0, 46, 109, 0.1);
    outline: none;
}

.users-filter-section select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23002E6D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.users-filter-section select.form-control:hover {
    border-color: var(--user-primary);
}

.btn-filter-clear {
    padding: 8px 24px;
    background: white;
    color: var(--user-primary);
    border: 1px solid var(--user-primary);
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-clear:hover {
    background: var(--user-light-bg);
}

.btn-filter-search {
    padding: 8px 24px;
    background: var(--user-primary);
    color: white;
    border: 1px solid var(--user-primary);
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-search:hover {
    background: #001f4a;
}

.users-table-wrapper {
    padding-top: 16px;
}

.ag-theme-balham .ag-header {
    background-color: var(--user-primary) !important;
    border-bottom: none !important;
}

.ag-theme-balham .ag-header-row {
    background-color: var(--user-primary) !important;
}

.ag-theme-balham .ag-header-cell {
    background-color: var(--user-primary) !important;
    color: white !important;
    font-weight: 500 !important;
    font-size: 0.8125rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.ag-theme-balham .ag-header-cell-text {
    color: white !important;
}

.ag-theme-balham .ag-header-icon {
    color: rgba(255, 255, 255, 0.7) !important;
}

.ag-theme-balham .ag-header-cell:hover {
    background-color: rgba(0, 46, 109, 0.9) !important;
}

.ag-theme-balham .ag-header-cell-resize {
    opacity: 0.3;
}

.ag-theme-balham .ag-header-cell-resize:hover {
    opacity: 0.7;
}

.ag-theme-balham .ag-row {
    border-bottom: 1px solid #f0f0f0 !important;
}

.ag-theme-balham .ag-row:hover {
    background-color: rgba(154, 202, 235, 0.1) !important;
}

.ag-theme-balham .ag-row-odd {
    background-color: #fafafa !important;
}

.ag-theme-balham .ag-cell {
    font-size: 0.875rem !important;
    color: #444 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.users-table-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid var(--user-border);
    gap: 24px;
}

.users-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--user-text-muted);
}

.users-page-size select {
    padding: 4px 8px;
    border: 1px solid var(--user-border);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.users-row-count {
    font-size: 0.8125rem;
    color: var(--user-text-muted);
}

.users-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.users-pagination button {
    width: 28px;
    height: 28px;
    padding: 0;
    background: white;
    border: 1px solid var(--user-border);
    border-radius: 4px;
    color: var(--user-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.users-pagination button:hover:not(:disabled) {
    border-color: var(--user-primary);
    color: var(--user-primary);
}

.users-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccd6e0;
    transition: 0.25s ease;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background-color: var(--user-primary);
}

input:focus + .slider {
    box-shadow: 0 0 0 2px rgba(0, 46, 109, 0.2);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.dropdown-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.dropdown-btn:hover {
    background: rgba(0, 46, 109, 0.08);
}

.dropdown-content {
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid var(--user-border) !important;
    overflow: hidden;
}

.dropdown-content a {
    padding: 10px 16px !important;
    font-size: 0.875rem !important;
    transition: background 0.15s !important;
}

.dropdown-content a:hover {
    background-color: rgba(154, 202, 235, 0.2) !important;
    color: var(--user-primary) !important;
}

@media (max-width: 768px) {
    .users-filter-row {
        flex-direction: column;
    }
    
    .users-filter-group {
        max-width: 100%;
    }
    
    .users-filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.users-filter-section .bootstrap-select {
    width: 100% !important;
}

.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom {
    background-color: white;
    border: 1px solid var(--user-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #333;
    height: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom:hover,
.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom:focus {
    background-color: white;
    border-color: var(--user-primary);
    box-shadow: 0 0 0 2px rgba(0, 46, 109, 0.1);
    outline: none;
}

.users-filter-section .bootstrap-select.show > .dropdown-toggle.btn-select-custom {
    background-color: white;
    border-color: var(--user-primary);
    box-shadow: 0 0 0 2px rgba(0, 46, 109, 0.1);
}

.users-filter-section .bootstrap-select .dropdown-toggle .caret {
    border-top-color: var(--user-primary);
}

.users-filter-section .bootstrap-select .dropdown-toggle::after {
    border-top-color: var(--user-primary);
}

.users-filter-section .bootstrap-select .dropdown-menu {
    border: 1px solid var(--user-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
}

.users-filter-section .bootstrap-select .dropdown-menu li a {
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #333;
    transition: all 0.15s ease;
}

.users-filter-section .bootstrap-select .dropdown-menu li a:hover,
.users-filter-section .bootstrap-select .dropdown-menu li a:focus {
    background-color: rgba(154, 202, 235, 0.2);
    color: var(--user-primary);
}

.users-filter-section .bootstrap-select .dropdown-menu li.selected a {
    background-color: var(--user-primary);
    color: white;
}

.users-filter-section .bootstrap-select .dropdown-menu li.selected a:hover {
    background-color: #001f4a;
    color: white;
}

.users-filter-section .bootstrap-select .dropdown-menu li.active a {
    background-color: rgba(154, 202, 235, 0.3);
    color: var(--user-primary);
}

.users-filter-section .bootstrap-select.show-tick .dropdown-menu li.selected a span.check-mark {
    color: white;
}

.users-filter-section .bootstrap-select .filter-option-inner-inner {
    overflow: hidden;
    text-overflow: ellipsis;
}

.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom.bs-placeholder,
.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom.bs-placeholder:hover {
    color: var(--user-text-muted);
}

.users-filter-section .bootstrap-select.disabled > .dropdown-toggle.btn-select-custom,
.users-filter-section .bootstrap-select > .dropdown-toggle.btn-select-custom:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.65;
}
