/* ========== فرم ثبت درخواست پرسنلی (طراحی جدید) ========== */

/* کانتینر اصلی ویجت ترکیبی */
.personnel-request-list-widget {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* هدر ویجت */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--primary-color);
}

.widget-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.widget-header h3 i {
    color: var(--primary-color);
    margin-left: 8px;
}

.widget-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    padding: 5px 12px;
    border-radius: 25px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: monospace;
}

.widget-timer i {
    color: var(--primary-color);
}

/* چیدمان دو ستونه */
.request-list-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: stretch;
}

.form-column,
.list-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ========== فرم درخواست ========== */
.personnel-request-form {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field.full-width {
    grid-column: span 2;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.form-field label i {
    color: var(--primary-color);
    width: 16px;
    font-size: 0.8rem;
}

.form-field select,
.form-field input,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--input-bg, var(--card-bg));
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-field select:focus,
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.1);
}

.form-field input[type="time"] {
    direction: ltr;
    text-align: right;
}

.date-input {
    cursor: pointer;
    background-color: var(--input-bg, var(--card-bg));
}

/* دکمه‌های فرم */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.cancel-btn,
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    height: 42px;
}

.cancel-btn {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    color: var(--text-secondary);
}

.cancel-btn:hover {
    background: var(--bg-hover-dark, rgba(0, 0, 0, 0.1));
    transform: translateY(-1px);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark, #1e40af);
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* پیام‌های فرم */
.request-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 16px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.request-message.success {
    background: #dcfce7;
    color: #10b981;
    border: 1px solid #10b98130;
}

.request-message.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #dc262630;
}

.request-message.info {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #0284c730;
}

