/* ==========================================================================
   طراحی مدرن، مینیمال و تکنولوژی‌محور برای سامانه ویزیتوری
   فونت‌ها: Vazirmatn (فارسی) + Inter (لاتین و اعداد)
   ========================================================================== */

:root {
    --font-fa: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* پالت رنگی اختصاصی خاکی، سیاه و سفید */
    --bg-main: #f5f4ef;          /* زمینه اصلی خاکی ملایم و گرم */
    --bg-card: #ffffff;          /* پس‌زمینه کارت‌ها سفید خالص */
    --bg-subtle: #eae6dc;        /* خاکی روشن برای باکس‌ها و هاور */
    
    --border-color: #ded8cb;     /* کادرهای ظریف خاکی خنثی */
    --border-focus: #141414;     /* فوکوس مشکی یکدست */
    
    --text-primary: #141414;     /* متن اصلی مشکی پرکنتراست */
    --text-secondary: #3f3b37;   /* متن ثانویه خاکستری گرم */
    --text-muted: #78716c;       /* متن فرعی خاکی مات */
    --text-inverse: #ffffff;
    
    --primary: #141414;          /* رنگ مشکی اصلی برای دکمه‌ها و المان‌های تاکیدی */
    --primary-hover: #262626;    /* هاور مشکی */
    --accent: #8c7d6b;           /* رنگ خاکی/برنز شیک برای خطوط و جزییات */
    --accent-hover: #736554;     /* خاکی تیره‌تر */
    
    /* نشانگرهای وضعیت خنثی و هماهنگ با تم خاکی و سیاه/سفید */
    --success-bg: #f2f5f1;
    --success-text: #1b381e;
    --success-border: #cbd8cb;
    
    --warning-bg: #fbf8ee;
    --warning-text: #594116;
    --warning-border: #e8dcb8;
    
    --danger-bg: #faf2f2;
    --danger-text: #6b1d1d;
    --danger-border: #e8caca;
    
    --info-bg: #eceae3;
    --info-text: #141414;
    --info-border: #ded8cb;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
}

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

html {
    font-size: 15px;
    direction: rtl;
    text-align: right;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-fa);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* اعداد و کلمات لاتین */
.en-text, .num {
    font-family: var(--font-en);
    direction: ltr;
    display: inline-block;
}

/* ساختار صفحه‌بندی */
.container {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.main-content {
    flex: 1 0 auto;
    padding-top: 32px;
    padding-bottom: 56px;
}

/* ==========================================================================
   هدر مدرن، استاندارد و کاملاً ریسپانسیو (Header & Navigation)
   ========================================================================== */

.site-header {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}

/* گروه برند و دکمه همبرگر */
.header-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.brand-area:hover {
    opacity: 0.95;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.brand-area:hover .brand-icon {
    transform: scale(1.04);
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #0f172a;
    line-height: 1.25;
}

.brand-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 6px;
    width: fit-content;
    line-height: 1.4;
}

.brand-tag.tag-admin {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.brand-tag.tag-visitor {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.brand-tag.tag-guest {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ناوبری دسکتاپ مدرن با طراحی تب‌های کپسولی */
.desktop-nav {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 9px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.18s ease-in-out;
    position: relative;
    white-space: nowrap;
}

.nav-link svg {
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.nav-link:hover {
    color: #0f172a;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav-link:hover svg {
    transform: translateY(-1px);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

.nav-link.active svg {
    stroke: #38bdf8;
}

.nav-alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    margin-right: 2px;
    animation: alertPulse 2s infinite ease-in-out;
}

.alert-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ffffff;
    display: inline-block;
}

@keyframes alertPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

/* بخش اکشن‌های هدر (سمت چپ) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* دکمه اکشن سریع ثبت گزارش */
.btn-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.btn-header-cta:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38);
}

/* دکمه اعلان هشدارهای پیگیری مدیر */
.header-alert-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    text-decoration: none;
    transition: all 0.18s ease;
}

.header-alert-btn:hover {
    background: #fde68a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.15);
}

.alert-pulse-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: alertPulse 2s infinite ease-in-out;
}

/* دراپ‌داون پروفایل کاربر */
.user-dropdown {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.user-profile-trigger:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.user-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.92rem;
    position: relative;
    flex-shrink: 0;
}

.avatar-admin {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #f8fafc;
    border: 2px solid #e2e8f0;
}

.avatar-visitor {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: 2px solid #e0f2fe;
}

