/* ========================================
   سیستم طراحی یکپارچه - custom.css
   نسخه ۲.۰ - تمام استایل‌های مشترک
======================================== */

/* ========================================
   1. متغیرها
======================================== */
:root {
    /* رنگ‌های اصلی */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #8B5CF6;
    --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);

    --secondary: #64748b;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #06b6d4;

    /* خاکستری‌ها */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* سایه‌ها */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* گردی */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-lg: 16px;

    /* ═══════════════════════════════════════════════════
       توکن‌های معنایی تم (زیرساختِ تم روشن/تاریک)
       ───────────────────────────────────────────────────
       هر صفحه که به تم تاریک مهاجرت می‌کند، باید رنگ‌های
       هاردکدشده‌اش را با این توکن‌ها جایگزین کند، نه با
       مقادیرِ مستقیم. مقادیرِ تاریک در پایینِ همین فایل،
       زیرِ ‎:root[data-theme="dark"]‎ تعریف شده‌اند.
       ═══════════════════════════════════════════════════ */
    --surface: #ffffff;
    --bg-page: var(--gray-50);
    --text-strong: var(--gray-900);
    --text-muted: var(--gray-500);
    --border-soft: var(--gray-200);
    --icon-accent: #744CA4;
    --brand-gradient: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    --info-box-bg: #f0f0f0;
    --warning-box-bg: #fff3cd;
    --warning-box-text: #856404;
    --toast-success-bg: #f0fdf4;
    --toast-error-bg: #fef2f2;
    --toast-warning-bg: #fffbeb;
    --toast-info-bg: #fff5f5ff;
}

/* ═══════════════════════════════════════════════════
   تم تاریک — فقط مقادیرِ توکن‌های بالا override می‌شوند.
   با کلیکِ دکمهٔ تعویضِ تم در هدر، ‎data-theme="dark"‎ روی
   <html> ست می‌شود (assets/js در pages/header.php).
   ═══════════════════════════════════════════════════ */
:root[data-theme="dark"] {
    /* به مرورگر می‌گوید عناصر بومی (اسکرول‌بار، فرم‌کنترل‌های سیستمی و...) را با تمِ تاریک رندر کند؛
       این یک خط، اسکرول‌بارهای پیش‌فرض/بدون استایل‌شخصیِ کل اپ را پوشش می‌دهد */
    color-scheme: dark;
    --surface: #1b2130;
    --bg-page: #12151f;
    --text-strong: #e8eaed;
    --text-muted: #9aa4b5;
    --border-soft: #2b3242;
    --icon-accent: #cdb8ff;
    --brand-gradient: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    --info-box-bg: #232a3a;
    --warning-box-bg: rgba(255, 193, 7, 0.15);
    --warning-box-text: #ffb74d;
    --toast-success-bg: rgba(16, 185, 129, 0.14);
    --toast-error-bg: rgba(239, 68, 68, 0.14);
    --toast-warning-bg: rgba(245, 158, 11, 0.14);
    --toast-info-bg: rgba(59, 130, 246, 0.14);
}

/* ========================================
   2. تایپوگرافی و پایه
======================================== */
* {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

body {
    background-color: var(--bg-page);
    color: var(--text-strong);
    line-height: 1.6;
    font-size: 14px;
    margin-top: 3.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-strong);
}

/* ========================================
   3. ناوبری (Navbar)
======================================== */
.navbar {
    background: var(--surface) !important;
    box-shadow: 0 4px 20px rgba(135, 92, 242, 0.08);
    border-bottom: 1px solid rgba(135, 92, 242, 0.1);
    padding: 0.4rem 0 !important;
}

:root[data-theme="dark"] .navbar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
    border-bottom: 1px solid var(--border-soft);
}

/* متن و آیکنِ لینک‌های هدر در تم تاریک — روشن‌تر از --text-muted عمومی،
   چون آن توکن هنوز در صفحات مهاجرت‌نشده (مثل ticket.css) با پس‌زمینهٔ روشن استفاده می‌شود */
:root[data-theme="dark"] .navbar .nav-link {
    color: #c9d1de !important;
}

:root[data-theme="dark"] .navbar .nav-link:hover,
:root[data-theme="dark"] .navbar .nav-link.active {
    color: var(--icon-accent) !important;
}

/* دراورِ موبایل: dashboard-responsive.css یک رنگ ثابت (#334155) با !important
   روی #mainNav .nav-link ست کرده که تم را نادیده می‌گیرد؛ اینجا با همان
   وزنِ اهمیت ولی specificity بالاتر override می‌شود */
:root[data-theme="dark"] #mainNav .nav-link {
    color: #c9d1de !important;
}

.theme-toggle-btn {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

#mainNav .dropdown-menu {
    position: absolute !important;
    z-index: 9999 !important;
}

.navbar .dropdown-menu {
    z-index: 1050 !important;
}

.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--gray-300);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: none;
}

/* ========================================
   4. کارت‌ها
======================================== */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    background: white;
    margin-bottom: 1.5rem;
}

:root[data-theme="dark"] .card {
    background: var(--surface);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--primary-gradient);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 1rem;
    font-weight: 500;
}

.card-header h5 {
    color: white;
    font-weight: 500;
    font-size: 16px;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   5. دکمه‌ها
======================================== */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: white;
}

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

