/* ========== فونت وزیرمتن ========== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

/* ========== تنظیمات پایه ========== */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #818cf8;
    --bg: #f9fafb;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== تایپوگرافی ========== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75em;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1em;
    color: var(--text-muted);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========== کانتینر ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== هدر ========== */
.header {
    background: var(--bg-card);
    padding: 15px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.logo {
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* ========== کارت‌ها ========== */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

/* ========== فرم‌ها ========== */
input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 18px;
    font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    direction: rtl;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* ========== دکمه‌ها ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    text-decoration: none;
}
.btn:active {
    transform: translateY(0);
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 10px;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
.btn-danger {
    background: var(--error);
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-success {
    background: var(--success);
}
.btn-success:hover {
    background: #059669;
}

/* ========== پیام‌ها ========== */
.alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ========== جدول‌ها ========== */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}
th, td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-weight: 400;
}
th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover {
    background: #f9fafb;
}

/* ========== آمار کارت‌ها ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--bg-card);
    padding: 20px 25px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-3px);
}
.stat-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.stat-card .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

/* ========== بَج‌ها ========== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.badge-primary { background: #e0e7ff; color: #3730a3; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }
    
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .card {
        padding: 20px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    th, td {
        padding: 10px 12px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .card {
        border-radius: 12px;
        padding: 16px 14px;
    }
}

/* ========== انیمیشن‌ها ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .alert {
    animation: fadeIn 0.3s ease-out;
}

/* ========== اسکرول بار زیبا ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}