.form-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ========== لیست درخواست‌های کاربر ========== */
.user-requests-widget {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.user-requests-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-requests-header h4 i {
    color: var(--primary-color);
}

.refresh-btn {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.user-requests-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
}

.user-request-item {
    background: var(--bg-hover, rgba(0, 0, 0, 0.02));
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.user-request-item:hover {
    transform: translateX(-3px);
    border-color: var(--primary-color);
}

.request-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.request-type i {
    color: var(--primary-color);
}

.request-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.request-status {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #f59e0b;
}

.status-approved {
    background: #dcfce7;
    color: #10b981;
}

.status-rejected {
    background: #fee2e2;
    color: #dc2626;
}

.user-requests-loading,
.user-requests-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.user-requests-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* ========== انیمیشن ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.personnel-request-list-widget {
    animation: slideDown 0.3s ease;
}

/* ========== ریسپانسیو ========== */
@media (max-width: 992px) {
    .request-list-dual {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .widget-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .request-list-dual {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-field.full-width {
        grid-column: span 1;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .cancel-btn,
    .submit-btn {
        justify-content: center;
        width: 100%;
    }
    
    .user-request-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .request-status {
        align-self: flex-start;
    }
}

/* ========== دارک مود ========== */
.dark-mode .personnel-request-list-widget,
.dark-mode .user-requests-widget {
    background: var(--bg-secondary);
}

.dark-mode .widget-header,
.dark-mode .user-requests-header {
    background: var(--card-bg);
}

.dark-mode .form-field select,
.dark-mode .form-field input,
.dark-mode .form-field textarea {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .user-request-item {
    background: var(--card-bg);
}

.dark-mode .cancel-btn {
    background: #374151;
    color: #e5e7eb;
}

.dark-mode .cancel-btn:hover {
    background: #4b5563;
}

.dark-mode .request-message.success {
    background: #10b98120;
    color: #34d399;
}

.dark-mode .request-message.error {
    background: #ef444420;
    color: #f87171;
}

.dark-mode .request-message.info {
    background: #3b82f620;
    color: #60a5fa;
}

/* فقط برای ویجت فرم درخواست پرسنلی - عرض کمتر */
.personnel-request-list-widget {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* در دسکتاپ بزرگ */
@media (min-width: 1400px) {
    .personnel-request-list-widget {
        max-width: 1500px;
    }
}

/* در دسکتاپ معمولی */
@media (min-width: 992px) and (max-width: 1399px) {
    .personnel-request-list-widget {
        max-width: 750px;
    }
}

/* در تبلت و موبایل - عرض کامل */
@media (max-width: 991px) {
    .personnel-request-list-widget {
        max-width: 100%;
    }
}

/* ========== کارت جزئیات پرسنل با پشتیبانی کامل از تم ========== */

.expanded-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
}

.expanded-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.expanded-card-title i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.expanded-card-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.expanded-card-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    padding: 4px 12px;
    border-radius: 25px;
}

.expired-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.expired-timer i {
    color: var(--primary-color);
}

.pause-timer-btn {
    background: var(--bg-hover, rgba(0, 0, 0, 0.08));
    border: none;
    color: var(--text-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pause-timer-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.close-expanded-btn {
    background: var(--bg-hover, rgba(0, 0, 0, 0.08));
    border: none;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-expanded-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.expanded-card-body {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex-wrap: wrap;
}

.expanded-avatar {
    flex-shrink: 0;
}

.expanded-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.expanded-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-label i {
    width: 16px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.status-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background: #10b98120;
    color: #10b981;
}

.status-inactive {
    background: #ef444420;
    color: #ef4444;
}

/* موبایل */
@media (max-width: 768px) {
    .expanded-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .expanded-info {
        grid-template-columns: 1fr;
    }
    
    .info-row {
        justify-content: center;
    }
    
    .expanded-card-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .timer-controls {
        margin-top: 5px;
    }
}

/* لایت مود - تنظیمات اضافی */
.light-mode .timer-controls {
    background: #e5e7eb;
}

.light-mode .pause-timer-btn,
.light-mode .close-expanded-btn {
    background: #d1d5db;
    color: #374151;
}

.light-mode .pause-timer-btn:hover {
    background: var(--primary-color);
    color: white;
}

.light-mode .close-expanded-btn:hover {
    background: #ef4444;
    color: white;
}

/* دارک مود */
.dark-mode .expanded-card-header {
    background: var(--bg-secondary);
    border-bottom-color: var(--primary-color);
}

.dark-mode .timer-controls {
    background: #374151;
}

.dark-mode .pause-timer-btn,
.dark-mode .close-expanded-btn {
    background: #4b5563;
    color: #f3f4f6;
}

.dark-mode .pause-timer-btn:hover {
    background: var(--primary-color);
    color: white;
}

.dark-mode .close-expanded-btn:hover {
    background: #ef4444;
    color: white;
}

.dark-mode .expanded-personnel-card {
    background: var(--bg-secondary);
}

.user-request-item .request-duration {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 20px;
}

.user-request-item .request-duration i {
    color: var(--primary-color);
    font-size: 0.7rem;
}

/* استایل دکمه‌های اضافی برای ویجت افزودن کاربر */
.widget-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-widget-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.close-widget-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.widget-content {
    padding: 1.5rem;
}

.widget-content .personnel-request-form {
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.avatar-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--primary-color);
}

/* در دارک مود */
.dark-mode .close-widget-btn {
    background: rgba(0, 0, 0, 0.3);
    color: white;
}
.dark-mode .close-widget-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}
/* چیدمان ۴ ستونه برای فرم افزودن کاربر */
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* در تبلت به ۲ ستونی تبدیل شود */
@media (max-width: 992px) {
    .user-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* در موبایل به ۱ ستونی */
@media (max-width: 576px) {
    .user-form-grid {
        grid-template-columns: 1fr;
    }
}

/* فیلد تمام‌عرض (برای آواتار) */
.user-form-grid .full-width {
    grid-column: span 4;
}
@media (max-width: 992px) {
    .user-form-grid .full-width {
        grid-column: span 2;
    }
}
@media (max-width: 576px) {
    .user-form-grid .full-width {
        grid-column: span 1;
    }
}

/* استایل بخش آواتار - در صورت نیاز */
.avatar-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--primary-color);
}
.widget-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.close-widget-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.close-widget-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.widget-content {
    padding: 1.5rem;
}
.widget-content .personnel-request-form {
    margin: 0;
    padding: 0;
    box-shadow: none;
}
.pause-timer-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}
.pause-timer-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 992px) { .user-form-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .user-form-grid { grid-template-columns: 1fr; } }
.user-form-grid .full-width { grid-column: span 4; }
@media (max-width: 992px) { .user-form-grid .full-width { grid-column: span 2; } }
@media (max-width: 576px) { .user-form-grid .full-width { grid-column: span 1; } }

.avatar-upload-wrapper { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.avatar-preview { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--primary-color); }
.widget-header-actions { display: flex; align-items: center; gap: 12px; }
.close-widget-btn, .pause-timer-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}
.close-widget-btn { font-size: 18px; font-weight: bold; }
.close-widget-btn:hover, .pause-timer-btn:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
.widget-content { padding: 1.5rem; }
.widget-content .personnel-request-form { margin: 0; padding: 0; box-shadow: none; }

/* استایل دکمه + برای سلکت‌ها */
.add-option-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.add-option-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* مودال افزودن گزینه (اختیاری) */
.add-option-modal {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ========== پاپ‌آپ افزودن گزینه جدید (بدون هدر) ========== */
.add-option-popup {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    width: 260px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    direction: rtl;
}

.add-option-popup .popup-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.add-option-popup input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.add-option-popup .error-message {
    color: #ef4444;
    font-size: 10px;
    margin-top: 4px;
}

.add-option-popup .popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.add-option-popup .cancel-btn-small {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    font-size: 12px;
}

.add-option-popup .save-btn-small {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 12px;
}

/* ========== پاپ‌آپ افزودن گزینه جدید (بدون هدر) ========== */
.add-option-popup {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    width: 260px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    direction: rtl;
}

.add-option-popup .popup-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.add-option-popup input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.add-option-popup .error-message {
    color: #ef4444;
    font-size: 10px;
    margin-top: 4px;
}

.add-option-popup .popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.add-option-popup .cancel-btn-small {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    background: var(--bg-hover);
    cursor: pointer;
    font-size: 12px;
}

.add-option-popup .save-btn-small {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 12px;
}

/* اطمینان از قرارگیری سلکت و دکمه + در کنار هم */
.select-with-add-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.select-with-add-wrapper .select-field {
    flex: 1;
    min-width: 0; /* جلوگیری از سرریز */
}

.add-option-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.add-option-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* در فرم‌های گرید، اطمینان از اینکه .form-field محتوا را درست چیدمان کند */
.user-form-grid .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-form-grid .form-field .select-with-add-wrapper {
    margin-top: 0;
}

/* دکمه‌های ویرایش و حذف در هدر کارت جزئیات */
.edit-user-btn, .delete-user-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

/* رنگ آیکون در حالت عادی - از متغیر متن استفاده کن (در لایت مود تیره، در دارک مود روشن) */
.edit-user-btn, .delete-user-btn {
    color: var(--text-primary);
}

/* هاور دکمه ویرایش */
.edit-user-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* هاور دکمه حذف */
.delete-user-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.05);
}

/* در صورت نیاز، برای لایت مود اطمینان از تیره بودن */
.light-mode .edit-user-btn,
.light-mode .delete-user-btn {
    color: #1f2937; /* رنگ تیره برای دیده شدن */
}

/* برای دارک مود */
.dark-mode .edit-user-btn,
.dark-mode .delete-user-btn {
    color: #e5e7eb; /* رنگ روشن */
}

/* ========== تم تاریک برای ویجت افزودن کاربر ========== */
.dark-mode .personnel-request-list-widget {
    background: #1e293b;        /* رنگ پس‌زمینه کارت (تیره ملایم) */
    border-color: #334155;      /* رنگ حاشیه */
}

.dark-mode .widget-header {
    background: #0f172a;        /* رنگ هدر (تیره‌تر) */
    border-bottom-color: #334155;
}

.dark-mode .widget-header h3 {
    color: #f1f5f9;             /* رنگ عنوان هدر در دارک مود */
}

.dark-mode .widget-header-actions button,
.dark-mode .widget-header-actions .widget-timer {
    color: #e2e8f0;             /* رنگ تایمر و دکمه‌ها */
}

.dark-mode .widget-content {
    background: #1e293b;        /* رنگ بدنه محتوا */
}

.dark-mode .personnel-request-form {
    background: transparent;     /* رنگ فرم را شفاف کن تا از والدش (widget-content) ارث ببرد */
}

/* در صورت تمایل، رنگ فیلدهای ورودی و سلکت‌ها را نیز می‌توانید تنظیم کنید */
.dark-mode .form-field input,
.dark-mode .form-field select,
.dark-mode .form-field textarea {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

.dark-mode .form-field input:focus,
.dark-mode .form-field select:focus,
.dark-mode .form-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.user-form-grid .double-width {
    grid-column: span 2;
}
.user-form-toggle-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    grid-column: span 4; /* در صورت نیاز تمام عرض */
}

/* ردیف آواتار و تاگل‌ها */
.avatar-toggle-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    grid-column: span 4;  /* تمام عرض فرم را بگیرد */
}

