/* معرفی فونت وزیرمتن از پوشه لوکال شما */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

/* متغیرهای رنگی (تم قرمز و خاکستری) */
:root {
    --primary-color: #d32f2f; /* قرمز اصلی */
    --primary-light: #ff6659;
    --primary-dark: #9a0007;
    --bg-color: #f4f6f8; /* رنگ پس‌زمینه داشبورد */
    --sidebar-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #777777;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --success: #4caf50;
    --warning: #ff9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ساختار اصلی (سایدبار سمت راست، محتوا سمت چپ) */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    padding-top: 20px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.05);
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li a {
    display: block;
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
    border-right: 4px solid transparent;
}

.sidebar ul li a:hover {
    background-color: #fce4e4;
    color: var(--primary-color);
    border-right-color: var(--primary-color);
}

/* بخش محتوای داشبورد */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* شبکه‌بندی کارت‌های داشبورد */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.card-title {
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* نمودارها */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}
/* Sidebar Dropdown Styles */
.dropdown-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.dropdown-toggle .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* چرخش فلش هنگام باز شدن */
.dropdown.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none; /* مخفی در حالت پیش‌فرض */
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f8f9fa; /* رنگ پس‌زمینه کمی متفاوت برای زیرمنو */
    border-right: 3px solid #e74c3c; /* یک خط رنگی کنار زیرمنو برای زیبایی */
}

.submenu li a {
    display: block;
    padding: 10px 15px 10px 40px; /* ایجاد تو رفتگی (padding-right بیشتر در راست‌چین) */
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
}

/* چون سایت راست‌چین است، پدینگ راست باید بیشتر باشد */
[dir="rtl"] .submenu li a, .submenu li a {
    padding: 10px 40px 10px 15px; 
}

.submenu li a:hover {
    background-color: #ebeef2;
    color: #c0392b;
}

/* کلاسی که با JS اضافه می‌شود تا منو باز شود */
.submenu.show {
    display: block;
}
/* =========================================
   استایل‌های حرفه‌ای مودال و فرم‌ها
   ========================================= */

/* پس‌زمینه تاریک مودال */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.5); /* سایه نرم‌تر برای بک‌گراند */
    backdrop-filter: blur(4px); /* افکت تار شدن پس‌زمینه (اختیاری) */
}

/* باکس اصلی مودال */
.modal-content {
    background-color: #ffffff;
    margin: 5% auto; 
    padding: 30px;
    border: none;
    width: 70%; 
    max-width: 900px;
    border-radius: 12px; /* گوشه‌های گرد و نرم */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* سایه حرفه‌ای */
    direction: rtl;
}

/* دکمه بستن (ضربدر) */
.close-btn {
    float: left;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}
.close-btn:hover {
    color: #e74c3c;
}

/* عنوان مودال */
.modal-content h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* -----------------------------------------
   استایل تب‌ها (Tabs)
   ----------------------------------------- */
.tab {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 25px;
    padding-bottom: 10px;
}

.tablinks {
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 1rem;
    font-family: inherit;
    color: #666;
    border-radius: 8px; /* دکمه‌های کپسولی */
    transition: all 0.3s ease;
}

.tablinks:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* تب فعال */
.tablinks.active {
    background-color: #8c1c1c; /* رنگ قرمز متناسب با تم شما */
    color: #fff;
    box-shadow: 0 4px 10px rgba(140, 28, 28, 0.3); /* سایه نرم برای تب فعال */
}

/* -----------------------------------------
   استایل گرید و فیلدهای فرم
   ----------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.form-input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* افکت هنگام کلیک روی فیلدها */
.form-input:focus {
    border-color: #8c1c1c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 28, 28, 0.1);
}

.full-width {
    grid-column: 1 / -1;
}

/* مخفی کردن تب‌های غیرفعال */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

/* انیمیشن نرم برای نمایش تب‌ها */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   Modern Header Styles
========================================= */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #d32f2f; /* رنگ قرمز مشابه عکس شما */
    color: #ffffff;
    padding: 0 20px;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

/* بخش راست (لوگو) */
.header-right {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    background-color: rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-titles h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.brand-titles span {
    font-size: 12px;
    opacity: 0.8;
}

/* بخش چپ (پروفایل و آیکون ها) */
.header-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    position: relative;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn .badge {
    position: absolute;
    top: -2px;
    right: -8px;
    background-color: #ffb300;
    color: #333;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #d32f2f;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.user-profile:hover {
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: bold;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #fff;
    color: #d32f2f;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}
/* گرد کردن لبه‌های لینک‌های سایدبار (شبیه هدر) */
.sidebar .nav-links a {
    border-radius: 50px !important; /* لبه‌های کاملاً گرد کپسولی */
    margin: 5px 15px; /* فاصله از لبه‌های سایدبار برای زیبایی بیشتر */
    transition: all 0.3s ease;
}

/* اضافه کردن سایه نرم و تغییر رنگ در حالت هاور و فعال */
.sidebar .nav-links li.active > a,
.sidebar .nav-links li:hover > a {
    background-color: #fff !important; /* یا رنگ پس‌زمینه دلخواه شما */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important; /* سایه نرم و خوش‌حس */
    transform: translateY(-1px); /* یک پرش بسیار ریز و جذاب به سمت بالا */
}

/* تنظیم استایل زیرمنوها برای هماهنگی با این ظاهر جدید */
.sidebar .submenu a {
    border-radius: 15px !important; /* گردی کمتر برای زیرمنوها */
    margin: 2px 20px 2px 10px;
}

/* تراز کردن کل بخش سمت چپ هدر */
.header-left {
    display: flex;
    align-items: center; /* تراز عمودی در مرکز */
    gap: 15px; /* فاصله یکسان بین آیتم‌ها */
    height: 100%;
}

/* دادن ارتفاع و تراز یکسان به پروفایل، دکمه اعلان و تاریخ */
.user-profile, 
.header-actions .icon-btn, 
.header-date {
    display: flex;
    align-items: center; /* تراز عمودی محتوای داخل هر باکس */
    justify-content: center;
    height: 45px; /* 👈 یک ارتفاع ثابت برای همه تا هم‌اندازه شوند */
    box-sizing: border-box;
}

/* تنظیمات تکمیلی برای زیبایی بیشتر */
.user-profile {
    padding: 0 5px 0 15px;
    border-radius: 50px;
}

.header-date {
    padding: 0 15px;
    border-radius: 50px;
}

.header-actions .icon-btn {
    width: 45px; /* عرض و ارتفاع برابر برای دکمه زنگوله تا کاملا گرد شود */
    border-radius: 50%;
    position: relative;
}
/* ۱. افزایش فاصله نوشته‌ها از لبه کادر (پدینگ افقی بیشتر) */
.user-profile, 
.header-date {
    padding: 0 20px !important; /* فاصله چپ و راست را بیشتر کردیم */
}

/* ۲. اصلاح فرم دایره‌ای عدد نوتیفیکیشن (بج) */
.header-actions .badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px; /* حداقل عرض برای جلوگیری از دفورمه شدن */
    height: 22px;
    padding: 0 5px; /* کمی پدینگ برای اعداد دورقمی */
    border-radius: 20px; /* گرد کردن اصولی لبه‌ها */
    box-sizing: border-box;
    line-height: 1; /* جلوگیری از کشیدگی عمودی متن */
}
