/* modules/admin_correspondence/assets/style.css */

:root {
    --primary-color: #1a472a;
    --primary-dark: #0d2b1a;
    --primary-light: #e8f0ea;
    --secondary-color: #c5a572;
    --secondary-dark: #a8884d;
    --secondary-light: #f5efe5;
    --text-color: #2c3e2f;
    --text-light: #6b7c6e;
    --text-muted: #95a598;
    --border-color: #e2e8e2;
    --bg-light: #fafbf9;
    --bg-white: #ffffff;
    --bg-gray: #f7f9f7;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f5f7f5 0%, #eef2ee 100%);
    font-family: 'Cairo', 'Tajawal', sans-serif;
    padding: 24px;
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
}

/* ========== شريط التنقل ========== */
.nav-bar {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px 28px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo i {
    font-size: 28px;
    color: var(--secondary-color);
}

.nav-logo span {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    background: var(--bg-gray);
    color: var(--text-color);
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-link i {
    font-size: 14px;
}

.nav-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ========== البطاقة الرئيسية ========== */
.main-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 28px 32px;
}

.header h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: var(--secondary-color);
}

.header p {
    font-size: 14px;
    opacity: 0.85;
}

.content {
    padding: 32px;
}

/* ========== أزرار ========== */
.btn {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(26, 71, 42, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* ========== إحصائيات ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-white), var(--bg-gray));
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 600;
}

/* ========== نموذج ========== */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

label i {
    margin-left: 8px;
    color: var(--secondary-color);
    width: 20px;
}

.required {
    color: #dc2626;
    margin-right: 4px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select[multiple] {
    height: 120px;
}

small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 11px;
}

/* ========== جدول البيانات ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-gray);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--primary-light);
}

/* ========== بادجات ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}

.status-draft {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.status-sent {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.status-received {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.status-archived {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-gray);
    border-radius: 20px;
    font-size: 11px;
    margin: 2px;
}

/* ========== أزرار الإجراءات ========== */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 14px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.action-view {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.action-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-edit {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.action-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.action-delete {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.action-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ========== بطاقات المعلومات ========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.description-box {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.description-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== قسم المرفقات ========== */
.attachments-section {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.attachments-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.attachment-item {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.attachment-item:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.attachment-item i {
    font-size: 24px;
    color: var(--secondary-color);
}

.attachment-item a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}

/* ========== تنبيهات ========== */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-right: 4px solid #059669;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-right: 4px solid #dc2626;
}

/* ========== حالة فارغة ========== */
.empty-message {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.empty-message i {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    color: var(--secondary-color);
    opacity: 0.5;
}

.empty-message a {
    margin-top: 15px;
    display: inline-block;
}

/* ========== استجابة ========== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .content {
        padding: 20px;
    }
    
    .header {
        padding: 20px 24px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .nav-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* ========== رسوم متحركة ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stat-card, .module-card {
    animation: fadeInUp 0.5s ease forwards;
}

/* ========== سكرول بار ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}