/* ۱. فونت معمولی */
@font-face {
    font-family: 'Vazirmatn';
    src: url('Vazir.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ۲. فونت پررنگ (Bold) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('Vazir-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* ۳. اعمال فونت کلی به همه عناصر */
*, *::before, *::after, html, body {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
}

/* ۴. اعمال اختصاصی فونت بولد برای اینپوت‌ها، تکست‌باکس‌ها، چک‌باکس‌ها، سلکت‌ها، لیبل‌ها و دکمه‌ها */
input, 
textarea, 
select, 
button, 
label, 
.form-control,
.form-label,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="checkbox"],
input[type="radio"] {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-weight: bold !important;
}

/* برای اینکه متن راهنمای داخل اینپوت‌ها (placeholder) هم بولد دیده شود */
input::placeholder,
textarea::placeholder {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-weight: bold !important;
    opacity: 0.8;
}


/* ==========================================================================
   ۱. تنظیمات پایه و ریست (Base & Reset)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    padding: 0;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    background-color: #f3f6fa;
    color: #1f2937;
    min-height: 100vh;
    line-height: 1.5;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    max-width: 100%;
}

input, select, textarea, button {
    font-family: inherit;
    max-width: 100%;
}

/* ==========================================================================
   ۲. صفحه ورود (Login Page)
   ========================================================================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
    background: linear-gradient(135deg, #eaf2ff, #f8fafc);
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 30px 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-box h1 {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
    font-size: 22px;
    color: #1e3a8a;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group textarea {
    height: auto;
    padding: 10px 12px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-button {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.login-button:hover {
    background: #1d4ed8;
}

/* پیام‌های وضعیت */
.error-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #fee2e2;
    border-right: 4px solid #ef4444;
    color: #991b1b;
    font-size: 13px;
}

.success-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #dcfce7;
    border-right: 4px solid #10b981;
    color: #166534;
    font-size: 13px;
}

/* ==========================================================================
   ۳. هدر و ناوبری (Top Navigation Bar)
   ========================================================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #1e293b;
    color: #ffffff;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.main-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover {
    color: #ffffff;
    background: #334155;
}

.nav-link.active {
    color: #ffffff;
    background: #2563eb;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logout-button {
    padding: 6px 12px;
    border-radius: 6px;
    background: #ef4444;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background: #dc2626;
}

/* ==========================================================================
   ۴. ظرف داشبورد و کارت‌ها (Cards & Layout)
   ========================================================================== */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
}

.card,
.welcome-card,
.dashboard-card,
.user-form-card,
.users-list-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    border: 1px solid #e2e8f0;
    max-width: 100%;
    overflow: hidden;
}

.card h2,
.dashboard-card h2,
.users-list-card h2 {
    margin-top: 0;
    font-size: 18px;
    color: #1e3a8a;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* فرم‌های گرید */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ==========================================================================
   ۵. دکمه‌ها و لینک‌های عملیاتی (Buttons)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s, background-color 0.2s;
}

.btn:hover {
    opacity: 0.92;
}

.btn-green {
    background-color: #10b981;
    color: #ffffff;
}

.btn-orange {
    background-color: #f59e0b;
    color: #ffffff;
}

.btn-blue {
    background-color: #2563eb;
    color: #ffffff;
}

.cancel-button,
.edit-button,
.delete-button {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.cancel-button {
    background: #f1f5f9;
    color: #475569;
}

.edit-button {
    background: #e0f2fe;
    color: #0369a1;
}

.delete-button {
    background: #fee2e2;
    color: #b91c1c;
}

/* ==========================================================================
   ۶. جدول‌های اسکرول‌پذیر (Responsive Tables)
   ========================================================================== */
.table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.users-table,
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
    background: #ffffff;
}

.users-table th,
.users-table td,
table th,
table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.users-table th,
table th {
    background: #f8fafc;
    color: #475569;
    font-weight: bold;
}

.status-active {
    color: #15803d;
    font-weight: bold;
}

.status-inactive {
    color: #b91c1c;
    font-weight: bold;
}

/* ==========================================================================
   ۷. ریسپانسیو و حالت موبایل (Mobile Styles)
   ========================================================================== */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 10px;
        margin: 15px auto;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .user-area {
        justify-content: space-between;
        border-top: 1px solid #334155;
        padding-top: 8px;
    }

    .card,
    .welcome-card,
    .user-form-card,
    .users-list-card {
        padding: 14px;
        border-radius: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn,
    .form-actions .login-button,
    .form-actions .cancel-button {
        width: 100%;
        text-align: center;
    }
}