:root[data-theme="dark"] .btn-outline-primary {
    background: transparent;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* ========================================
   6. فرم‌ها
======================================== */
.form-control,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

[dir="rtl"] .form-select {
    padding-left: 2.5rem !important;
    padding-right: 0.75rem !important;
    background-position: left 0.75rem center !important;
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.form-section h4 {
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.form-section h4 i {
    color: #667eea;
}

:root[data-theme="dark"] .form-section {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .form-section h4 {
    color: var(--text-strong);
}

@media (max-width: 768px) {
    .form-section {
        padding: 16px;
    }
}

/* ========================================
   7. Badge ها - پوشش کامل همه انواع
======================================== */

/* --- Badge پایه --- */
.badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    /* بود: 500 — متن پررنگ‌تر */
    border-radius: 6px;
    /* مستطیلی با گوشهٔ ملایم */
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.badge i {
    font-size: 0.6rem;
}

/* --- Bootstrap badge رنگ‌ها --- */
.badge.bg-primary {
    background: var(--primary) !important;
}

.badge.bg-success {
    background: var(--success) !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: white !important;
}

.badge.bg-danger {
    background: var(--danger) !important;
}

.badge.bg-info {
    background: var(--info) !important;
}

.badge.bg-secondary {
    background: var(--gray-500) !important;
}

.badge.bg-light {
    background: var(--gray-100) !important;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* --- Badge بخش‌ها (section) - گزارش تیم --- */
.badge-section {
    display: inline-block;
}

.badge.sales {
    background: #dbeafe;
    color: #1e40af;
}

.badge.technical {
    background: #fef3c7;
    color: #92400e;
}

.badge.warehouse {
    background: #d1fae5;
    color: #065f46;
}

.badge.accounting {
    background: #fce7f3;
    color: #831843;
}

.badge.management {
    background: #e0e7ff;
    color: #3730a3;
}

.badge.purchase {
    background: #ffedd5;
    color: #9a3412;
}

.badge.public {
    background: #f3f4f6;
    color: #374151;
}

/* بج‌های خنثیِ خاکستری/سفید — روی پس‌زمینهٔ تیره باید تیره بشن، نه سفید بمونن.
   بج‌های رنگی (آبی/سبز/قرمز/بنفش/فیروزه‌ای) خودشون کنتراستِ کافی دارن و دست نمی‌خورن */
:root[data-theme="dark"] .badge.public {
    background: #2b3242;
    color: #c7cfdd;
}

.status-period_done {
    background: #cffafe;
    color: #0e7490;
}

.status-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.status-not_started {
    background: #f1f3f5;
    /* بود: #f3f4f6 */
    color: #495057;
    /* بود: #6b7280 — تیره‌تر */
}

:root[data-theme="dark"] .status-not_started {
    background: #2b3242;
    color: #c7cfdd;
}

.status-in_progress {
    background: #e7f0ff;
    /* بود: #dbeafe */
    color: #1554d1;
    /* بود: #1d4ed8 — شارپ‌تر */
}

.status-completed {
    background: #e3faf0;
    /* بود: #d1fae5 */
    color: #037a52;
    /* بود: #047857 */
}

.status-pending_approval {
    background: #fff4d6;
    /* بود: #fef3c7 */
    color: #a16207;
    /* بود: #b45309 */
}

.status-approved {
    background: #dcf5e3;
    /* بود: #d4edda */
    color: #0f7a2e;
    /* بود: #155724 */
}

.status-delegated {
    background: #e8eaff;
    /* بود: #e0e7ff */
    color: #3730d4;
    /* بود: #4338ca */
}

.status-stopped {
    background: #f1f3f5;
    color: #495057;
}

:root[data-theme="dark"] .status-stopped {
    background: #2b3242;
    color: #c7cfdd;
}

.status-rejected {
    background: #ffe3e6;
    /* بود: #f8d7da */
    color: #c81e1e;
    /* بود: #721c24 — قرمز شارپ */
}

.status-termination_requested {
    background: #e0fff2;
    /* بود: #edfff5 */
    color: #158463;
    /* بود: #299e7d */
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.priority-high {
    background: #ffe3e3;
    /* بود: #fee2e2 */
    color: #cc1f1f;
    /* بود: #dc2626 */
}

.priority-medium {
    background: #fff0d0;
    /* بود: #fef3c7 */
    color: #c26a06;
    /* بود: #d97706 */
}

.priority-low {
    background: #dcf7e6;
    /* بود: #d1fae5 */
    color: #04794a;
    /* بود: #059669 */
}

.type-periodic {
    background: #e6e9ff;
    /* بود: #e0e7ff */
    color: #3f38d6;
    /* بود: #4f46e5 */
}

.type-continuous {
    background: #ffe6f2;
    /* بود: #fce7f3 */
    color: #c91f74;
    /* بود: #db2777 */
}

/* --- Badge روزها (مهلت) --- */
.days-badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
}

.days-overdue {
    background: #ffe8e8;
    /* بود: #fef2f2 */
    color: #d61f1f;
    /* بود: #dc2626 — قرمز شارپ‌تر */
    font-weight: 600;
    /* پررنگ‌تر */
}

.days-today {
    background: #fff3d6;
    /* بود: #fffbeb */
    color: #c2740a;
    /* بود: #d97706 */
    font-weight: 600;
}

.days-soon {
    background: #fff0cc;
    /* بود: #fef3c7 */
    color: #a5620a;
    /* بود: #b45309 */
    font-weight: 600;
}

.days-normal {
    background: #e6faec;
    /* بود: #f0fdf4 */
    color: #12772c;
    /* بود: #15803d */
    font-weight: 600;
}

s-normal {
    background: #f0fdf4;
    color: #15803d;
}

/* --- Status Badge (درخواست‌ها) --- */
.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

.status-badge-large {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.status-badge.status-with-timeline {
    position: relative;
}

/* --- Request Badge (نوع درخواست) --- */
.request-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
}

.request-badge i {
    font-size: 10px;
}

.request-badge.pass {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.request-badge.mission {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
}

.request-badge.leave {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.request-badge.forget {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

.request-badge.technical {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
}

/* --- Pending Badge --- */
.pending-badge {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

/* --- Role Badge (نقش‌ها) --- */
.role-badge {
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
}

.role-badge.substitute {
    background: #FEF3C7;
    color: #D97706;
}

.role-badge.manager {
    background: #DBEAFE;
    color: #2563EB;
}

.role-badge.supervisor {
    background: #F3E8FF;
    color: #7C3AED;
}

.role-badge.admin {
    background: #FCE7F3;
    color: #DB2777;
}

/* --- Shift Badge (شیفت) --- */
.shift-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-shift1 {
    background: #3B82F6;
    color: white;
}

.badge-shift2 {
    background: #7C3AED;
    color: white;
}

/* --- Unit Badge (واحد فعالیت) --- */
.unit-badge {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.unit-RS {
    background-color: #3B82F6;
    color: white;
}

.unit-ATM {
    background-color: #10b981;
    color: white;
}

.unit-AM {
    background-color: #f59e0b;
    color: #212529;
}

.unit-AC {
    background-color: #dc3545;
    color: white;
}

.unit-HE {
    background-color: #fd7e14;
    color: white;
}

.unit-PR {
    background-color: #7C3AED;
    color: white;
}

/* --- Step Badge (مراحل روتین) --- */
.step-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 2px;
}

/* --- Time Badge (حضور و غیاب) --- */
.time-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.time-badge.in {
    background: #d1fae5;
    color: #065f46;
}

.time-badge.out {
    background: #fee2e2;
    color: #991b1b;
}

.time-badge.absent {
    background: #fef3c7;
    color: #92400e;
}

.time-badge.holiday {
    background: #f3f4f6;
    color: #6b7280;
}

.step-info {
    flex-grow: 1;
}

.step-info strong {
    color: #1a1a1a;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.step-unit {
    display: inline-block;
    background: #e8eaed;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    color: #5f6368;
    font-weight: 500;
}

.step-time {
    color: #5f6368;
    font-size: 13px;
}

.step-time i {
    opacity: 0.7;
}

/* استایل سوئیچ */
.form-check-input {
    width: 3rem !important;
    height: 1.5rem;
    margin-left: 0.5rem;
    border: 2px solid #e8eaed;
    background-color: #f1f3f4;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.form-check-label {
    font-weight: 500;
    color: #1a1a1a;
    user-select: none;
    cursor: pointer;
    font-size: 14px;
    margin: 5px auto auto 5px;
}



/* ========================================
   8. Alert ها
======================================== */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.custom-alert {
    position: fixed;
    top: 90px;
    left: 20px;
    z-index: 9999;
    min-width: 280px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

/* استایل‌های workflow */
.workflow-preview {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.workflow-preview h6 {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 16px;
}

.workflow-preview h6 i {
    color: #667eea;
}

.step-preview-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #fafbfc;
    border-radius: 8px;
    border-right: 3px solid #667eea;
    transition: all 0.2s ease;
}

.step-preview-item:hover {
    background: #f1f3f4;
}

.step-preview-item i.bi-arrow-left {
    color: #dadce0;
    font-size: 18px;
    margin-right: 8px;
}

:root[data-theme="dark"] .workflow-preview {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .workflow-preview h6 {
    color: var(--text-strong);
}

:root[data-theme="dark"] .step-preview-item {
    background: var(--bg-page);
}

:root[data-theme="dark"] .step-preview-item:hover {
    background: var(--border-soft);
}

:root[data-theme="dark"] .step-preview-item i.bi-arrow-left {
    color: var(--text-muted);
}

.step-number {
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* ========================================
   9. کانتینر و لایه‌بندی اصلی
======================================== */
.overview-container {
    max-width: 70% !important;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.overview-container h1 {
    font-size: 18px;
}

.main-content {
    padding: 20px;
    max-width: 70%;
    margin: 0 auto;
}

/* ========================================
   10. فیلترها
======================================== */
.filters-wrapper {
    background: white;
    border-radius: 10px;
    padding: 1rem 1rem .8rem 1rem;
    margin-bottom: 0;
    margin-top: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

:root[data-theme="dark"] .filters-wrapper {
    background: var(--surface);
    border-color: var(--border-soft);
}

/* --- لایه‌بندی ۲ ستونی فیلتر (عنوان + کنترل‌ها) --- */
.filters-wrapper.two-col {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.filters-title-col {
    flex-shrink: 0;
    border-left: 1px solid #e5e7eb;
    padding-left: 1.5rem;
}

.filters-title-col h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    white-space: nowrap;
}

.filters-title-col p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.15rem 0 0 0;
}

:root[data-theme="dark"] .filters-title-col {
    border-left-color: var(--border-soft);
}

:root[data-theme="dark"] .filters-title-col h1 {
    color: var(--text-strong);
}

:root[data-theme="dark"] .filters-title-col p {
    color: var(--text-muted);
}

.filters-controls-col {
    flex: 1;
}

/* --- فیلتر با search-box (صفحات task) --- */
.search-box {
    position: relative;
    margin-bottom: .6rem;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all 0.2s;
    background: #fafbfc;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

:root[data-theme="dark"] .search-box input {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .search-box input:focus {
    background: var(--surface);
    border-color: var(--icon-accent);
    box-shadow: 0 0 0 3px rgba(205, 184, 255, 0.15);
}

.search-box i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.95rem;
}

/* --- فیلتر با search-wrapper (صفحات گزارش) --- */
.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
}

/* --- ردیف فیلترها (grid) --- */
.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    align-items: center;
}

/* حالت flex برای فیلترهای گزارش */
.filters-row.flex {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* --- filter-group (لیبل + اینپوت) --- */
.filter-group {
    flex: 1;
    min-width: 120px;
}

.filter-group.search-group {
    flex: 2;
}

.filter-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    display: block;
}

/* --- filter-select و filter-input (استایل مستقیم select/input) --- */
.filter-select,
.filter-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    background: white;
    transition: all 0.2s;
}

.filter-input {
    padding-right: 2rem;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

:root[data-theme="dark"] .filter-select,
:root[data-theme="dark"] .filter-input {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

/* --- filter-item (select با آیکون ▼) --- */
.filter-item {
    position: relative;
}

.filter-item select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
}

:root[data-theme="dark"] .filter-item select {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

.filter-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.filter-item::after {
    content: '▼';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    font-size: 0.6rem;
}

.filter-item.no-arrow::after {
    display: none;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    padding: 0.5rem 0.75rem;
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-xs);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item label {
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

:root[data-theme="dark"] .checkbox-item {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .checkbox-item label {
    color: var(--text-strong);
}

.filter-btn {
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

:root[data-theme="dark"] .filter-btn {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

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

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-delete {
    padding: 0.3rem 0.5rem;
    background: none;
    color: var(--gray-300);
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;

}

.btn-delete:hover {

    color: #dc2626;
}

.btn-delete i {
    font-size: 1rem;
}

/* Per-page buttons */
.per-page-buttons {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    padding: 3px;
    border-radius: var(--radius-xs);
}

.per-page-btn {
    flex: 1;
    padding: 0.5rem 0.4rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.per-page-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.per-page-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .per-page-btn {
    color: var(--text-muted);
}

:root[data-theme="dark"] .per-page-btn:hover {
    background: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .per-page-btn.active {
    background: var(--surface);
    color: var(--icon-accent);
}

/* ========================================
   11. Stats Cards (عمومی)
======================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border: 1px solid #f0f0f0;
    display: grid;
    align-items: center;
    /* gap: 0.75rem; */
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    height: stretch;
}

/* برخی صفحات (مثل attendance_system/pages/requests.php) هم custom.css را مستقیم لینک می‌کنند
   و هم header.php را include می‌کنند که خودش دوباره custom.css را لود می‌کند؛ چون این include
   بعد از <style> محلیِ آن صفحه می‌آید، لود دوم customcss (همین‌جا) با هم-تخصیصی روی override
   محلیِ صفحه می‌برد. برای همین این override باید همین‌جا و با specificity بالاتر باشد */
:root[data-theme="dark"] .stat-card {
    background: var(--surface);
    border-color: var(--border-soft);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.stat-icon.total,
.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-icon.done,
.stat-icon.green {
    background: #d1fae5;
    color: #059669;
}

.stat-icon.pending,
.stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.overdue,
.stat-icon.red {
    background: #fee2e2;
    color: #dc2626;
}

.stat-icon.today,
.stat-icon.yellow {
    background: #fef3c7;
    color: #d97706;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #f97316;
}

.stat-icon.pink {
    background: #fce7f3;
    color: #ec4899;
}

.stat-icon.progress {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.not-started {
    background: #f3f4f6;
    color: #6b7280;
}

.stat-icon.delegated {
    background: #e0e7ff;
    color: #4338ca;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-50);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #ffffff;
    margin: 4px 0 0 0;
    font-weight: 400;
}

.stat-card i {
    color: white !important;
    opacity: 100% !important;
}

/* ========================================
   AG Grid — تم تاریک (مشترک بین همهٔ صفحاتی که ag-Grid دارند:
   tasks.php، payroll-report.php، superAdmin.php و ...).
   چه از تم کلاسیکِ CSS (.ag-theme-alpine) استفاده شده باشد چه از
   Theming API جدید (agGrid.themeQuartz.withParams در JS)، هر دو
   همین متغیرهای CSS استاندارد را می‌خوانند و از این‌جا override می‌شوند. */
:root[data-theme="dark"] .ag-theme-alpine,
:root[data-theme="dark"] .ag-theme-quartz {
    --ag-background-color: var(--surface);
    --ag-foreground-color: var(--text-strong);
    --ag-header-background-color: #232a3a;
    --ag-header-foreground-color: var(--text-strong);
    --ag-border-color: var(--border-soft);
    --ag-row-border-color: var(--border-soft);
    --ag-row-hover-color: rgba(205, 184, 255, 0.08);
    --ag-odd-row-background-color: var(--surface);
    --ag-secondary-foreground-color: var(--text-muted);
    --ag-data-color: var(--text-strong);
    --ag-input-background-color: var(--surface);
    --ag-input-border-color: var(--border-soft);
    --ag-disabled-foreground-color: var(--text-muted);
    --ag-modal-overlay-background-color: rgba(0, 0, 0, .6);
}

/* اسکرول‌بارِ داخلیِ AG-Grid — این یک ویجتِ اختصاصیِ خودِ AG-Grid است (نه اسکرول‌بارِ
   بومیِ مرورگر)، پس color-scheme:dark روش اثر نمی‌گذارد و باید مستقیم override شود */
:root[data-theme="dark"] .ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-vertical-scroll-viewport::-webkit-scrollbar,
:root[data-theme="dark"] .ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-horizontal-scroll-viewport::-webkit-scrollbar {
    background: var(--info-box-bg);
}

:root[data-theme="dark"] .ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 10px;
}

:root[data-theme="dark"] .ag-theme-alpine .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-vertical-scroll-viewport::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .ag-theme-alpine .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .ag-theme-quartz .ag-body-horizontal-scroll-viewport::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   12. جداول - استایل مشترک
======================================== */
.table-wrapper,
.table-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    margin-top: 1rem;
    height: 39rem !important;
}

.table-scroll {
    overflow-x: auto;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    height: 36rem !important;
}

.table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* هدر جدول - گرادیانت اصلی */
.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--primary-gradient);
    color: white;
}

.table thead th {
    padding: 0.75rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    position: relative;
    text-align: center;
}

.table thead th:last-child {
    border-left: none;
}

.table thead th:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sort indicators */
.table thead th.sortable::after {
    content: '⇅';
    margin-right: 0.3rem;
    font-size: 0.7rem;
    opacity: 0.5;
}

.table thead th.sorted-asc::after,
.table thead th.sorted::after {
    content: '▲';
    opacity: 0;
}

.table thead th.sorted-desc::after {
    content: '▼';
    opacity: 1;
}

.table thead th .sort-icon {
    margin-right: 0.25rem;
    font-size: 0.6rem;
    opacity: 0.5;
}

.table thead th.sorted .sort-icon {
    opacity: 1;
}

/* بدنه جدول */
.table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.15s;
    cursor: pointer;
}

.table tbody tr:hover {
    background: #f0f1f3;
}

.table tbody tr:active {
    background: #e5e7eb;
}

.table tbody td {
    padding: 0.4rem;
    font-size: 0.78rem;
    color: #1f2937;
    vertical-align: middle;
    border: none;
    text-align: center;
}

.task-id {
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 500;
}

.task-title {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 300px !important;
    min-width: 150px !important;
    display: block !important;
    line-height: 1.5 !important;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 2px;
    font-size: 13px;
    text-align: right !important;
}

.taskDetail-title {
    font-weight: 600;
    color: white;
    font-size: 20px;
}

.taskDetail-meta {
    display: flex;
    margin: 1rem 0 0 0;
}

.task-meta-item {
    margin: 0 0 0 1rem;
}

/* تنظیم سلول عنوان */
td:nth-child(2) {
    max-width: 300px !important;
    min-width: 150px !important;
    white-space: normal !important;
}

.task-detail-container {
    max-width: 900px;
    margin: 5rem auto 5rem auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(116, 76, 164, 0.1);
    overflow: hidden;
}

:root[data-theme="dark"] .task-detail-container {
    background: var(--surface);
}

/* متنِ دلیلِ درخواستِ اتمام — از یوتیلیتیِ bg-light بوت‌استرپ استفاده می‌کند
   که با تمِ اپ هماهنگ نیست؛ چون !important دارد، اینجا هم !important لازم است */
:root[data-theme="dark"] #terminationReasonDisplay.bg-light {
    background-color: #232a3a !important;
    color: var(--text-strong) !important;
    border-color: var(--border-soft) !important;
}

/* بهبود task-item برای جلوگیری از افزایش عرض و بهم ریختن */
.task-item {
    background: white;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #e8eaed;
    border-right: 3px solid #e8eaed;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    /* نگه می‌داریم برای absolute دکمه */
    overflow: hidden;
    /* اضافه: جلوگیری از بیرون زدن دکمه و افزایش عرض */
    box-sizing: border-box;
    /* اضافه: شامل border و padding در عرض */
    width: 100%;
    /* ثابت کردن عرض به 100% والد */

}

.task-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transform: none;
    /* حذف translateX برای جلوگیری از جابه‌جایی و بهم ریختن badge‌ها */
    /* اگر می‌خواید جابه‌جایی نگه دارید، به جای -3px از چیزی ملایم‌تر مثل -1px استفاده کنید */
}

:root[data-theme="dark"] .task-item {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .task-title {
    color: var(--text-strong);
}

.info-section {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.03) 0%, rgba(101, 122, 231, 0.03) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(116, 76, 164, 0.12);
    transition: all 0.3s ease;
}

.info-section:hover {
    box-shadow: 0 4px 16px rgba(116, 76, 164, 0.1);
    border-color: rgba(116, 76, 164, 0.2);
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.05) 0%, rgba(101, 122, 231, 0.05) 100%);
}

.info-section h5 {
    color: #744ca4;
    margin-bottom: 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(116, 76, 164, 0.08);
    gap: 1rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
}

.info-value {
    color: #212529;
    font-weight: 500;
}

.info-section h5 i {
    color: #744ca4;
}

.task-today {
    border-right-color: #1a73e8 !important;
    background: rgba(26, 115, 232, 0.03);
}

.task-overdue {
    border-right-color: #ea4335 !important;
    background: rgba(255, 95, 2, 0.02);
}

.task-completed {
    border-right-color: #34a853 !important;
    background: rgba(52, 168, 83, 0.03);
    opacity: 0.7;
}

.task-delegated {
    border-right-color: #9334e6 !important;
    background: rgba(147, 52, 230, 0.03);
}

.taskDetail-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem 2rem;
    position: relative;
}



:root[data-theme="dark"] .task-meta {
    color: var(--text-muted);
}

.task-meta {
    font-size: 13px;
    color: #5f6368;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.task-body {
    padding: 2rem;
}

.task-meta i {
    opacity: 0.7;
}

.table tbody tr:hover .task-title {
    color: var(--primary);
}

.task-badges {
    margin-top: 2px;
}

.task-assignee {
    margin-top: 2px;
    font-size: 11px;
}

.user-name {
    font-size: 0.76rem;
    color: #4b5563;
}

.date-display {
    font-size: 0.72rem;
    color: #6b7280;
}

.date-relative {
    font-size: 0.68rem;
    color: #9ca3af;
}

.employee-name {
    font-weight: 600;
    color: #1f2937;
}

.number {
    font-weight: 600;
    text-align: center;
}

.number.neutral {
    color: #6b7280;
}

.number.positive {
    color: var(--success);
}

.number.negative {
    color: var(--danger);
}

.money {
    font-weight: 700;
    text-align: center;
    direction: ltr;
}

.money.loss {
    color: var(--danger-dark);
}

/* ========================================
   13. Column Resize (تغییر اندازه ستون)
======================================== */
.table thead th .resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}

.table thead th .resize-handle:hover,
.table thead th .resize-handle.resizing {
    background: rgba(255, 255, 255, 0.4);
}

/* وقتی resize فعاله، table-layout: fixed بشه */
.table.resizable {
    table-layout: fixed;
}

.table.resizable thead th,
.table.resizable tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   14. Pagination
======================================== */
.pagination-wrapper {
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.72rem;
}

.pagination {
    margin: 0;
    gap: 2px;
}

.page-link {
    border: none;
    background: transparent;
    color: #6b7280;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    transition: all 0.15s;
}

.page-link:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    color: #d1d5db;
    cursor: not-allowed;
}

/* ========================================
   15. مودال
======================================== */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

.modal {
    position: fixed;
    z-index: 1050 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    direction: rtl;

}

.modal[style*="display: block"],
.modal.show {
    display: block !important;
    overflow-y: auto;
}

.modal-backdrop {
    z-index: 1040 !important;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

.modal[style*="display: none"] {
    display: none !important;
}

/* مودال سفارشی (overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay .modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    z-index: 1060;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: var(--radius-xs);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
}

:root[data-theme="dark"] .modal-header {
    background: var(--surface);
    border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .modal-footer {
    background: #161b27;
    border-top-color: var(--border-soft);
}

:root[data-theme="dark"] .modal-overlay .modal-content,
:root[data-theme="dark"] .modal-content {
    background-color: var(--surface);
}

:root[data-theme="dark"] .modal-title {
    color: var(--text-strong);
}

:root[data-theme="dark"] .modal-close {
    background: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .modal-close:hover {
    background: #3a4358;
}

/* دکمهٔ بستنِ استاندارد بوت‌استرپ (SVG با رنگِ ثابتِ مشکی) — با filter معکوس می‌شود
   تا بدون دست‌زدن به مارک‌آپِ هر مودال، در تم تاریک هم دیده شود */
:root[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
}

.modal .persian-datepicker-wrapper {
    position: relative;
    display: block;
}

.modal .persian-datepicker {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    min-width: 280px;
    z-index: 1070;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
}

.modal .datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal .datepicker-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #667eea;
    padding: 4px 8px;
}

.modal .datepicker-nav:hover {
    background: #f0f0f0;
    border-radius: 4px;
}

.modal .datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.modal .datepicker-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #667eea;
    padding: 4px 0;
}

.modal .datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin: 10px 0;
}

.modal .datepicker-day {
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.modal .datepicker-day:hover:not(.other-month) {
    background: #f0f0f0;
    border-color: #667eea;
}

.modal .datepicker-day.today {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.modal .datepicker-day.selected {
    background: #e8f0fe;
    border-color: #667eea;
}

.modal .datepicker-day.other-month {
    color: #ccc;
    cursor: default;
}

.modal .datepicker-today-btn {
    width: 100%;
    padding: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 12px;
    transition: background 0.2s;
}

.modal .datepicker-today-btn:hover {
    background: #5568d3;
}

.modal .persian-datepicker-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    background: white;
}

.modal .persian-datepicker-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* تقویمِ داخلِ مودال — تم تاریک (هماهنگ با data-theme، همان توکن‌های .persian-datepicker پایه) */
:root[data-theme="dark"] .modal .persian-datepicker-input {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .modal .persian-datepicker-input:focus {
    border-color: var(--icon-accent);
    box-shadow: 0 0 0 3px rgba(205, 184, 255, 0.15);
}

:root[data-theme="dark"] .modal .persian-datepicker {
    background: var(--surface);
    border-color: var(--border-soft);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .modal .datepicker-header {
    border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .modal .datepicker-nav {
    color: var(--icon-accent);
}

:root[data-theme="dark"] .modal .datepicker-nav:hover {
    background: rgba(205, 184, 255, 0.12);
}

:root[data-theme="dark"] .modal .datepicker-weekday {
    color: var(--icon-accent);
}

:root[data-theme="dark"] .modal .datepicker-day {
    color: var(--text-strong);
}

:root[data-theme="dark"] .modal .datepicker-day:hover:not(.other-month) {
    background: rgba(205, 184, 255, 0.12);
    border-color: var(--icon-accent);
}

:root[data-theme="dark"] .modal .datepicker-day.today {
    background: #5a67d8;
    color: #fff;
    border-color: #5a67d8;
}

:root[data-theme="dark"] .modal .datepicker-day.selected {
    background: rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

:root[data-theme="dark"] .modal .datepicker-day.other-month {
    color: #4c5567;
}

/* تقویمِ کتابخانهٔ CDN (persian-datepicker.min.css در dashboard.php/task-detail.php/reports.php)
   — کلاس‌بندیِ کاملاً متفاوتِ کتابخانهٔ babakhani؛ فایلِ vendor دست‌نخورده می‌ماند،
   این قواعد چون بعد از آن لود می‌شوند override می‌کنند */
:root[data-theme="dark"] .datepicker-plot-area {
    background-color: var(--surface) !important;
    border-color: var(--border-soft) !important;
}

:root[data-theme="dark"] .datepicker-plot-area * {
    color: var(--text-strong);
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item {
    background-color: var(--surface) !important;
    color: var(--text-strong);
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td.disabled span,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item-disable,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item-disable {
    background-color: #161b27 !important;
    color: #454d5e !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span.other-month {
    color: #4c5567 !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td.today span {
    background-color: var(--icon-accent) !important;
    color: #1b2130 !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td.selected span,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item.selected,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item.selected {
    background-color: #5a67d8 !important;
    color: #fff !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span:hover,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item:hover,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item:hover {
    background-color: rgba(205, 184, 255, 0.25) !important;
    color: var(--text-strong) !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-time-view {
    background: #161b27 !important;
    border-top-color: var(--border-soft) !important;
}

:root[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-next,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-switch,
:root[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-prev,
:root[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-submit,
:root[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-calendar,
:root[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-today {
    color: var(--text-strong) !important;
}

:root[data-theme="dark"] .datepicker-plot-area .month-grid-box .header-row-cell {
    color: var(--text-strong) !important;
}

.modal .form-label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #1a1a1a;
}

.modal textarea,
.modal input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.modal textarea:focus,
.modal input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   16. Attendance Table (جدول مودال حضور)
======================================== */
.attendance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.attendance-table thead {
    background: #f9fafb;
}

.attendance-table th {
    padding: 0.75rem;
    text-align: right;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.attendance-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.attendance-table tbody tr:hover {
    background: #f9fafb;
}

/* ========================================
   17. Action Buttons
======================================== */
.action-buttons {
    position: relative;

    display: contents;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
    border: none !important;
    box-shadow: 0 -4px 24px rgba(116, 76, 164, 0.15);
    z-index: 1000;
    justify-content: center;
    direction: rtl;
}

.action-buttons .btn {
    flex: 1;
    max-width: 150px;
    min-width: 100px;
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;

}

.action-icon-btn.approve-btn {
    color: var(--success);
}

.action-icon-btn.approve-btn:hover {
    background: #d1fae5;
}

.action-icon-btn.reject-btn {
    color: var(--danger);
}

.action-icon-btn.reject-btn:hover {
    background: #fee2e2;
}

.action-icon-btn.edit-btn {
    color: var(--primary);
}

.action-icon-btn.edit-btn:hover {
    background: #e0e7ff;
}

.action-icon-btn.delete-btn {
    color: var(--danger);
}

.action-icon-btn.delete-btn:hover {
    background: #fee2e2;
}


.btn-remind-overview {
    position: relative !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none !important;
    cursor: pointer;

    color: var(--gray-300);
    padding: 0;
    background: none !important;
}

.btn-remind-overview:hover {
    color: #f59e0b;
}


.btn-remind-overview i {
    font-size: 1rem;
}

@keyframes bell-shake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(12deg);
    }

    50% {
        transform: rotate(-12deg);
    }

    75% {
        transform: rotate(6deg);
    }
}

.btn-remind-overview:hover i {
    animation: bell-shake 0.5s ease;
}

/* ========================================
   18. FAB (دکمه شناور)
======================================== */
.quick-actions {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient) !important;
    border: none;
    margin-top: 9px;
    color: white;
    padding-top: 6px;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

/* ========================================
   19. Loading & Empty States
======================================== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

:root[data-theme="dark"] .loading-overlay {
    background: rgba(15, 18, 28, 0.85);
}

.spinner,
.spinner-border {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-border {
    width: 1.8rem;
    height: 1.8rem;
    border-width: 2px;
    color: var(--primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.recent-activities-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.recent-activities-scroll::-webkit-scrollbar {
    width: 6px;
}

.recent-activities-scroll::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 10px;
}

.recent-activities-scroll::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.recent-activities-scroll::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

:root[data-theme="dark"] .recent-activities-scroll::-webkit-scrollbar-track {
    background: var(--info-box-bg);
}

:root[data-theme="dark"] .recent-activities-scroll::-webkit-scrollbar-thumb {
    background: var(--border-soft);
}

:root[data-theme="dark"] .recent-activities-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 2.5rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 2.5rem;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    margin: 0;
}

/* ========================================
   20. Progress Bars
======================================== */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: var(--gray-200);
}

.progress-bar {
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ========================================
   21. انیمیشن‌ها
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   22. Utilities
======================================== */
.text-muted {
    color: var(--gray-600) !important;
}

.border-top {
    border-top: 1px solid var(--gray-200) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--gray-200) !important;
}

/* ========================================
   23. Responsive
======================================== */
@media (max-width: 1200px) {
    .filters-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .overview-container {
        padding: 1rem 0.5rem;
        max-width: 90% !important;
    }

    .main-content {
        padding: 1rem;
        max-width: 100% !important;
    }

    .filters-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-row.flex {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-scroll {
        max-height: calc(100vh - 400px);
    }

    .card-body {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .table {
        font-size: 0.7rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.4rem;
    }

    .modal-overlay .modal-content {
        width: 95%;
    }

    /* فیلتر ۲ ستونی → تک ستونی در موبایل */
    .filters-wrapper.two-col {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-title-col {
        border-left: none;
        padding-left: 0;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .filters-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

.settings-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.settings-btn:hover {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.08) 0%, rgba(101, 122, 231, 0.08) 100%);
    transform: translateY(-2px);
}


@keyframes ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-15deg);
    }

    20%,
    40% {
        transform: rotate(15deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

.notification-bell {
    position: relative;
    font-size: 1.3rem;
    color: var(--icon-accent);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(116, 76, 164, 0.2));
}

.notification-bell:hover {
    color: #657ae7;
    transform: scale(1.15) rotate(15deg);
    filter: drop-shadow(0 4px 8px rgba(116, 76, 164, 0.3));
}

.notification-bell.has-notification {
    animation: ring 2s ease-in-out infinite;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.7rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
    z-index: 999;
    pointer-events: none;
    transform: scale(1);
    animation: pulse-badge 2s ease-in-out infinite;
    border: 2px solid white;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
    }
}

.notification-badge.hidden {
    display: none !important;
}


.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}



.navbar-brand:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(116, 76, 164, 0.3));
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 400;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link i {
    font-size: 1.1rem;
    transition: all 0.3s ease;

}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #744ca4 0%, #657ae7 100%);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s ease;
    transform: translateX(50%);
}

.nav-link:hover,
.nav-link.active {
    color: #744ca4 !important;
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.08) 0%, rgba(101, 122, 231, 0.08) 100%);
    transform: translateY(-2px);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 60%;
}

.nav-link:hover i {
    transform: scale(1.1);
    color: #744ca4;
}

/* ======================================== 
           📋 Dropdown Menu
        ======================================== */
.dropdown-menu {
    text-align: right !important;
    border: none;
    box-shadow: 0 8px 32px rgba(116, 76, 164, 0.15);
}

/* dropdown استاندارد بوت‌استرپ از متغیرهای داخلیِ خودش (--bs-dropdown-bg و...) استفاده می‌کند
   که با تاگل تمِ اپ (data-theme) هماهنگ نیستند؛ اینجا override می‌شوند — روی همهٔ dropdownهای
   بوت‌استرپیِ اپ اثر می‌گذارد (مثلاً منوی پروفایل در هدر، admin-submenu و...) */
:root[data-theme="dark"] .dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-color: var(--text-strong);
    --bs-dropdown-link-color: var(--text-strong);
    --bs-dropdown-link-hover-color: var(--text-strong);
    --bs-dropdown-link-hover-bg: #232a3a;
    --bs-dropdown-border-color: var(--border-soft);
    --bs-dropdown-divider-bg: var(--border-soft);
    --bs-dropdown-link-disabled-color: var(--text-muted);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ======================================== 
           🔔 Notification Dropdown
        ======================================== */
.dropdown-menu.notification-dropdown {
    position: fixed !important;
    width: 360px !important;
    max-height: 480px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(116, 76, 164, 0.2);
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    z-index: 9999 !important;
    right: auto !important;
    left: 20px !important;
    top: 70px !important;
    margin-top: 0 !important;
    transform: none !important;
    max-width: calc(100vw - 40px);
    min-width: 300px;
    animation: slideDown 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================================== 
       ⏱️ حضور و غیاب - Minimal Icons
    ======================================== */

/* Container */
.attendance-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* دکمه آیکنی مینیمال */
.attendance-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attendance-icon-btn i {
    padding-top: 5px;
    font-size: 1.15rem;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.attendance-icon-btn:hover {
    transform: translateY(-2px);
}

.attendance-icon-btn:hover i {
    transform: scale(1.1);
}

.attendance-icon-btn:active {
    transform: translateY(0);
}

/* دکمه ورود - سبز */
.attendance-icon-btn.btn-in {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
}

.attendance-icon-btn.btn-in:hover {
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.4);
}

/* دکمه خروج - قرمز */
.attendance-icon-btn.btn-out {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
}

.attendance-icon-btn.btn-out:hover {
    box-shadow: 0 5px 16px rgba(239, 68, 68, 0.4);
}

/* آیکن اطلاعات */
.attendance-info-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.attendance-info-btn i {
    padding-top: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.attendance-info-btn:hover {
    background: rgba(116, 76, 164, 0.15);
    color: #744ca4;
}

.attendance-info-btn:hover i {
    transform: scale(1.1);
}

/* Tooltip برای info - پایین آیکن */
.attendance-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    text-align: right;
    direction: rtl;
    line-height: 1.8;
}

.attendance-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #1e293b;
}

.attendance-info-btn:hover .attendance-tooltip {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 12px);
}

/* لودینگ */
.attendance-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.attendance-loading .spinner-border {
    width: 18px;
    height: 18px;
    border-width: 2px;
    color: #744ca4;
}

/* حالت تکمیل شده - تیک سبز */
.attendance-complete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding-top: 3px;
}

/* Responsive برای حضور و غیاب */
@media (max-width: 768px) {
    /* .attendance-icon-btn {
        width: 26px !important;
        height: 26px !important;
    }

    .attendance-info-btn {
        width: 30px;
        height: 30px;
    } */

    .attendance-container {
        display: flex;
        gap: 4px;
        margin-left: 10px;
    }
}

@media (max-width: 576px) {
    .attendance-icon-btn {
        width: 32px;
        height: 32px;
    }

    .attendance-icon-btn i {
        font-size: 1rem;
    }
}

/* ======================================== 
       📋 Admin Submenu Styling
    ======================================== */
.admin-submenu {
    min-width: 240px !important;
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(116, 76, 164, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    padding: 8px;
    margin-top: 8px;
}

.admin-submenu .dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-submenu .dropdown-item i {
    font-size: 1rem;
    transition: all 0.3s ease;
    color: #744ca4;
}

.admin-submenu .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.12) 0%, rgba(101, 122, 231, 0.12) 100%);
    color: #744ca4;
    transform: translateX(-4px);
    padding-right: 20px;
}

.admin-submenu .dropdown-item:hover i {
    transform: scale(1.15);
    color: #657ae7;
}

.admin-submenu .dropdown-item:active {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.2) 0%, rgba(101, 122, 231, 0.2) 100%);
}

.admin-submenu .dropdown-divider {
    margin: 8px 0;
    border-color: rgba(116, 76, 164, 0.1);
}

/* استایل فلش dropdown */
.nav-link.dropdown-toggle::after {
    transition: transform 0.3s ease;
    margin-inline-start: 0;
}

.nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* انیمیشن باز شدن */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-submenu.show {
    animation: slideIn 0.3s ease-out;
}

/* Responsive برای admin submenu */
@media (max-width: 1399px) {
    .admin-submenu {
        background: white;
        box-shadow: none;
        border: 1px solid rgba(116, 76, 164, 0.15);
        margin-top: 4px;
    }

    .admin-submenu .dropdown-item:hover {
        transform: translateX(0);
        padding-right: 16px;
    }
}

:root[data-theme="dark"] .admin-submenu {
    background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
}

:root[data-theme="dark"] .admin-submenu .dropdown-item {
    color: var(--text-muted);
}

@media (max-width: 1399px) {
    :root[data-theme="dark"] .admin-submenu {
        background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
        border-color: var(--border-soft);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: 14px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.notification-item:hover .notification-icon {
    transform: scale(1.1) rotate(5deg);
}

.notification-icon.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.notification-icon.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.notification-icon.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.notification-icon.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.notification-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    padding: 16px 20px;
    border-bottom: 2px solid rgba(116, 76, 164, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.notification-header span {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.notification-list-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
}

.notification-list-container::-webkit-scrollbar {
    width: 8px;
}

.notification-list-container::-webkit-scrollbar-track {
    background: rgba(116, 76, 164, 0.05);
    border-radius: 10px;
    margin: 4px 0;
}

.notification-list-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #744ca4 0%, #657ae7 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.notification-list-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #657ae7 0%, #744ca4 100%);
}

.notification-item {
    padding: 8px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    background: white;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(116, 76, 164, 0.05) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.notification-item:hover::before {
    width: 100%;
}

.notification-item:hover {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.03) 0%, rgba(101, 122, 231, 0.03) 100%);
    border-color: rgba(116, 76, 164, 0.2);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(116, 76, 164, 0.1);
}

.notification-item.unread {
    box-shadow: 0 2px 8px rgba(116, 76, 164, 0.15);
}

.notification-item.unread::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(116, 76, 164, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

.notification-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #2d3748;
    font-size: 13.5px;
    line-height: 1.4;
}

.notification-message {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 6px;
}

.notification-time {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.notification-empty {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
}

.notification-empty i {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 12px;
    display: block;
    color: #744ca4;
}

.mark-all-btn {
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(116, 76, 164, 0.2);
}

.mark-all-btn:hover {
    background: linear-gradient(135deg, #657ae7 0%, #744ca4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(116, 76, 164, 0.3);
}

.mark-all-btn:active {
    transform: translateY(0);
}

.notification-loading {
    text-align: center;
    padding: 32px;
}

.notification-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 3px;
    color: #744ca4;
}

.dropdown-menu.notification-dropdown.empty {
    max-height: 180px;
}

@media (max-width: 576px) {
    .dropdown-menu.notification-dropdown {
        width: calc(100vw - 40px) !important;
        right: 20px !important;
        left: 20px !important;
        top: 80px !important;
    }
}

:root[data-theme="dark"] .dropdown-menu.notification-dropdown {
    background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .notification-header {
    background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
    border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .notification-item {
    background: var(--info-box-bg);
}

:root[data-theme="dark"] .notification-item:hover {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.15) 0%, rgba(101, 122, 231, 0.15) 100%);
    border-color: rgba(116, 76, 164, 0.35);
}

:root[data-theme="dark"] .notification-title {
    color: var(--text-strong);
}

:root[data-theme="dark"] .notification-message {
    color: var(--text-muted);
}

/* ======================================== 
           🍞 Toast Notification
        ======================================== */
.toast-notification {
    position: fixed;
    top: 90px;
    left: 24px;
    min-width: 300px;
    max-width: 400px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(116, 76, 164, 0.2);
    border: 2px solid rgba(116, 76, 164, 0.1);
    padding: 0;
    transform: translateX(-450px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    overflow: hidden;
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #744ca4 0%, #657ae7 100%);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-header {
    padding: 14px 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    border-bottom: 2px solid rgba(116, 76, 164, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
}

.toast-body {
    padding: 12px 16px 14px;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.6;
}

:root[data-theme="dark"] .toast-notification {
    background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .toast-header {
    background: linear-gradient(135deg, var(--surface) 0%, #1f2536 100%);
    border-bottom-color: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .toast-body {
    color: var(--text-muted);
}

/* ======================================== 
           📱 Navbar Container & Spacing
        ======================================== */
.navbar .container-fluid {
    display: flex !important;
    align-items: center;
    gap: 1rem;
}

.navbar .nav-link {
    padding-left: .8rem !important;
    padding-right: .8rem !important;
    gap: 7px;
}

.settings-btn,
.navbar-brand {
    margin-left: 0.5rem;
}

/* ======================================== 
           🎯 Navbar Toggler
        ======================================== */
.navbar-toggler {
    border: none;
    padding: 4px;
    transition: all 0.3s ease;
    width: 1rem;
    scale: .7;
}

.navbar-toggler:hover {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.08) 0%, rgba(101, 122, 231, 0.08) 100%);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(116, 76, 164, 0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23744ca4' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========================================
   🔘 Vertical Navbar Divider
======================================== */
.navbar-divider {
    width: 1px;
    height: 25px;
    background: var(--border-soft);
    margin: 0 10px 0 10px;
    align-self: center;
}

@media (max-width: 1399px) {
    .navbar-divider {
        display: none;
    }
}

/* ======================================== 
           📱 Responsive
        ======================================== */
@media (max-width: 576px) {
    .navbar .container-fluid {
        gap: 0.1rem !important;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 8px 12px !important;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .notification-bell {
        font-size: 1.2rem;
    }

    .settings-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 1320px) {
    .navbar-collapse {
        background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
        border-radius: 12px;
        margin-top: 12px;
        padding: 12px;
        box-shadow: 0 4px 20px rgba(116, 76, 164, 0.1);
        border: 1px solid rgba(116, 76, 164, 0.1);
    }

    .navbar-nav {
        gap: 4px;
        padding-left: 0px !important;
    }

    .nav-link {
        margin: 2px 0;

    }

    .navbar .nav-link {
        padding-left: .4rem !important;
        padding-right: .4rem !important;
        gap: 7px;
    }

    .settings-btn {
        padding: 5px 5px !important;
    }

}

/* ======================================== 
           ✨ Loading Animation
        ======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
}

/* ============== History Timeline ============== */
.history-timeline {
    position: relative;
    padding-right: 2rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    right: 4px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #744ca4 0%, #657ae7 100%);
    opacity: 0.2;
}

.history-item {
    position: relative;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(116, 76, 164, 0.1);
    transition: all 0.3s ease;
}

:root[data-theme="dark"] .history-item {
    background: var(--surface);
}

.history-item:hover {
    box-shadow: 0 4px 16px rgba(116, 76, 164, 0.12);
    transform: translateX(-4px);
    border-color: rgba(116, 76, 164, 0.2);
}

.history-item::before {
    content: '';
    position: absolute;
    right: -32px;
    top: 20px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #744ca4;
}

:root[data-theme="dark"] .history-item::before {
    border-color: var(--surface);
}

.history-action {
    font-weight: 700;
    color: #744ca4;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.history-time {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-weight: 500;
}

:root[data-theme="dark"] .history-time {
    color: var(--text-muted);
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe5a1 100%);
    color: #856404;
    border-left: 4px solid #d97706;
}

.alert-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #cfe7ff 100%);
    color: #0369a1;
    border-left: 4px solid #0891b2;
}


.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e8eaed;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: white;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* این بلوک، به‌خاطر ترتیبِ فایل، روی تعریفِ اولِ .form-control/.form-select/.form-label (بخش ۶) غالب است؛
   قواعدِ دارک هم همینجا اضافه می‌شوند تا مستقل از این تکرار، درست کار کنند */
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
    background-color: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .form-control:focus,
:root[data-theme="dark"] .form-select:focus {
    background-color: var(--surface);
    border-color: var(--icon-accent);
    box-shadow: 0 0 0 3px rgba(205, 184, 255, 0.15);
}

:root[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

:root[data-theme="dark"] .form-control:disabled,
:root[data-theme="dark"] .form-select:disabled {
    background-color: #161b27;
    color: var(--text-muted);
}

:root[data-theme="dark"] .form-label {
    color: var(--text-strong);
}

:root[data-theme="dark"] .form-check-input {
    background-color: #2b3242;
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .form-check-label {
    color: var(--text-strong);
}

/* آیکن ساعت شنی با افکت pulse */
.deadline-request-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    animation: pulse-icon 2s infinite;
    padding: 0 !important;
    margin: 0 10px 0;
    vertical-align: middle;
}

.deadline-request-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.deadline-request-icon i {
    font-size: 16px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* ✅ آیکن داخلی قابل کلیک نباشد */
}

.deadline-request-icon.disabled,
.deadline-request-icon.disabled *,
span.deadline-request-icon.disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.deadline-request-icon.disabled:hover,
span.deadline-request-icon.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ============== استایل‌های آپلود فایل ============== */
.attachments-section {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.03) 0%, rgba(101, 122, 231, 0.03) 100%);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(116, 76, 164, 0.12);
}

.attachments-section h5 {
    color: #744ca4;
    /* margin-bottom: 1rem; */
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

:root[data-theme="dark"] .upload-area {
    background: var(--surface) !important;
    border-color: var(--border-soft) !important;
}

:root[data-theme="dark"] .upload-area p {
    color: var(--text-muted);
}

:root[data-theme="dark"] .upload-area small {
    color: var(--text-muted);
}

.upload-area {
    border: 2px dashed rgba(116, 76, 164, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;

    margin-top: 1rem;

}

.upload-area:hover {
    border-color: #744ca4;
    background: rgba(116, 76, 164, 0.05);
}

.upload-area.dragover {
    border-color: #657ae7;
    background: rgba(101, 122, 231, 0.1);
}

.upload-area i {
    font-size: 2.5rem;
    color: #744ca4;
    margin-bottom: 0.5rem;
}

.upload-area p {
    margin: 0.5rem 0;
    color: #6c757d;
}

.upload-area small {
    color: #999;
    font-size: 0.85rem;
}

.file-input-hidden {
    display: none;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(116, 76, 164, 0.1);
    transition: all 0.3s ease;
}

.attachment-item:hover {
    box-shadow: 0 4px 12px rgba(116, 76, 164, 0.15);
    border-color: rgba(116, 76, 164, 0.2);
}

.attachment-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ebff 100%);
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview i {
    font-size: 1.5rem;
    color: #744ca4;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.35);
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.no-attachments {
    text-align: center;
    padding: 1rem;
    color: #999;
    margin-top: 1rem;
}

.no-attachments i {
    font-size: 2rem;
    color: #ddd;
    /* margin-bottom: 1rem; */
}

/* آیکون‌های نوع فایل */
.file-icon-pdf {
    color: #dc3545;
}

.file-icon-doc {
    color: #0d6efd;
}

.file-icon-excel {
    color: #198754;
}

.file-icon-audio {
    color: #6f42c1;
}

.file-icon-image {
    color: #198754;
}

.upload-area-modal {
    border: 2px dashed rgba(116, 76, 164, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area-modal:hover {
    border-color: #744ca4;
    background: rgba(116, 76, 164, 0.05);
}

.upload-area-modal i {
    font-size: 2rem;
    color: #744ca4;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-area-modal p {
    margin: 0;
    color: #6c757d;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.selected-file-info i {
    color: #744ca4;
}

.selected-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.btn-remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.btn-remove-file:hover {
    color: #a71d2a;
}

/* ============== استایل ویرایش نام فایل ============== */
.attachment-name {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.attachment-name:hover {
    color: #744ca4;
}

.attachment-name.editable::after {
    content: '\F4CA';
    /* bi-pencil */
    font-size: 0.75rem;
    margin-right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attachment-name.editable:hover::after {
    opacity: 0.6;
}

/* ─── دارک‌مودِ بخشِ پیوست‌ها ─── */
:root[data-theme="dark"] .attachments-section {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.08) 0%, rgba(101, 122, 231, 0.08) 100%);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .attachment-item {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .attachment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    border-color: rgba(116, 76, 164, 0.35);
}

:root[data-theme="dark"] .attachment-preview {
    background: linear-gradient(135deg, rgba(116, 76, 164, 0.18) 0%, rgba(101, 122, 231, 0.18) 100%);
}

:root[data-theme="dark"] .attachment-name {
    color: var(--text-strong);
}

:root[data-theme="dark"] .attachment-meta {
    color: var(--text-muted);
}

:root[data-theme="dark"] .no-attachments {
    color: var(--text-muted);
}

:root[data-theme="dark"] .no-attachments i {
    color: var(--border-soft);
}

:root[data-theme="dark"] .upload-progress {
    background: var(--border-soft);
}

:root[data-theme="dark"] .upload-area-modal {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .upload-area-modal p {
    color: var(--text-muted);
}

:root[data-theme="dark"] .selected-file-item {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .selected-file-name {
    color: var(--text-strong);
}

@keyframes pulse-icon {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
    }
}

/* ✅ مخفی کردن قطعی */
.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@keyframes rotate-hourglass {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}


@keyframes pulse-ring {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4),
            0 0 0 0 rgba(255, 170, 0, 0.6);
    }

    50% {
        box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4),
            0 0 0 10px rgba(255, 170, 0, 0);
    }
}

@keyframes bell-ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-15deg);
    }

    20%,
    40% {
        transform: rotate(15deg);
    }

    50% {
        transform: rotate(0deg);
    }
}


/* نوار ثابت دکمه‌ها پایین صفحه */
.TDaction-buttons {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 12px 24px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

:root[data-theme="dark"] .TDaction-buttons {
    background: var(--surface);
    border-top-color: var(--border-soft);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

/* فاصله پایین بدنه صفحه تا دکمه‌ها رویش نیفتد */
.TDtask-detail-container {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .task-detail-container {
        margin: 1rem;
        border-radius: 20px;
    }

    .task-body {
        padding: 1.5rem;
    }

    .action-buttons {
        padding: 1rem;
        gap: 0.5rem;
    }

    .action-buttons .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .info-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .info-label {
        font-weight: 700;
    }

    .task-title {
        padding-left: 60px;
        font-size: 1.5rem;
    }
}

.status-message-wrapper {
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-detail-container {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.active-nav-item {
    border-radius: 8px;
    color: #744CA4 !important;
    font-weight: 600;
}

#mainNav .dropdown-item.active-nav-item {
    background: rgba(116, 76, 164, 0.1) !important;
    color: #744CA4 !important;
}

/* ============================================================
   🔧 DRAWER FIX — آخرین بلوک، بالاترین اولویت
   ============================================================ */

/* --- ① Drawer: پایه --- */
.mobile-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(280px, 85vw) !important;
    z-index: 1050 !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.15) !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    /* پنهان */
    transform: translateX(110%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.32s !important;
}

/* --- ② Drawer باز --- */
.mobile-drawer.drawer-open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0s !important;
}

/* --- ③ دسکتاپ: drawer → navbar عادی --- */
@media (min-width: 1400px) {

    .mobile-drawer,
    .mobile-drawer.drawer-open {
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: flex !important;
        flex: 1 !important;
        flex-direction: row !important;
        justify-content: center !important;
        overflow: visible !important;
        width: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    /* همبرگر و drawer-header مخفی در دسکتاپ */
    .mobile-menu-btn {
        display: none !important;
    }

    .drawer-header {
        display: none !important;
    }

    /* لوگو: دسکتاپ RTL سمت راست */
    .navbar-brand {
        margin-right: 0 !important;
        margin-left: auto !important;
    }
}

/* --- ④ موبایل --- */
@media (max-width: 1399px) {

    /* همبرگر: نمایش */
    .mobile-menu-btn {
        display: flex !important;
        order: 1;
    }

    /* لوگو: موبایل RTL سمت راست */
    .navbar-brand {
        order: 2;
        margin-right: 0 !important;
        margin-left: auto !important;
    }

    /* navbar-divider مخفی */
    .navbar-divider {
        display: none !important;
    }

    /* آیکون‌های پروفایل/notification/خروج: نمایش در موبایل */
    .navbar-nav.me-0 {
        display: flex !important;
        order: 3;
        flex-direction: row;
        margin-right: 0;
        gap: 0;
    }

    /* drawer-header: نمایش */
    .drawer-header {
        display: flex !important;
    }

    /* link hover در drawer: بدون transform */
    .mobile-drawer .nav-link:hover,
    .mobile-drawer .nav-link.active {
        transform: none !important;
    }

    .mobile-drawer .nav-link::before {
        display: none !important;
    }

}

/* --- Overlay --- */
.drawer-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.45) !important;
    z-index: 1040 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s !important;
    display: block !important;
}

.drawer-overlay.overlay-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease, visibility 0s linear 0s !important;
}

/* --- Drawer header --- */
.drawer-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.drawer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #744ca4;
}

.drawer-close-btn {
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
}

/* دارکِ کشوی موبایل — چون قواعدِ بالا !important دارند، اینجا هم !important لازم است */
:root[data-theme="dark"] .mobile-drawer {
    background: var(--surface) !important;
}

:root[data-theme="dark"] .drawer-header {
    background: var(--surface);
    border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .drawer-close-btn {
    background: var(--border-soft);
    color: var(--text-strong);
}

body.drawer-body-open {
    overflow: hidden !important;
}

/* ========================================
   🔧 FIX: اصلاح مودال درخواست جدید
   ======================================== */

/* اصلاح overlay مودال */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s !important;
}

.modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* اصلاح محتوای مودال */
.modal-overlay .modal-content {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    background: white !important;
    border-radius: 16px !important;
    width: 90% !important;
    max-width: 700px !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

/* این override هم چون !important دارد، فیکسِ دارکِ .modal-content (بالاتر در فایل) را خنثی می‌کرد؛
   نسخهٔ دارکِ همین قاعده هم باید !important داشته باشد */
:root[data-theme="dark"] .modal-overlay .modal-content {
    background: var(--surface) !important;
}

/* تنظیم مودال برای صفحات کوچک */
@media (max-width: 768px) {
    .modal-overlay .modal-content {
        width: 95% !important;
        max-height: 85vh !important;
    }
}




.minimal-list {
    display: flex;
    flex-direction: column;
}

.ml-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: start;
}

.ml-item:last-child {
    border-bottom: none;
}

:root[data-theme="dark"] .ml-item {
    border-bottom-color: var(--border-soft);
}

.ml-left {
    text-align: left;
    padding-left: 14px;
    border-left: 1px solid #eee;
}

:root[data-theme="dark"] .ml-left {
    border-left-color: var(--border-soft);
}

.ml-time {
    font-size: 0.72rem;
    color: #bbb;
    line-height: 1.6;
}

.ml-action-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    margin-top: 5px;
}

.ab-created,
.ab-assigned {
    background: #e8f5e9;
    color: #2e7d32;
}

.ab-completed,
.ab-approved {
    background: #e3f2fd;
    color: #1565c0;
}

.ab-pending {
    background: #fff3e0;
    color: #e65100;
}

.ab-rejected,
.ab-stopped {
    background: #fce4ec;
    color: #b71c1c;
}

.ab-delegated {
    background: #ede7f6;
    color: #4527a0;
}

.ab-updated {
    background: #e0f7fa;
    color: #006064;
}

.ab-deadline {
    background: #fff8e1;
    color: #f57f17;
}

.ml-user {
    font-size: 0.82rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

:root[data-theme="dark"] .ml-user {
    color: var(--text-strong);
}

.ml-user i {
    color: #aaa;
    margin-left: 4px;
    font-size: 0.75rem;
}

.ml-notes {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

:root[data-theme="dark"] .ml-notes {
    color: var(--text-muted);
}

.ml-deadline-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 3px;
}

:root[data-theme="dark"] .ml-deadline-inline {
    color: var(--text-muted);
}

.ml-cross {
    text-decoration: line-through;
    color: #bbb;
}

.ml-arrow-icon {
    color: #ffc107;
}

.ml-bold-new {
    font-weight: 700;
    color: #e65100;
}

.ml-reason-mini {
    font-size: 0.75rem;
    color: #aaa;
}

.tab {
    float: left;

    width: 90px;
    padding: 10px 15px;
    height: 30px;

    position: relative;

    background: #fff;

    -webkit-border-top-left-radius: 10px;
    -webkit-border-top-right-radius: 10px;
    -moz-border-radius-topleft: 10px;
    -moz-border-radius-topright: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.tab:before,
.tab:after {
    content: "";
    position: absolute;

    height: 10px;
    width: 20px;

    bottom: 0;
}

.tab:after {
    right: -20px;

    border-radius: 0 0 0 10px;
    -moz-border-radius: 0 0 0 10px;
    -webkit-border-radius: 0 0 0 10px;

    -webkit-box-shadow: -10px 0 0 0 #fff;
    box-shadow: -10px 0 0 0 #fff;
}

.tab:before {
    left: -20px;

    border-radius: 0 0 10px 0;
    -moz-border-radius: 0 0 10px 0;
    -webkit-border-radius: 0 0 10px 0;

    -webkit-box-shadow: 10px 0 0 0 #fff;
    box-shadow: 10px 0 0 0 #fff;
}

/* ========================================
   صفحه ورود (Login Page)
======================================== */

/* --- بدنه صفحه ورود --- */
body.login-page {
    background: var(--gray-50);
    height: 100vh;
    /* به جای min-height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* حذف padding اضافی */
    position: relative;
    overflow: hidden;
    /* جلوگیری از اسکرول */
    margin-top: 0;
}


body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 85% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    z-index: 0;
}

body.login-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

/* --- Wrapper --- */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 25%;
    /* دسکتاپ: 25% */
    margin: 0 auto;
    /* وسط‌چین */
}

.register-wrapper {
    position: relative;
    z-index: 1;
    width: 35%;
    /* دسکتاپ: 35% */
    margin: 0 auto;
    /* وسط‌چین */
}

/* --- کارت ورود --- */
.login-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
    width: 70%;
    /* اضافه کنید */
}


/* --- کارت ثبت نام --- */
.register-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: loginCardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes loginCardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--primary-light), transparent);
    border-radius: 0 0 4px 4px;
}

/* --- لوگو --- */
.login-logo-section {
    text-align: center;
    margin-bottom: 36px;
    animation: loginFadeUp 0.6s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes loginFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo-frame {
    width: 80px;
    height: 54px;
    margin: 0 auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-frame img {
    width: 100%;
    height: auto;
    transition: filter 0.3s ease;
}

.login-logo-frame:hover img {
    filter: invert(1) brightness(0.2) sepia(1) hue-rotate(220deg) saturate(4);
}

.login-logo-section h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    margin-top: 5px;
}

.login-logo-section .login-subtitle {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-bottom: 4px;
}

.login-logo-section .login-company {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    opacity: 0.85;
}

/* --- فیلدهای فرم ورود --- */
.login-form-group {
    margin-bottom: 20px;
    animation: loginFadeUp 0.6s calc(0.2s + var(--i, 0) * 0.08s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

.login-input-wrapper {
    position: relative;
    margin-top: .5rem;
}

.login-input-wrapper .login-field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    transition: color 0.2s;
}

.login-input {
    width: 75%;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 42px 12px 44px;
    font-size: 0.875rem;
    color: var(--gray-900);
    transition: all 0.25s ease;
    outline: none;
}

.login-input::placeholder {
    color: var(--gray-400);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

.login-input:focus~.login-field-icon {
    color: var(--primary);
}

/* --- دکمه نمایش رمز --- */
.login-password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.login-password-toggle:hover {
    color: var(--primary);
}

/* --- ردیف تنظیمات --- */
.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    animation: loginFadeUp 0.6s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

.login-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.login-checkbox-group input {
    display: none;
}

.login-custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    background: white;
}

.login-custom-checkbox svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
    color: white;
}

.login-checkbox-group input:checked+.login-custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.login-checkbox-group input:checked+.login-custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.login-checkbox-label {
    font-size: 0.8125rem;
    color: var(--gray-600);
    user-select: none;
}

.login-forgot-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-forgot-link:hover {
    color: var(--primary-dark);
}

/* --- دکمه ورود --- */
.login-btn-submit {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: loginFadeUp 0.6s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

.login-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-btn-submit:active {
    transform: translateY(0);
}

.login-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.login-btn-submit.loading {
    color: transparent !important;
}

.login-btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

/* --- پیام‌های هشدار ورود --- */
.login-alert {
    border-radius: var(--radius-sm);
    padding: 12px 40px 12px 16px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: loginSlideIn 0.3s ease;
    position: relative;
    margin-bottom: 16px;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-alert-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.login-alert-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.login-alert-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.login-alert .login-alert-close {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
    transition: opacity 0.2s;
    line-height: 1;
}

.login-alert .login-alert-close:hover {
    opacity: 1;
}

/* --- نوار امنیت --- */
.login-security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    animation: loginFadeUp 0.6s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.login-security-notice svg {
    width: 14px;
    height: 14px;
    color: var(--success);
    flex-shrink: 0;
}

.login-security-notice span {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* .footer-9 و متعلقاتش به pages/footer.php منتقل شد (سه مدلِ جایگذاریِ
   قابلِ‌تعویض: گوشه/درون‌خطی/نوارِ نازک) — تعریفِ اینجا حذف شد که با
   کلاس‌هایِ جدیدِ footer-style-N تداخل نداشته باشه */

/* --- ریسپانسیو ورود --- */
@media (max-width: 480px) {

    .login-wrapper,
    .register-wrapper {
        width: 100% !important;
        /* موبایل: 80% */
    }

    .login-card,
    .register-card {
        padding: 36px 24px;
        max-width: 80% !important;
    }

    .login-logo-frame {
        width: 90px;
        height: 72px;
    }

    .login-logo-section h1 {
        font-size: 1.2rem;
    }
}

/* ========================================
   24. گزارش روزانه (Daily Report)
======================================== */

/* --- آمار گرید --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 1.25rem;
}

.stats-grid .stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    border-right: 4px solid var(--gray-300);
    transition: all 0.2s ease;
}

.stats-grid .stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-grid .stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin: 0;
}

.stats-grid .stat-card .stat-label {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin: 6px 0 0;
    font-weight: 400;
}

/* رنگ‌بندی border-right کارت‌های آمار */
.stats-grid .stat-card.total {
    border-right-color: var(--primary);
}

.stats-grid .stat-card.completed {
    border-right-color: var(--success);
}

.stats-grid .stat-card.approved {
    border-right-color: #20c997;
}

.stats-grid .stat-card.created {
    border-right-color: var(--info);
}

.stats-grid .stat-card.delegated {
    border-right-color: var(--primary-light);
}

.stats-grid .stat-card.overdue {
    border-right-color: var(--danger);
}

:root[data-theme="dark"] .stats-grid .stat-card,
:root[data-theme="dark"] .steps-section {
    background: var(--surface);
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .stats-grid .stat-card .stat-number {
    color: var(--text-strong);
}

:root[data-theme="dark"] .stats-grid .stat-card .stat-label {
    color: var(--text-muted);
}

/* --- نشانگر مراحل (Steps Indicator) --- */
.steps-section {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
}

.steps-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--gray-500);
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step.active .step-circle {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.step.completed .step-circle {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--success);
}

.step-divider {
    width: 60px;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    flex-shrink: 0;
}

.step.completed+.step-divider {
    background: var(--success);
}

/* ═══════════════════════════════════════════
   فعالیت‌های اخیر — مینیمال + گروه‌بندی زمانی
   ═══════════════════════════════════════════ */

/* --- فیلتر --- */
.act-filters {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.act-filter-btn {
    padding: 0.3rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.act-filter-btn:hover {
    border-color: #a5b4fc;
    color: #6366f1;
}

.act-filter-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* --- گروه زمانی --- */
.act-group {
    margin-bottom: 0.85rem;
}

.act-group:last-of-type {
    margin-bottom: 0;
}

.act-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.4rem;
}

.act-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
}

.act-group-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* --- آیتم فعالیت (مینیمال خطی) --- */
.act-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    transition: background 0.15s;
    cursor: pointer;
}

.act-item+.act-item {
    border-top: 1px solid #f8fafc;
}

.act-item:hover {
    background: #f8f9fc;
}

/* نقطه رنگی */
.act-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    position: relative;
}

.act-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s;
}

.act-item:hover .act-dot::after {
    opacity: 0.12;
}

.act-dot.created {
    background: #6366f1;
}

.act-dot.created::after {
    background: #6366f1;
}

.act-dot.completed {
    background: #10b981;
}

.act-dot.completed::after {
    background: #10b981;
}

.act-dot.assigned {
    background: #3b82f6;
}

.act-dot.assigned::after {
    background: #3b82f6;
}

.act-dot.approved {
    background: #059669;
}

.act-dot.approved::after {
    background: #059669;
}

.act-dot.rejected {
    background: #ef4444;
}

.act-dot.rejected::after {
    background: #ef4444;
}

.act-dot.reminder {
    background: #f59e0b;
}

.act-dot.reminder::after {
    background: #f59e0b;
}

.act-dot.stopped {
    background: #94a3b8;
}

.act-dot.stopped::after {
    background: #94a3b8;
}

.act-dot.delegated {
    background: #8b5cf6;
}

.act-dot.delegated::after {
    background: #8b5cf6;
}

.act-dot.commented {
    background: #a78bfa;
}

.act-dot.commented::after {
    background: #a78bfa;
}

.act-dot.status_changed {
    background: #60a5fa;
}

.act-dot.status_changed::after {
    background: #60a5fa;
}

.act-dot.deadline_extended {
    background: #fb923c;
}

.act-dot.deadline_extended::after {
    background: #fb923c;
}

.act-dot.pending_approval {
    background: #fbbf24;
}

.act-dot.pending_approval::after {
    background: #fbbf24;
}

.act-dot.termination_requested {
    background: #f87171;
}

.act-dot.termination_requested::after {
    background: #f87171;
}

/* محتوا */
.act-body {
    flex: 1;
    min-width: 0;
}

.act-text {
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.65;
}

.act-text .act-user {
    font-weight: 700;
    color: #0f172a;
}

.act-text .act-verb {
    color: #6366f1;
    font-weight: 600;
}

.act-text .act-task {
    color: #475569;
    font-weight: 500;
}

.act-time {
    font-size: 0.68rem;
    color: #b0b8c4;
    margin-top: 2px;
}

/* بارگذاری بیشتر */
.act-load-more {
    text-align: center;
    padding: 0.65rem 0 0.25rem;
}

.act-load-more button {
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #6366f1;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.45rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.act-load-more button:hover {
    border-color: #6366f1;
    background: #f5f3ff;
}

/* حالت خالی */
.act-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}

.act-empty i {
    font-size: 2.5rem;
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.5rem;
}

:root[data-theme="dark"] .act-filter-btn {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-muted);
}

:root[data-theme="dark"] .act-item:hover {
    background: #232a3a;
}

:root[data-theme="dark"] .act-item+.act-item {
    border-top-color: var(--border-soft);
}

:root[data-theme="dark"] .act-text {
    color: var(--text-strong);
}

:root[data-theme="dark"] .act-text .act-user {
    color: var(--text-strong);
}

:root[data-theme="dark"] .act-text .act-task {
    color: var(--text-muted);
}

:root[data-theme="dark"] .act-load-more button {
    border-color: var(--border-soft);
}

:root[data-theme="dark"] .act-load-more button:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}

.act-empty p {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* --- Textarea گزارش --- */
.report-textarea {
    width: 100%;
    min-height: 400px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    line-height: 1.8;
    font-size: 0.875rem;
    resize: vertical;
    transition: all 0.2s ease;
    background: white;
}

.report-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.word-count {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: left;
    margin-top: 0.5rem;
}

/* --- بخش موفقیت --- */
.success-section {
    text-align: center;
    padding: 3rem 1.5rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.success-icon i {
    font-size: 2.5rem;
    color: var(--success);
}

.report-code {
    font-size: 1.1rem;
    background: var(--gray-50);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--success);
    color: var(--success);
    display: inline-block;
    margin: 1rem 0;
}

/* --- ریسپانسیو گزارش روزانه --- */
@media (max-width: 768px) {
    .footer-9 {
        display: none !important;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }

    .stats-grid .stat-card {
        padding: 0.875rem 0.625rem;
    }

    .stats-grid .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .stats-grid .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .steps-indicator {
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .step-divider {
        display: none;
    }

    .step-label {
        display: none;
    }

    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .report-textarea {
        min-height: 280px;
    }

    .activity-item {
        padding: 0.625rem 0.75rem;
    }

    .activity-item:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .success-section {
        padding: 2rem 1rem;
    }

    .success-icon {
        width: 64px;
        height: 64px;
    }

    .success-icon i {
        font-size: 2rem;
    }

    .report-code {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
}

.announcement-bell {
    font-size: 1.2rem;
    color: var(--icon-accent);
    transition: transform 0.2s ease;
}

.announcement-bell.has-announcement {
    animation: ann-ring 1s ease-in-out;
}

@keyframes ann-ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-15deg);
    }

    40% {
        transform: rotate(15deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    80% {
        transform: rotate(10deg);
    }
}

/* .announcement-badge حذف شد — اطلاعیه از حالا کلاسِ مشترکِ .notification-badge
   رو استفاده می‌کنه (هم‌راستا با بجِ چت/زنگ) تا هر سه یک‌شکل باشن */

/* ─── آیتم اطلاعیه (همسان با notification-item) ─── */
.announcement-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item:hover {
    background: #f8fafc;
}

.announcement-item.unread {
    background: #fafbff;
    border-right: 3px solid #667eea;
}

.announcement-item.unread .ann-item-title {
    font-weight: 700;
}

/* ─── آیکون اولویت ─── */
.ann-priority-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ann-priority-icon.urgent {
    background: #fee2e2;
    color: #dc2626;
}

.ann-priority-icon.high {
    background: #fef3c7;
    color: #d97706;
}

.ann-priority-icon.normal {
    background: #eff6ff;
    color: #3b82f6;
}

.ann-priority-icon.low {
    background: #f1f5f9;
    color: #94a3b8;
}

/* ─── محتوای آیتم ─── */
.ann-item-body {
    flex: 1;
    min-width: 0;
}

.ann-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ann-item-time {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── بج فوری روی عنوان ─── */
.ann-urgent-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
    background: #fee2e2;
    color: #dc2626;
    flex-shrink: 0;
}

.ann-high-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 5px;
    background: #fef3c7;
    color: #d97706;
    flex-shrink: 0;
}

/* ─── footer dropdown ─── */
.ann-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.ann-dropdown-footer a {
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.ann-dropdown-footer a:hover {
    text-decoration: underline;
}

/* ─── حالت خالی ─── */
.ann-empty {
    text-align: center;
    padding: 30px 16px;
    color: #94a3b8;
}

.ann-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

.ann-empty p {
    font-size: 13px;
}

/* ─── تمِ تاریک — این بخش تا حالا رنگ‌هایِ هاردکدِ روشن داشت و اصلاً
   با تاگلِ تمِ سراسری هماهنگ نبود (منویِ زنگولهٔ اطلاعیه در هدر) ─── */
:root[data-theme="dark"] .announcement-item {
    border-bottom-color: var(--border-soft);
    color: var(--text-strong);
}

:root[data-theme="dark"] .announcement-item:hover {
    background: #232a3a;
}

:root[data-theme="dark"] .announcement-item.unread {
    background: rgba(102, 126, 234, .1);
}

:root[data-theme="dark"] .ann-priority-icon.urgent {
    background: rgba(220, 38, 38, .18);
    color: #f87171;
}

:root[data-theme="dark"] .ann-priority-icon.high {
    background: rgba(217, 119, 6, .18);
    color: #fbbf24;
}

:root[data-theme="dark"] .ann-priority-icon.normal {
    background: rgba(59, 130, 246, .18);
    color: #60a5fa;
}

:root[data-theme="dark"] .ann-priority-icon.low {
    background: var(--ink-050, #232a3a);
    color: var(--text-muted);
}

:root[data-theme="dark"] .ann-item-title {
    color: var(--text-strong);
}

:root[data-theme="dark"] .ann-item-time {
    color: var(--text-muted);
}

:root[data-theme="dark"] .ann-urgent-tag {
    background: rgba(220, 38, 38, .18);
    color: #f87171;
}

:root[data-theme="dark"] .ann-high-tag {
    background: rgba(217, 119, 6, .18);
    color: #fbbf24;
}

:root[data-theme="dark"] .ann-dropdown-footer {
    border-top-color: var(--border-soft);
}

:root[data-theme="dark"] .ann-empty {
    color: var(--text-muted);
}

/* ─── چیپِ بیننده‌هایِ تسک (task-detail.php) ─── */
.viewer-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-page);
    color: var(--text-strong);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: .78rem;
}

.viewer-chip i {
    color: #dc2626;
}

:root[data-theme="dark"] .viewer-chip i {
    color: #f87171;
}


/* ────────── Holidays ────────── */
.page-header {
    background: white;
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(116, 76, 164, 0.08);
    border: 1px solid rgba(116, 76, 164, 0.1);
}

:root[data-theme="dark"] .page-header {
    background: var(--surface);
    border-color: var(--border-soft);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    font-size: 1.8rem;
}

/* ======================================== 
           📅 Calendar Styles
        ======================================== */
.calendar-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(116, 76, 164, 0.08);
    border: 1px solid rgba(116, 76, 164, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(116, 76, 164, 0.1);
}

.calendar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid rgba(116, 76, 164, 0.2);
    background: white;
    color: #744ca4;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.calendar-nav-btn:hover {
    background: linear-gradient(135deg, #744ca4 0%, #657ae7 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: #64748b;
    padding: 12px 8px;
    font-size: 0.9rem;
}

.calendar-day-name.friday {
    color: #dc2626;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #f8f9fc;
    position: relative;
    min-height: 45px;
    max-height: 50px;
    padding: 4px;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: rgba(116, 76, 164, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(116, 76, 164, 0.15);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    border-color: #744ca4;
    background: rgba(116, 76, 164, 0.08);
}

.calendar-day.friday {
    background: rgba(239, 68, 68, 0.08);
}

.calendar-day.holiday {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(248, 113, 113, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.calendar-day.holiday .day-number {
    color: #dc2626;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
}

.day-label {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 1px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    line-height: 1.2;
}

.holiday-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #dc2626;
}

/* ======================================== 
           📋 Holidays List
        ======================================== */
.holidays-list-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(116, 76, 164, 0.08);
    border: 1px solid rgba(116, 76, 164, 0.1);
}

.holidays-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(116, 76, 164, 0.1);
}

.holidays-list-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.holiday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f8f9fc;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.holiday-item:hover {
    background: rgba(116, 76, 164, 0.08);
}

.holiday-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.holiday-date {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.holiday-title {
    color: #64748b;
    font-size: 0.9rem;
}

.holiday-delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holiday-delete-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
}

.no-holidays {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
}

.no-holidays i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 12px;
    display: block;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 40px;
        max-height: 45px;
        border-radius: 6px;
    }

    .day-number {
        font-size: 0.8rem;
    }

    .day-label {
        font-size: 0.5rem;
    }

    .calendar-day-name {
        font-size: 0.75rem;
        padding: 6px 2px;
    }

    .calendar-grid {
        gap: 4px;
    }
}

@media (max-width: 576px) {
    .calendar-day {
        min-height: 35px;
        max-height: 40px;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .day-label {
        display: none;
    }

    .calendar-grid {
        gap: 3px;
    }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(116, 76, 164, 0.2);
    border-top-color: #744ca4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid rgba(116, 76, 164, 0.1);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.friday {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.legend-color.holiday {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(248, 113, 113, 0.3) 100%);
}

.legend-color.today {
    background: rgba(116, 76, 164, 0.15);
    border: 2px solid #744ca4;
}

/* ─── دارک‌مودِ صفحه‌ی روزهای تعطیل (holidays.php) ─── */
:root[data-theme="dark"] .calendar-container,
:root[data-theme="dark"] .holidays-list-container {
    background: var(--surface);
    border-color: var(--border-soft);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .calendar-header,
:root[data-theme="dark"] .holidays-list-header,
:root[data-theme="dark"] .calendar-legend {
    border-bottom-color: var(--border-soft);
    border-top-color: var(--border-soft);
}

:root[data-theme="dark"] .calendar-title,
:root[data-theme="dark"] .holidays-list-title,
:root[data-theme="dark"] .day-number,
:root[data-theme="dark"] .holiday-date {
    color: var(--text-strong);
}

:root[data-theme="dark"] .calendar-nav-btn {
    background: var(--surface);
    border-color: var(--border-soft);
    color: #b48ee0;
}

:root[data-theme="dark"] .calendar-day-name,
:root[data-theme="dark"] .day-label,
:root[data-theme="dark"] .holiday-title,
:root[data-theme="dark"] .no-holidays,
:root[data-theme="dark"] .legend-item {
    color: var(--text-muted);
}

:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .holiday-item {
    background: var(--bg-page);
}

:root[data-theme="dark"] .calendar-day.today {
    background: rgba(116, 76, 164, 0.18);
}

:root[data-theme="dark"] .calendar-day.friday {
    background: rgba(239, 68, 68, 0.14);
}

:root[data-theme="dark"] .calendar-day.holiday {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(248, 113, 113, 0.22) 100%);
}

:root[data-theme="dark"] .calendar-day.holiday .day-number {
    color: #f87171;
}

:root[data-theme="dark"] .calendar-day-name.friday {
    color: #f87171;
}

:root[data-theme="dark"] .holiday-item:hover {
    background: rgba(116, 76, 164, 0.15);
}

:root[data-theme="dark"] .holiday-delete-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Organization Page Styles */
.organization-logo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--gray-200, #e2e8f0);
    transition: all 0.3s ease;
}

.organization-logo:hover {
    border-color: var(--primary, #6366F1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.logo-upload-btn {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.logo-upload-btn input[type="file"] {
    position: absolute;
    left: -9999px;
}

.subscription-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.subscription-badge.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.subscription-badge.expired {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.subscription-badge.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.2) 100%);
    color: var(--primary, #6366F1);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: #10b981;
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #f59e0b;
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: #3b82f6;
}

.plan-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent !important;
}

