/* Manage Users Page Styles - Matching Doctors Page */

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header .btn-primary {
  margin-left: auto;
}

.page-header .btn-primary i {
    color: white;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
  color: #495057;
}

.menu-toggle {
    display: none;
    background-color: #556ee6;
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
}

.filter-card {
    background: white;
 border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #eff2f7;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-header h3 i {
    color: #556ee6;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #556ee6;
    font-size: 18px;
    padding: 0;
    transition: transform 0.3s;
}

.filter-body {
    padding: 25px;
    background: #fafbfe;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.results-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #eff2f7;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.results-count i {
    color: #556ee6;
    font-size: 18px;
}

/* Table Styles - Matching Doctors exactly */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
 border-bottom: 1px solid #eff2f7;
}

.data-table th {
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table td {
    padding: 15px 20px;
    font-size: 14px;
    color: #495057;
    text-align: center;
}

/* Column-specific left alignment for Username and Email */
.data-table th:nth-child(2),
.data-table td:nth-child(2),
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    text-align: left;
}

/* Password Display */
.password-cell {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    font-size: 13px;
}

.btn-show-password {
    background: none;
    border: none;
    cursor: pointer;
color: #556ee6;
    padding: 0 5px;
    margin-left: 8px;
    font-size: 12px;
    transition: color 0.2s;
}

.btn-show-password:hover {
    color: #4458d4;
}

/* Account Status Badge */
.account-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.account-status-badge.has-account {
    background-color: #d4edda;
    color: #155724;
}

.account-status-badge.no-account {
    background-color: #f8d7da;
    color: #721c24;
}

/* Role Badge */
.role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

/* Legacy role badge styles (kept for backward compatibility) */
.role-badge.admin {
    background: #fff3e0;
    color: #f57c00;
}

.role-badge.doctor {
    background: #e3f2fd;
    color: #1976d2;
}

.role-badge.receptionist {
    background: #e8f5e9;
    color: #2e7d32;
}

.role-badge.technician {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Doctor Type Badge */
.doctor-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.doctor-type-badge.internal {
    background: #e3f2fd;
    color: #1976d2;
}

.doctor-type-badge.external {
    background: #fff3e0;
    color: #f57c00;
}

.doctor-type-badge.teleradiologist {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Status Badge - Matching Doctors */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #f5f5f5;
    color: #888;
}

/* Not Applicable */
.not-applicable {
color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Action Buttons - Matching Doctors exactly */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
 display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action i {
    font-size: 14px;
}

.btn-action.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-action.edit:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
}

.btn-action.delete {
    background: #ffebee;
    color: #dc3545;
}

.btn-action.delete:hover {
    background: #dc3545;
    color: white;
  transform: translateY(-2px);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #556ee6;
    color: white;
}

.btn-primary:hover {
    background: #4458d4;
}

.btn-secondary {
    background: #74788d;
    color: white;
}

.btn-secondary:hover {
    background: #5a5e6f;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Form Controls */
.form-control {
  width: 100%;
    padding: 10px 14px;
  border: 1px solid #e5e9f2;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.1);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #556ee6;
}

.checkbox-item label {
    margin: 0;
 cursor: pointer;
    font-weight: 400;
    font-size: 14px;
}

/* Modalities Checkboxes Grid */
.modalities-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
    background: #fafbfe;
    border-radius: 8px;
    border: 1px solid #e5e9f2;
}

.modalities-checkboxes .checkbox-item {
    margin-bottom: 0;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e9f2;
  transition: all 0.2s;
}

.modalities-checkboxes .checkbox-item:hover {
    border-color: #556ee6;
    background: #f0f4ff;
}

.text-danger {
color: #dc3545;
}

.text-muted {
    color: #888;
    font-size: 13px;
}

.text-center {
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

.modal-small {
    max-width: 450px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eff2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2f3a4f;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
 font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
 color: #556ee6;
    font-size: 20px;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    opacity: 0.9;
    padding: 0;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eff2f7;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 50px; /* Extra padding to make room for the eye icon and browser autocomplete icon */
    flex: 1;
}

/* Hide browser's default password reveal icon to prevent overlap */
.password-input-wrapper input[type="password"]::-webkit-credentials-auto-fill-button,
.password-input-wrapper input[type="password"]::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.btn-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #74788d;
    transition: color 0.2s;
    z-index: 10; /* Ensure it's above browser autocomplete icons */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-password:hover {
    color: #556ee6;
}

.btn-toggle-password:focus {
    outline: none;
}

.btn-toggle-password i {
    font-size: 16px;
    line-height: 1;
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
  color: #556ee6;
}

.empty-state h3 {
    margin: 10px 0;
    color: #495057;
    font-size: 18px;
}

.empty-state p {
    font-size: 14px;
    margin: 10px 0;
    color: #888;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
  align-items: center;
    justify-content: center;
    padding: 40px;
    color: #556ee6;
}

.loading-state i {
    margin-bottom: 15px;
}

.loading-state p {
 color: #888;
    font-size: 14px;
  margin: 0;
}

/* Permission Assignment Section */
.permission-assignment-section {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.permission-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #556ee6;
}

.permission-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
}

.permission-section {
    margin-top: 12px;
}

.loader-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #556ee6;
    font-size: 14px;
}

.loader-container i {
    font-size: 16px;
}

.permissions-checkbox-container {
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    background: white;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.permissions-search {
    padding: 12px;
    border-bottom: 1px solid #e5e9f2;
    background: #f8f9fa;
}

.permissions-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    font-size: 14px;
}

.permissions-list {
    overflow-y: auto;
    padding: 12px;
    max-height: 350px;
}

.permissions-list .checkbox-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #fafbfe;
    border-radius: 6px;
    border: 1px solid #e5e9f2;
    transition: all 0.2s;
}

.permissions-list .checkbox-item:hover {
    background: #f0f4ff;
    border-color: #556ee6;
}

.permissions-list .checkbox-item label {
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.permissions-list .checkbox-item label .permission-code {
    font-weight: 600;
    color: #556ee6;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.permissions-list .checkbox-item label .permission-name {
    color: #666;
    font-size: 12px;
}

.permissions-list .checkbox-item label .permission-description {
    color: #888;
    font-size: 11px;
    font-style: italic;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1200px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-row {
   grid-template-columns: 1fr;
    }
    
  .page-header {
        gap: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
      gap: 4px;
    }
    
    .btn-action {
width: 100%;
   height: auto;
        padding: 8px;
    }
    
    .data-table {
   font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* Full Screen Loader Overlay */
.full-screen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.loader-content {
    background: white;
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 250px;
}

.loader-spinner {
    margin-bottom: 20px;
    color: #556ee6;
}

.loader-text {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    margin-top: 10px;
}