/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Layout */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-item {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dashboard-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(220, 53, 69, 0.4);
    border-color: #fff;
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.dashboard-item-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.dashboard-item-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.dashboard-item-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* Special styling for different sections */
.dashboard-item.users {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.dashboard-item.marketing {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.dashboard-item.performance {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.dashboard-item.payment {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.dashboard-item.complaint {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

.dashboard-item.insurance {
    background: linear-gradient(135deg, #fd7e14 0%, #e55100 100%);
}

.dashboard-item.message {
    background: linear-gradient(135deg, #20c997 0%, #1a9f85 100%);
}

.dashboard-item.faq {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.dashboard-item.balance {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.dashboard-item.representativeRequest {
    background: linear-gradient(135deg, #e83e8c 0%, #d63384 100%);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #007bff;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
}

/* Dashboard Layout */
.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #007bff;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #666;
    font-size: 14px;
}

/* Navigation */
.nav {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 10px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
}

.nav-item:hover {
    background: #e9ecef;
}

.nav-item.active {
    background: #007bff;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
}

/* Quick Access Cards */
.quick-access {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.quick-access-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.quick-access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.2);
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    border: 3px solid #000;
}

.quick-access-card:hover .card-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.user-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-role {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Header user info in a single row */
.header-right #userInfo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-right #userInfo .user-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.header-right #userInfo .user-name {
    margin: 0;
}
.header-right #userInfo .user-role {
    margin: 0;
}
.content-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    color: #333;
    font-size: 20px;
}

.section-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Vazirmatn', sans-serif;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Select Boxes */
select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Vazirmatn', sans-serif;
    background: white;
    min-width: 150px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

/* Bulk grid modal compact row spacing but taller inputs */
#bulkGridTable.data-table {
    border-collapse: collapse;
}
#bulkGridTable.data-table th,
#bulkGridTable.data-table td {
    padding: 4px 6px; /* minimal spacing between rows */
}
#bulkGridTable input[type="text"],
#bulkGridTable input[type="number"],
#bulkGridTable select {
    height: 40px; /* taller controls for easier editing */
    line-height: 40px;
}
#bulkGridTable input[type="file"] {
    height: 40px;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

#expertGroup {
    display: none;
}

#representativeFields {
    display: none;
}
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
    opacity: 0.7;
}
.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #dc3545;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 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);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin-bottom: 10px;
    border-right: 4px solid #007bff;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-right-color: #28a745;
}

.toast.error {
    border-right-color: #dc3545;
}