.avatar-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    text-align: right;
}

.user-fullname {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 4px;
}

.badge-role-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-role-visitor {
    background: #e0f2fe;
    color: #0369a1;
}

.chevron-arrow {
    color: var(--text-muted);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.user-dropdown.open .chevron-arrow {
    transform: rotate(180deg);
}

/* منوی بازشوی دراپ‌داون پروفایل */
.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: 250px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.user-dropdown.open .user-dropdown-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.dropdown-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.dropdown-user-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-role-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    width: fit-content;
    margin-top: 2px;
}

.role-pill-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-pill-visitor {
    background: #e0f2fe;
    color: #0369a1;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 6px 0;
}

.dropdown-body {
    padding: 2px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}

.dropdown-item.item-logout {
    color: #dc2626;
}

.dropdown-item.item-logout:hover {
    background-color: #fef2f2;
    color: #b91c1c;
}

.dropdown-footer {
    padding-top: 2px;
}

/* ==========================================================================
   منوی کشویی مدرن موبایل (Mobile Off-canvas Drawer)
   ========================================================================== */

/* دکمه همبرگری موبایل */
.mobile-menu-trigger {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.mobile-menu-trigger:hover {
    background: var(--bg-subtle);
}

.hamburger-box {
    width: 18px;
    height: 14px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    position: absolute;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-inner {
    top: 6px;
}

.hamburger-inner::before {
    content: '';
    top: -6px;
}

.hamburger-inner::after {
    content: '';
    top: 6px;
}

/* پس‌زمینه محو تاریک دراور */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.mobile-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* پنل دراور کشویی */
@media (min-width: 992px) {
    .mobile-drawer,
    .mobile-drawer-backdrop {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 310px;
    max-width: 86vw;
    background: #ffffff;
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-drawer.open {
    transform: translateX(0);
}

body.drawer-locked {
    overflow: hidden;
}

/* سربرگ دراور */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-brand-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.drawer-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

/* کارت اطلاعات کاربر در دراور */
.drawer-user-card {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
}

.drawer-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    flex-shrink: 0;
}

.drawer-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.drawer-user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-user-phone {
    font-size: 0.78rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

.drawer-user-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 3px;
    width: fit-content;
}

/* دکمه اقدام یا هشدار در دراور */
.drawer-cta-wrap {
    padding: 12px 16px 4px 16px;
}

.drawer-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: #141414;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.drawer-alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    text-decoration: none;
    color: #92400e;
}

.drawer-alert-icon {
    font-size: 1.3rem;
}

.drawer-alert-text {
    display: flex;
    flex-direction: column;
}

.drawer-alert-text strong {
    font-size: 0.84rem;
}

.drawer-alert-text small {
    font-size: 0.72rem;
    color: #b45309;
}

/* لیست منوی دراور */
.drawer-nav {
    flex: 1;
    padding: 12px 14px;
}

.drawer-nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 8px 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drawer-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.drawer-nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.drawer-nav-item.active {
    background: #141414;
    color: #ffffff;
    font-weight: 600;
}

.drawer-nav-item.active .nav-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.drawer-nav-item.active svg {
    stroke: #ffffff;
}

.nav-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    color: var(--text-primary);
    flex-shrink: 0;
}

.drawer-badge-alert {
    margin-right: auto;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.drawer-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    background: #fafaf9;
    margin-top: auto;
}

.drawer-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.drawer-logout-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* کارت‌ها و بلوک‌های محتوا */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* تایپوگرافی */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }

