/* استایل‌های صفحه مدیریت سامانه مکاتبات */
.samane-admin-wrap {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    overflow-x: hidden;
}

.samane-admin-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.samane-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-box.pending {
    border-right: 4px solid #ff9800;
}

.stat-box.approved {
    border-right: 4px solid #4caf50;
}

.stat-box.rejected {
    border-right: 4px solid #f44336;
}

.stat-number {
    font-size: 1.5em;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
}

/* جستجو و فیلتر */
.admin-search-filter {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-btn,
.clear-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.search-btn {
    background: #2196f3;
    color: white;
}

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

.filter-options select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* جدول درخواست‌ها */
.requests-table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.requests-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.requests-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: right;
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9em;
    white-space: nowrap;
}

.requests-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.85em;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-manage {
    background: #2196f3;
    color: #fff;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
}

.btn-respond {
    background: #28a745;
    color: #fff;
}

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

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

.btn-primary {
    background: #2e7d32;
    color: white;
}

.btn-primary:hover {
    background: #1b5e20;
}

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

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

/* استایل‌های مودال مدیریت */
.management-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #2196f3;
}

.management-section h3 {
    margin-top: 0;
    color: #2196f3;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
    font-size: 1.1em;
}

.danger-section {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.danger-section h3 {
    color: #dc3545;
}

.danger-actions {
    text-align: center;
}

.danger-note {
    display: block;
    margin-top: 8px;
    color: #721c24;
    font-size: 11px;
}

/* استایل‌های مودال */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    float: left;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    position: absolute;
    left: 15px;
    top: 15px;
    z-index: 1;
}

.close:hover {
    color: #333;
}

.request-details-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-right: 4px solid #2e7d32;
}

.request-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.info-label {
    font-weight: bold;
    color: #495057;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.info-value {
    color: #212529;
    font-size: 0.9em;
    text-align: left;
}

.content-preview {
    background: #fff;
    padding: 12px;
    border-radius: 5px;
    margin-top: 8px;
    border: 1px solid #dee2e6;
    font-size: 0.9em;
    line-height: 1.4;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 15px;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 5px;
    font-size: 0.9em;
}

/* استایل‌های فرم */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2e7d32;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 11px;
}

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

/* استایل‌های فرم ردیفی */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
}

/* استایل‌های تکمیلی */
.loading-state {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.status-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.table-info {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.no-requests {
    padding: 40px 20px;
    text-align: center;
}

.empty-state {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
    line-height: 1.5;
}

/* استایل‌های پیام */
.samane-message {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: messageSlideIn 0.3s ease-out;
}

.samane-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.samane-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.samane-message button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.samane-message button:hover {
    opacity: 1;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* رسپانسیو برای تبلت */
@media (max-width: 768px) {
    .samane-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .requests-table table {
        min-width: 900px;
    }

    .modal-content {
        max-width: 90%;
        padding: 15px;
    }
}

/* رسپانسیو برای موبایل */
@media (max-width: 550px) {
    .samane-admin-wrap {
        padding: 5px;
    }

    .samane-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-box {
        padding: 12px 8px;
        min-height: 70px;
    }

    .stat-number {
        font-size: 1.3em;
    }

    .stat-label {
        font-size: 0.8em;
    }

    .admin-search-filter {
        padding: 12px;
    }

    .search-box {
        flex-direction: column;
        gap: 8px;
    }

    .search-box input {
        min-width: 100%;
    }

    .search-btn,
    .clear-btn {
        width: 100%;
        padding: 12px;
    }

    .requests-table {
        margin: 0 -5px;
        border-radius: 0;
    }

    .requests-table table {
        min-width: 1000px;
        font-size: 0.8em;
    }

    .requests-table th,
    .requests-table td {
        padding: 8px 6px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 3px;
    }

    .btn {
        padding: 8px;
        font-size: 10px;
        width: 100%;
        text-align: center;
    }

    .modal {
        padding: 5px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        padding: 15px;
        margin: 0;
        border-radius: 8px;
    }

    .close {
        font-size: 20px;
        left: 10px;
        top: 10px;
    }

    .management-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 8px;
    }

    .form-row .form-group {
        min-width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .request-info-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
    }

    .info-label {
        margin-bottom: 4px;
        font-size: 0.85em;
    }

    .info-value {
        text-align: right;
        width: 100%;
        font-size: 0.85em;
    }

    .status-badge {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 60px;
    }

    .table-info {
        padding: 10px;
        font-size: 0.8em;
    }
}

/* رسپانسیو برای موبایل‌های کوچک */
@media (max-width: 480px) {
    .samane-stats {
        grid-template-columns: 1fr;
    }

    .stat-box {
        padding: 10px 6px;
        min-height: 60px;
    }

    .stat-number {
        font-size: 1.2em;
    }

    .stat-label {
        font-size: 0.75em;
    }

    .requests-table table {
        min-width: 1100px;
        font-size: 0.75em;
    }

    .requests-table th,
    .requests-table td {
        padding: 6px 4px;
    }

    .modal-content {
        padding: 12px;
    }

    .management-section {
        padding: 10px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 13px;
    }

    .content-preview {
        padding: 10px;
        font-size: 0.85em;
    }

    .loading-spinner {
        width: 30px;
        height: 30px;
    }
}

/* بهبود نمایش برای حالت landscape در موبایل */
@media (max-width: 480px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }

    .samane-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .requests-table {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* پشتیبانی از تاچ */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 12px 15px;
        min-height: 44px;
    }

    .close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .action-buttons .btn {
        min-height: 36px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* جلوگیری از زوم در iOS */
    }
}

/* نمایش بهتر در حالت پرینت */
@media print {

    .admin-search-filter,
    .action-buttons,
    .no-print {
        display: none !important;
    }

    .requests-table {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    .requests-table table {
        min-width: auto !important;
    }
}
// و این استایل را به CSS اضافه کنید:
//@media (max-width: 550px) {
  //  .mobile-only {
    //    display: block !important;
      //  font-size: 0.8em;
        //color: #ff9800;
      //  margin-top: 5px;
   // }
//}