/* بخش آواتار */
.avatar-field {
    flex: 1;
    min-width: 0;
}

/* بخش تاگل‌های تغذیه */
.toggle-group-field {
    flex: 2;
    min-width: 0;
}

/* گروه عمودی تاگل‌ها */
.toggle-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* تنظیمات ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .avatar-toggle-row {
        flex-direction: column;
        gap: 1rem;
    }
}
/* ردیف آواتار و تاگل‌ها (تمام عرض) */
.avatar-toggle-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    grid-column: span 4;  /* در صورت استفاده داخل user-form-grid */
}

/* ستون آواتار */
.avatar-field {
    flex: 1;
    min-width: 0;
}

/* ستون تاگل‌های تغذیه */
.toggle-group-field {
    flex: 2;
    min-width: 0;
}

/* گروه عمودی تاگل‌ها (مانند کلاس قبلی) */
.toggle-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* استایل لیبل در این ردیف مثل بقیه فیلدها (اختیاری) */
.avatar-field label,
.toggle-group-field label {
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .avatar-toggle-row {
        flex-direction: column;
        gap: 1rem;
    }
}
/* ردیف آواتار و تاگل‌ها (مانند سایر فیلدها) */
.avatar-toggle-row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

/* ستون آواتار */
.avatar-col {
    flex: 1;
}