p {
    margin-bottom: 12px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* دکمه‌ها */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-accent {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline {
    background-color: #ffffff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

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

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
}

/* فرم‌ها و فیلدهای ورودی */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* بج‌ها (Badges) */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-emerald { background-color: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-blue { background-color: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-amber { background-color: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-orange { background-color: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.badge-rose { background-color: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.badge-gray { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* جداول */
.table-responsive {
    overflow-x: auto;
    margin-top: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: right;
}

.table th {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* کارت‌های آماری منظم (Stat Grid) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: var(--font-en);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* هشدارهای فلش (Alerts) */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.alert-info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }

/* صفحه احراز هویت (Login / Register) */
.auth-wrapper {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.45rem;
    margin-bottom: 6px;
}

/* فوتر */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* فیلترها */
.filter-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

/* ==========================================================================
   ریسپانسیو حرفه‌ای، بهینه‌سازی اختصاصی موبایل و حذف المان‌های اضافی
   ========================================================================== */

/* کلاس‌های عمومی کمکی جهت مخفی‌سازی و بهینه‌سازی */
.mobile-hide,
.d-mobile-none {
    /* پیش‌فرض در دسکتاپ نمایش داده می‌شود */
}

.desktop-hide,
.d-desktop-none {
    display: none !important;
}

/* نوار دسترسی سریع پایین صفحه مخصوص موبایل (Bottom Nav Bar) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
    z-index: 100;
    padding: 0 4px;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    gap: 3px;
    transition: all 0.15s ease;
    text-align: center;
    border-radius: 6px;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: transform 0.15s ease;
}

.mobile-nav-item:active svg {
    transform: scale(0.9);
}

.mobile-nav-item.active {
    color: var(--accent);
    font-weight: 700;
}

.mobile-nav-item.active svg {
    stroke: var(--accent);
}

/* دکمه‌های ناوبری موبایل */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

/* ==========================================================================
   قوانین اختصاصی واکنش‌گرایی (Responsive Breakpoints)
   ========================================================================== */

/* بهینه‌سازی دسکتاپ و لپ‌تاپ‌های متوسط (993px تا 1250px) */
@media (min-width: 993px) and (max-width: 1250px) {
    .nav-link {
        padding: 6px 9px;
        font-size: 0.82rem;
        gap: 5px;
    }
    .user-fullname {
        max-width: 85px;
    }
    .btn-header-cta {
        padding: 7px 12px;
        font-size: 0.82rem;
    }
    .header-inner {
        gap: 10px;
    }
}

/* تبلت‌ها و صفحات متوسط (عرض کمتر از 992 پیکسل) */
@media (max-width: 992px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-menu-trigger {
        display: flex !important;
    }

    .user-profile-trigger .user-info-text,
    .user-profile-trigger .chevron-arrow {
        display: none !important;
    }

    .user-profile-trigger {
        padding: 2px !important;
        border: none !important;
        background: transparent !important;
    }

    .brand-title {
        font-size: 1rem;
    }
}

/* قوانین اختصاصی موبایل و تبلت‌های کوچک (عرض کمتر از 768 پیکسل) */
@media (max-width: 768px) {
    html {
        font-size: 13.5px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* اعمال مخفی‌سازی المان‌های اضافی */
    .mobile-hide,
    .d-mobile-none,
    th.col-hide-mobile,
    td.col-hide-mobile {
        display: none !important;
    }

    .desktop-hide,
    .d-desktop-none {
        display: block !important;
    }

    /* فعال شدن نوار ناوبری پایین صفحه */
    .mobile-bottom-nav {
        display: flex;
    }

    /* ایجاد فاصله برای جلوگیری از پوشیده شدن محتوا توسط نوار پایینی */
    .main-content {
        padding-top: 14px;
        padding-bottom: 78px;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* بهینه‌سازی استاندارد هدر در موبایل */
    .site-header {
        height: 60px;
    }

    .header-inner {
        height: 60px;
        gap: 8px;
    }

    .header-brand-group {
        gap: 8px;
    }

    .brand-area {
        gap: 8px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
    }

    .brand-icon svg {
        width: 18px;
        height: 18px;
    }

    .brand-title {
        font-size: 0.94rem;
        letter-spacing: -0.2px;
    }

    .brand-tag {
        display: none !important;
    }

    .header-actions {
        gap: 8px;
    }

    .btn-header-cta {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .btn-header-cta .cta-text {
        display: none;
    }

    .header-alert-btn {
        width: 34px;
        height: 34px;
    }

    .header-alert-btn svg {
        width: 17px;
        height: 17px;
    }

    .user-avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 0.86rem;
    }

    .user-dropdown-menu {
        right: auto;
        left: -8px;
        width: 235px;
    }

    /* تایپوگرافی جمع‌وجور و بهینه‌سازی اختصاصی موبایل */
    html {
        font-size: 13.5px;
    }

    h1 {
        font-size: 1.18rem !important;
        margin-bottom: 3px !important;
        font-weight: 700 !important;
    }

    h2, .card-title {
        font-size: 0.98rem !important;
        font-weight: 700 !important;
    }

    h3 {
        font-size: 0.88rem !important;
    }

    p {
        margin-bottom: 6px;
        font-size: 0.82rem;
        line-height: 1.5;
    }

    /* کارت‌ها */
    .card {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .card-header {
        margin-bottom: 10px;
        padding-bottom: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* کارت‌های آماری متراکم ۲ ستونه برای موبایل */
    .stat-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .stat-box,
    .stat-card {
        padding: 8px 10px !important;
        gap: 8px !important;
        border-radius: 6px !important;
    }

    .stat-box .stat-icon {
        width: 30px !important;
        height: 30px !important;
    }

    .stat-box .stat-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .stat-value,
    .stat-box .stat-value,
    .stat-card .stat-value {
        font-size: 1.2rem !important;
        font-weight: 700;
    }

    .stat-label,
    .stat-box .stat-label,
    .stat-card .stat-label {
        font-size: 0.72rem !important;
        line-height: 1.25;
    }

    .stat-card .stat-desc {
        display: none !important; /* حذف توضیحات اضافی در حالت موبایل */
    }

    /* جداول بهینه و متراکم در موبایل */
    .table-responsive {
        margin-top: 2px;
        border-radius: 6px;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }

    .table {
        font-size: 0.78rem;
    }

    .table th {
        padding: 6px 8px !important;
        font-size: 0.74rem !important;
        white-space: nowrap;
        background: #f8fafc;
    }

    .table td {
        padding: 8px 8px !important;
        font-size: 0.78rem !important;
    }

    /* دکمه‌های داخل جدول */
    .table td .btn-sm,
    .table td .btn {
        padding: 2.5px 6px !important;
        font-size: 0.72rem !important;
        border-radius: 4px !important;
        line-height: 1.3 !important;
    }

    /* نوارهای فیلتر متراکم */
    .filter-bar {
        padding: 10px !important;
        margin-bottom: 12px !important;
        border-radius: 8px !important;
    }

    .filter-bar form {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .filter-bar form > div:first-child {
        grid-column: 1 / -1;
    }

    .filter-bar form > div:last-child {
        grid-column: 1 / -1;
        margin-top: 4px;
    }

    /* فیلدها و ورودی‌ها در موبایل */
    .form-control,
    .form-select {
        padding: 6px 9px !important;
        font-size: 0.84rem !important;
        min-height: 38px !important;
        border-radius: 6px !important;
    }

    .form-label {
        font-size: 0.76rem !important;
        margin-bottom: 2px !important;
        font-weight: 600;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .form-hint {
        font-size: 0.7rem !important;
        line-height: 1.35;
    }

    /* بج‌ها */
    .badge {
        padding: 2px 5px !important;
        font-size: 0.7rem !important;
        border-radius: 4px !important;
    }

    /* آلرت‌ها */
    .alert {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
        margin-bottom: 10px !important;
        gap: 6px !important;
        border-radius: 6px !important;
    }

    .alert svg {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0;
    }

    /* دکمه‌های عمومی در موبایل */
    .btn {
        padding: 7px 12px !important;
        font-size: 0.82rem !important;
        border-radius: 6px !important;
    }

    .btn-sm {
        padding: 3px 6px !important;
        font-size: 0.72rem !important;
        border-radius: 4px !important;
    }

    /* کارت‌های چک‌باکس مدیران و پروژه‌ها در موبایل */
    .admin-checkbox-card,
    .project-checkbox-card {
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    /* فوتر در موبایل */
    .site-footer {
        padding: 10px 0;
        margin-bottom: 40px; /* جلوگیری از تداخل با نوار پایینی */
        font-size: 0.74rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

/* بهینه‌سازی تکمیلی برای موبایل‌های باریک‌تر (عرض کمتر از 480 پیکسل) */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .container {
        padding-right: 10px !important;
        padding-left: 10px !important;
    }

    th.col-hide-sm,
    td.col-hide-sm {
        display: none !important;
    }

    .stat-grid,
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .stat-box,
    .stat-card {
        padding: 6px 8px !important;
        border-radius: 6px !important;
    }

    .stat-box .stat-icon {
        display: none !important; /* در صفحات بسیار باریک آیکون مخفی تا محتوا تمیز بنشیند */
    }

    .stat-value,
    .stat-card .stat-value {
        font-size: 1.15rem !important;
    }

    .stat-label,
    .stat-card .stat-label {
        font-size: 0.68rem !important;
    }

    .brand-title {
        font-size: 0.84rem !important;
    }

    .filter-bar form {
        grid-template-columns: 1fr !important;
    }

    .card {
        padding: 10px !important;
        border-radius: 6px !important;
    }

    .table th,
    .table td {
        padding: 6px 5px !important;
        font-size: 0.74rem !important;
    }
}
