/* ============================================
   فایل استایل یکپارچه سامانه سازماندهی
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'Vazir', sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: #3182ce;
}

/* ============================================
   صفحه ورود
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 420px;
    width: 100%;
}

.login-box h1 {
    font-size: 20px;
    color: #2d3748;
    text-align: center;
    margin-bottom: 8px;
}

.login-box h2 {
    font-size: 16px;
    color: #718096;
    text-align: center;
    margin-bottom: 30px;
}

/* ============================================
   فرم‌ها
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #f7fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

/* ============================================
   دکمه‌ها
   ============================================ */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #667eea;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-logout {
    padding: 8px 20px;
    background: #e53e3e;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c53030;
}

.sticky-actions {
    position: sticky;
    top: 0;
    background: white;
    padding: 12px 20px;
    z-index: 100;
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-add {
    padding: 8px 20px;
    background: #38a169;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-add:hover {
    background: #2f855a;
}

.btn-back {
    padding: 8px 20px;
    background: #718096;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #4a5568;
}

.btn-edit {
    padding: 4px 12px;
    background: #3182ce;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 4px;
}

.btn-edit:hover {
    background: #2b6cb0;
}

.btn-delete {
    padding: 4px 12px;
    background: #e53e3e;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #c53030;
}

/* ============================================
   آلرت‌ها
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #fff5f5;
    border-right: 4px solid #e53e3e;
    color: #c53030;
}

.alert-success {
    background: #f0fff4;
    border-right: 4px solid #38a169;
    color: #2f855a;
}

/* ============================================
   داشبورد
   ============================================ */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-info span:first-child {
    font-weight: 600;
    font-size: 18px;
}

.badge {
    background: #667eea;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* پروفایل کاربر */
.user-profile {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.profile-item {
    display: flex;
    flex-direction: column;
}

.profile-item label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
}

.profile-item span {
    font-size: 14px;
    font-weight: 500;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.stat-item {
    background: #f7fafc;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
}

.profile-education {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 0;
}

.profile-education span {
    background: #edf2f7;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 13px;
}

.profile-status {
    padding: 8px 0;
    font-weight: 600;
}

.profile-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.profile-scores span {
    font-size: 15px;
}

.profile-scores span:first-child {
    color: #3182ce;
}
.profile-scores span:nth-child(2) {
    color: #38a169;
}
.profile-scores span:last-child {
    color: #e53e3e;
    font-weight: 700;
}

/* منوی اصلی */
.main-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.menu-section {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.menu-section h3 {
    font-size: 14px;
    color: #718096;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #edf2f7;
}

.menu-section ul {
    list-style: none;
}

.menu-section li {
    margin-bottom: 6px;
}

.menu-section a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    color: #4a5568;
}

.menu-section a:hover {
    background: #ebf4ff;
    color: #3182ce;
}

/* ============================================
   صفحه جدول
   ============================================ */
.table-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.filter-form {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
}

.filter-item input,
.filter-item select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

/* جدول داده‌ها */
.data-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-collapse: collapse;
}

.data-table thead {
    background: #2d3748;
    color: white;
}

.data-table th {
    padding: 12px 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

/* صفحه‌بندی */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination a.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ============================================
   صفحه خروجی و ورودی
   ============================================ */
.export-container,
.import-container,
.select-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.export-options {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tables-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input {
    width: 18px;
    height: 18px;
}

.checkbox-item label {
    font-size: 14px;
}

.import-instructions {
    background: #ebf8ff;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-right: 4px solid #3182ce;
}

.import-instructions ul {
    padding-right: 20px;
    margin-top: 8px;
}

.import-instructions li {
    font-size: 14px;
    margin-bottom: 4px;
}

/* ============================================
   واکنش‌گرا (Responsive)
   ============================================ */
@media (max-width: 768px) {
    .login-box {
        padding: 24px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .user-info {
        justify-content: center;
    }

    .main-menu {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .sticky-actions {
        flex-direction: column;
    }

    .sticky-actions a {
        text-align: center;
    }

    .tables-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        flex-direction: column;
        gap: 6px;
    }

    .profile-education {
        flex-direction: column;
        gap: 6px;
    }

    .profile-scores {
        flex-direction: column;
        gap: 4px;
    }

    .search-box {
        flex-direction: column;
    }
}