.toast.warning {
    border-right-color: #ffc107;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Profile Styles */
.balance-display {
    margin-bottom: 30px;
}

.balance-card {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.balance-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.balance-amount {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

.balance-updated {
    margin-top: -10px;
    margin-bottom: 15px;
    font-size: 12px;
    color: rgba(255,255,255,0.85);
}

.profile-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 15px 25px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #007bff;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* FAQ Styles */
.faq-list {
    margin-bottom: 20px;
}

.faq-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.faq-icon {
    transition: transform 0.3s;
}

.faq-item.expanded .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: none;
}

.faq-item.expanded .faq-answer {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        padding: 15px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .section-controls {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .quick-access {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .profile-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 50px 20px;
        padding: 30px 20px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .toast {
        min-width: 250px;
        font-size: 14px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-3 {
    gap: 1rem;
}

/* Persian Number Support */
.persian-number {
    font-family: 'Vazirmatn', sans-serif;
    direction: ltr;
    display: inline-block;
}

/* RTL Support */
[dir="rtl"] .search-box i {
    left: 15px;
    right: auto;
}

[dir="rtl"] .search-box input {
    padding: 10px 15px 10px 40px;
}

[dir="rtl"] .toast {
    border-left: 4px solid #007bff;
    border-right: none;
}

[dir="rtl"] .toast.success {
    border-left-color: #28a745;
    border-right: none;
}

[dir="rtl"] .toast.error {
    border-left-color: #dc3545;
    border-right: none;
}

.btn-link {
    background: none;
    color: #dc3545;
    text-decoration: underline;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}

.btn-link:hover {
    color: #c82333;
    text-decoration: none;
}

/* Icon buttons for table actions */
.btn.btn-icon {
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 16px;
}
.btn.btn-icon:hover {
    color: #dc3545;
}
.btn.btn-icon.danger {
    color: #dc3545;
}

/* Disabled download label */
.disabled-link {
    color: #9aa0a6;
    cursor: not-allowed;
    text-decoration: none;
    opacity: 0.7;
}

.thumb-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}
.thumb-link i {
    font-size: 16px;
    color: #444;
}
.thumb-link:hover i {
    color: #007bff;
}

/* Attachment editor UI */
.file-section {
    border: 1px solid #e6e6e6;
    background: #fafafa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
}
.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
}
.file-meta .att-name {
    font-weight: 600;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-actions a {
    margin-inline-start: 8px;
}
.file-remove {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #c0392b;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Narrow icon columns and widen description */
.data-table td.col-icon, .data-table th.col-icon {
    width: 56px;
    min-width: 56px;
    text-align: center;
}
.data-table td.col-ops, .data-table th.col-ops {
    width: 112px;
    min-width: 112px;
    text-align: center;
}
.data-table td.col-desc, .data-table th.col-desc {
    width: 40%;
}

/* Representatives preview modal */
.rep-preview .muted { color: #777; font-size: 12px; margin-top: 4px; }
.rep-preview-body .loading { color: #555; }
.text-danger { color: #c0392b; }
.text-success { color: #2ecc71; }
.rep-preview-header h4 { display: flex; align-items: baseline; gap: 8px; }
.rep-preview-header .rep-balance { font-weight: 600; }
.rep-preview-header .rep-subline { color: #555; font-size: 12px; margin-top: 4px; }
.rep-preview-header .rep-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: #333; line-height: 1; }
.rep-close:hover { color: #000; }

/* Profile Ticket list */
#profileTicketList .ticket-item { border: 1px solid #eee; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
#profileTicketList .ticket-header { font-weight: 700; margin-bottom: 6px; }
#profileTicketList .ticket-content { margin-bottom: 6px; line-height: 1.8; }
#profileTicketList .ticket-response { border-top: 1px dashed #ddd; padding-top: 6px; color: #333; }

.login-options {
    text-align: center;
    margin-top: 15px;
}
.user-info {
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.user-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.user-role {
    font-size: 14px;
    opacity: 0.9;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.btn-link {
    background: none;
    color: #dc3545;
    text-decoration: underline;
    border: none;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}

.btn-link:hover {
    color: #c82333;
    text-decoration: none;
}

.login-options {
    text-align: center;
    margin-top: 15px;
}

/* Profile Icons Grid */
.profile-icons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.profile-icons-grid .icon-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform .2s, box-shadow .2s;
}
.profile-icons-grid .icon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Profile two-column info grid */
.profile-info-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.65fr; /* ستون راست کمی کوتاه‌تر */
    margin-bottom: 20px;
    background: #ffffff; /* پس‌زمینهٔ اطلاعات پروفایل سفید */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f2f5; /* خطوط بیرونی با همان رنگ پس‌زمینه ستون راست */
}
.profile-info-grid .info-row {
    display: contents;
}
.profile-info-grid .info-label,
.profile-info-grid .info-value {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f0f2f5; /* خط‌کشی افقی با رنگ پس‌زمینه ستون راست */
}
.profile-info-grid .info-label {
    color: #555;
    background: #f6f7fa; /* پس‌زمینه برای ستون راست (برچسب) */
}
.profile-info-grid .info-value {
    color: #222;
    font-weight: 600;
    background: #ffffff; /* ستون چپ سفید */
    border-left: 1px solid #f0f2f5; /* مرز عمودی با همان رنگ پس‌زمینه ستون راست */
}

/* Selected state for icon cards */
.profile-icons-grid .icon-card.selected,
.quick-access .quick-access-card.selected {
    outline: 3px solid #dc3545;
    outline-offset: 2px;
}

/* Toggle switch for user active state */
.btn-toggle {
    position: relative;
    width: 28px;
    height: 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #e9ecef;
    padding: 0;
    margin-inline-end: 6px;
}
.btn-toggle span {
    position: absolute;
    top: 2px;
    right: 2px; /* RTL default */
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all .2s ease;
}
.btn-toggle.on {
    background: #28a745;
    border-color: #28a745;
}
.btn-toggle.on span {
    right: 14px; /* move knob left in RTL when ON */
}
.btn-toggle.off {
    background: #e0e0e0;
}
.btn-toggle[disabled], .btn-toggle[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
}

/* Inactive user row dimming */
.inactive-row {
    opacity: .7;
}

/* Lookup dropdown styles */
.lookup-container {
    position: relative;
}
.lookup-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.lookup-item {
    padding: 8px 10px;
    cursor: pointer;
}
.lookup-item:hover {
    background: #f6f7fa;
}

/* Inline field error */
.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.input-error {
    border-color: #dc3545 !important;
}

/* Representative Profile Message List */
.message-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.message-item { padding: 12px 14px; background: #ffffff; border: 1px solid #eee; border-radius: 8px; border-bottom: 2px solid #e9ecef; }
.message-header { background: #f8f9fa; padding: 8px 10px; border-radius: 6px; }
.message-title { font-weight: 700; font-size: 15px; color: #222; }
.message-date { margin-top: 4px; font-size: 12px; color: #666; }
.message-content { margin-top: 8px; line-height: 1.9; color: #333; font-size: 14px; }