.plan-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary, #6366F1) !important;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2) !important;
}

.plan-card.recommended {
    border-color: var(--primary, #6366F1) !important;
    position: relative;
}

.plan-card.recommended::before {
    content: "پیشنهادی";
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #6366F1 0%, #4f46e5 100%);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary, #6366F1);
    margin: 16px 0;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.plan-features li {
    padding: 8px 0;
    color: var(--gray-600, #475569);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    font-size: 1.2rem;
}

.edit-mode .form-control:not(:disabled) {
    border-color: var(--primary, #6366F1);
    background-color: #f8f9ff;
}

.info-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--gray-600, #475569);
    font-weight: 500;
    font-size: 0.875rem;
}

.info-value {
    color: var(--gray-900, #0f172a);
    font-weight: 600;
}

:root[data-theme="dark"] .info-label {
    color: var(--text-muted);
}

:root[data-theme="dark"] .info-value {
    color: var(--text-strong);
}

:root[data-theme="dark"] .info-row {
    border-bottom-color: var(--border-soft);
}

:root[data-theme="dark"] .edit-mode .form-control:not(:disabled) {
    background-color: #232a3a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .organization-logo {
        width: 100px;
        height: 100px;
    }

    .plan-price {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

.register-link-underline {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 16px;
    padding: 8px 0;
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

.register-link-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #764ba2;
    transition: width 0.3s ease;

}

.register-link-underline:hover {
    color: #764ba2;
}

.register-link-underline:hover::after {
    width: 60%;
}

.ag-paging-panel {
    flex-direction: row-reverse !important;
    gap: 0 !important;
    align-items: center !important;
}

.ag-paging-button-wrapper {
    padding: 0 16px;
    border-right: 1px solid #dee2e6;
}

.ag-paging-row-summary-panel {
    padding: 0 16px;
    border-right: 1px solid #dee2e6;
    direction: rtl;
    font-family: Tahoma, 'Vazirmatn', sans-serif;
}

.ag-paging-page-size {
    padding: 0 16px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px;
    white-space: nowrap;
}

.ag-paging-button[ref="btFirst"] .ag-icon,
.ag-paging-button[ref="btLast"] .ag-icon,
.ag-paging-button[ref="btNext"] .ag-icon,
.ag-paging-button[ref="btPrevious"] .ag-icon {
    transform: scaleX(-1);
}

.ag-paging-page-size::before {
    content: 'تعداد در صفحه: ';
    font-family: Tahoma, 'Vazirmatn', sans-serif;
    font-size: 13px;
}

.ag-paging-page-size .ag-label {
    display: none;
}

#delegatedTaskSearchBox {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#delegatedTaskSearchBox .form-control {
    border: 1px solid #e8eaed;
    padding: 10px 14px;
    font-size: 14px;
}

#delegatedTaskSearchBox .form-control:focus {
    border-color: #f5576c;
    box-shadow: none;
}

.dtask-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid #ddd;
    transition: border-color .15s;
}

.dtask-search-row:focus-within {
    border-bottom-color: #555;
}

.dtask-search-row i {
    font-size: 15px;
    color: #aaa;
    flex-shrink: 0;
    transition: color .15s;
}

.dtask-search-row:focus-within i {
    color: #666;
}

.dtask-search-row input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    direction: rtl;
}

/* ============================================================
   🆕 ریسپانسیو برای لپ‌تاپ و مانیتورهای بزرگ
   (بدون دست‌زدن به breakpointهای موبایل و معمولی)
   ============================================================ */

/* لپ‌تاپ‌های معمولی و مانیتور متوسط: 1201px تا 1600px */
@media (min-width: 1201px) and (max-width: 1600px) {

    .overview-container,
    .task-detail-container {
        max-width: 900px;
        /* جلوگیری از کش‌آمدن یا پهن‌شدن بیش از حد */
        margin-left: auto;
        margin-right: auto;
    }
}

/* مانیتورهای بزرگ: 1601px تا 1920px (Full HD) */
@media (min-width: 1601px) and (max-width: 1920px) {

    .overview-container,
    .task-detail-container {
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }

    /* فونت کمی بزرگ‌تر برای خوانایی روی صفحه بزرگ */
    body {
        font-size: 15px;
    }
}

/* مانیتورهای خیلی بزرگ: بالای 1920px (2K / 4K) */
@media (min-width: 1921px) {

    .overview-container,
    .task-detail-container {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }

    body {
        font-size: 16px;
    }
}

.custom-toast {
    position: fixed;
    top: 80px;
    left: 24px;
    z-index: 99999;
    min-width: 280px;
    max-width: 400px;
    background: #1e2233;
    color: #fff;
    border-radius: 12px;
    padding: .8rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
    font-family: Vazirmatn, sans-serif;
    font-size: .9rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s ease, transform .25s ease;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.custom-toast .toast-content {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.custom-toast .toast-content i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.custom-toast.toast-success {
    background: #16a34a;
}

.custom-toast.toast-error {
    background: #dc2626;
}

.custom-toast.toast-warning {
    background: #d97706;
}

.custom-toast.toast-info {
    background: #4f46e5;
}