/* ستون تاگل‌ها */
.toggle-col {
    flex: 2;
}

/* گروه عمودی تاگل‌ها (همان استایل قبلی) */
.toggle-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* اطمینان از هماهنگی با استایل لیبل‌های موجود */
.avatar-col label,
.toggle-col label {
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .avatar-toggle-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ردیف گروه آواتار و تاگل‌ها */
.avatar-toggle-group {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

/* ستون آواتار */
.avatar-field {
    flex: 1;
}

/* ستون تاگل‌ها */
.toggles-field {
    flex: 2;
}

/* گروه عمودی تاگل‌ها */
.toggles-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* استایل لیبل‌های این دو ستون (هماهنگ با لیبل‌های دیگر فرم) */
.avatar-field label,
.toggles-field label {
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

/* در موبایل به صورت ستونی درآید */
@media (max-width: 768px) {
    .avatar-toggle-group {
        flex-direction: column;
        gap: 1rem;
    }
}

/* پاپ‌آپ افزودن گزینه (کنار موس) */
.add-option-popup {
    position: fixed;
    width: 280px;
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 10001;
    direction: rtl;
    border: 1px solid var(--border-color, #e2e8f0);
}

.add-option-popup h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-option-popup h4 i {
    color: var(--primary-color, #2c7da0);
}

.add-option-popup .form-group {
    margin-bottom: 12px;
}

.add-option-popup label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: var(--text-secondary, #475569);
}

.add-option-popup input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1e293b);
    transition: 0.2s;
}

.add-option-popup input:focus {
    outline: none;
    border-color: var(--primary-color, #2c7da0);
    box-shadow: 0 0 0 2px rgba(44,125,160,0.1);
}

.add-option-popup .popup-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.add-option-popup .cancel-btn {
    background: transparent;
    border: 1px solid var(--border-color, #cbd5e1);
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.add-option-popup .submit-btn {
    background: var(--primary-color, #2c7da0);
    border: none;
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
}

/* حالت responsive برای موبایل */
@media (max-width: 768px) {
    .expanded-card-body {
        flex-direction: column !important;
    }
    .requests-sidebar {
        margin-top: 16px;
    }
}
.filter-chip.active {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.requests-list::-webkit-scrollbar {
    width: 4px;
}
.requests-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.requests-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* استایل‌های سایدبار درخواست‌ها (قابل استفاده در هر دو تم) */
.requests-sidebar {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* دکمه‌های فیلتر */
.filter-chip {
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    background: var(--bg-secondary, #e2e8f0);
    color: var(--text-secondary, #334155);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.filter-chip.active {
    background: var(--primary-color, #2c7da0);
    color: white;
}

/* آیتم درخواست */
.request-item {
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding: 8px 0;
    margin-bottom: 6px;
}

/* اسکرول بار */
.requests-list::-webkit-scrollbar {
    width: 4px;
}
.requests-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f1f1);
}
.requests-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #cbd5e1);
    border-radius: 10px;
}

/* در حالت دارک مود، اگر نیاز به تنظیم جداگانه دارید */
.dark-mode .requests-sidebar {
    background: var(--bg-card-dark, #1e293b);
    border-color: var(--border-color-dark, #334155);
}
.dark-mode .filter-chip {
    background: var(--bg-secondary-dark, #334155);
    color: var(--text-secondary-dark, #cbd5e1);
}
.dark-mode .request-item {
    border-bottom-color: var(--border-color-dark, #334155);
}
@media (max-width: 768px) {
    .expanded-card-body {
        flex-direction: column !important;
        align-items: center !important;
    }
    .expanded-avatar, .expanded-info, .requests-sidebar {
        width: 100%;
        max-width: 400px;
    }
}

/* استایل پایه سایدبار درخواست‌ها (برای لایت مود) */
.requests-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* استایل برای دارک مود */
.dark-mode .requests-sidebar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* دکمه‌های فیلتر در لایت مود */
.filter-chip {
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    background: #e2e8f0;
    color: #334155;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.filter-chip.active {
    background: #2c7da0;
    color: white;
}

/* دکمه‌های فیلتر در دارک مود */
.dark-mode .filter-chip {
    background: #334155;
    color: #cbd5e1;
}
.dark-mode .filter-chip.active {
    background: #2c7da0;
    color: white;
}

/* خط جداکننده آیتم‌های درخواست در لایت مود */
.request-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
    margin-bottom: 6px;
}

/* خط جداکننده در دارک مود */
.dark-mode .request-item {
    border-bottom-color: #334155;
}

/* متن‌ها در دارک مود */
.dark-mode .requests-sidebar h4,
.dark-mode .requests-sidebar .request-item span:first-child {
    color: #f1f5f9;
}
.dark-mode .requests-sidebar .request-item div:last-child {
    color: #94a3b8;
}
@media (max-width: 600px) {
    .request-item > div {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
    }
}