/* Modern Education Management System UI */
/* Responsive Tables CSS - Inline to ensure loading */
/* =====================================================
   سیستم Responsive Tables - تنظیم اندازه جدول‌ها بر اساس رزولوشن
   ===================================================== */

/* متغیرهای CSS برای رزولوشن‌های مختلف */
:root {
    /* رزولوشن‌های مختلف */
    --screen-xs: 480px;    /* موبایل کوچک */
    --screen-sm: 768px;    /* موبایل بزرگ */
    --screen-md: 1024px;   /* تبلت */
    --screen-lg: 1366px;   /* لپ‌تاپ */
    --screen-xl: 1920px;   /* دسکتاپ */
    
    /* اندازه‌های جدول بر اساس رزولوشن */
    --table-padding-xs: 8px;
    --table-padding-sm: 10px;
    --table-padding-md: 12px;
    --table-padding-lg: 15px;
    --table-padding-xl: 18px;
    
    --table-font-xs: 0.75rem;
    --table-font-sm: 0.8rem;
    --table-font-md: 0.9rem;
    --table-font-lg: 0.95rem;
    --table-font-xl: 1rem;
    
    /* حداکثر عرض جدول بر اساس رزولوشن */
    --table-max-width-xs: 100vw;
    --table-max-width-sm: 100vw;
    --table-max-width-md: 95vw;
    --table-max-width-lg: 90vw;
    --table-max-width-xl: 85vw;
}

/* =====================================================
   استایل‌های پایه جدول‌ها
   ===================================================== */

/* Container اصلی جدول */
.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
}

/* جدول اصلی */
.responsive-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #ffffff;
    color: #212529;
    font-family: var(--font-family-primary);
    font-size: 12px; /* فونت پیش‌فرض بدنه */
}

/* Header جدول */
.responsive-table thead th {
    /* Header: very light gray bg, dark gray text */
    background: #F3F4F6 !important;
    color: #374151 !important;
    border-bottom: 1px solid #E5E7EB !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    padding: 10px 12px;
}

/* سلول‌های جدول */
.responsive-table td {
    /* Body cells: soft black text, light borders */
    color: #111827 !important;
    border-bottom: 1px solid #E5E7EB !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px !important;
    padding: 10px 12px;
}

/* Hover effect */
.responsive-table tbody tr:hover {
    background: rgba(var(--color-primary-rgb, 91, 111, 224), 0.1) !important;
    color: var(--color-primary, #5b6fe0) !important;
}

/* Use the high-specificity helper below instead of styling td directly here */

/* Ensure we beat Bootstrap's .table-hover > tbody > tr:hover > * rule */
.responsive-table.table-hover > tbody > tr:hover > * {
    background-color: rgba(var(--color-primary-rgb, 91, 111, 224), 0.1) !important;
    color: var(--color-primary, #5b6fe0) !important;
}

/* Base row backgrounds: zebra */
.responsive-table tbody tr {
    background: #FFFFFF;
}

.responsive-table tbody tr:nth-of-type(odd) {
    background: #FAFAFA;
}

.responsive-table tbody tr:nth-of-type(even) {
    background: #FFFFFF;
}

/* Apply the same scheme explicitly for #usersTable to ensure priority vs. Bootstrap */
#usersTable thead th {
    background-color: #F3F4F6 !important;
    color: #374151 !important;
    border-color: #E5E7EB !important;
}

#usersTable tbody td {
    color: #111827 !important;
    border-bottom-color: #E5E7EB !important;
}

#usersTable tbody tr {
    background-color: #FFFFFF !important;
}

#usersTable tbody tr:nth-of-type(odd) {
    background-color: #FAFAFA !important;
}

#usersTable tbody tr:nth-of-type(even) {
    background-color: #FFFFFF !important;
}

#usersTable tbody tr:hover,
#usersTable.table-hover tbody tr:hover {
    background-color: rgba(var(--color-primary-rgb, 91, 111, 224), 0.1) !important;
    color: var(--color-primary, #5b6fe0) !important;
}

#usersTable.table-hover > tbody > tr:hover > * {
    background-color: rgba(var(--color-primary-rgb, 91, 111, 224), 0.1) !important;
    color: var(--color-primary, #5b6fe0) !important;
}

/* =====================================================
   تنظیمات بر اساس رزولوشن‌های مختلف
   ===================================================== */

/* رزولوشن خیلی کوچک (موبایل کوچک) - تا 480px */
@media (max-width: 480px) {
    .responsive-table-container {
        max-width: var(--table-max-width-xs);
        margin: 0.5rem 0;
        border-radius: 10px;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: var(--table-padding-xs);
        font-size: var(--table-font-xs);
        line-height: 1.2;
    }
    
    /* مخفی کردن ستون‌های غیرضروری در موبایل */
    .responsive-table .hide-xs {
        display: none !important;
    }
    
    /* تبدیل جدول به کارت در موبایل */
    .responsive-table-mobile-cards {
        display: block;
    }
    
    .responsive-table-mobile-cards thead {
        display: none;
    }
    
    .responsive-table-mobile-cards tbody,
    .responsive-table-mobile-cards tr,
    .responsive-table-mobile-cards td {
        display: block;
        width: 100%;
    }
    
    .responsive-table-mobile-cards tr {
        background: rgba(255, 255, 255, 0.05);
        margin-bottom: 1rem;
        border-radius: 10px;
        padding: 1rem;
        border: 1px solid var(--glass-border);
    }
    
    .responsive-table-mobile-cards td {
        border: none;
        padding: 0.5rem 0;
        text-align: right;
        position: relative;
        padding-right: 2rem;
    }
    
    .responsive-table-mobile-cards td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--accent-color);
        position: absolute;
        right: 0;
        top: 0.5rem;
    }
}

/* رزولوشن کوچک (موبایل بزرگ) - 481px تا 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .responsive-table-container {
        max-width: var(--table-max-width-sm);
        margin: 0.75rem 0;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: var(--table-padding-sm);
        font-size: var(--table-font-sm);
        line-height: 1.3;
    }
    
    .responsive-table .hide-sm {
        display: none !important;
    }
    
    .responsive-table-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--accent-color) transparent;
    }
    
    .responsive-table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .responsive-table-container::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .responsive-table-container::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 3px;
    }
}

/* رزولوشن متوسط (تبلت) - 769px تا 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-table-container {
        max-width: var(--table-max-width-md);
        margin: 1rem 0;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: var(--table-padding-md);
        font-size: var(--table-font-md);
        line-height: 1.4;
    }
    
    .responsive-table .hide-md {
        display: none !important;
    }
}

/* رزولوشن بزرگ (لپ‌تاپ) - 1025px تا 1366px */
@media (min-width: 1025px) and (max-width: 1366px) {
    .responsive-table-container {
        max-width: var(--table-max-width-lg);
        margin: 1.25rem 0;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: var(--table-padding-lg);
        font-size: var(--table-font-lg);
        line-height: 1.5;
    }
    
    .responsive-table .hide-lg {
        display: table-cell !important;
    }
}

/* رزولوشن خیلی بزرگ (دسکتاپ) - 1367px و بالاتر */
@media (min-width: 1367px) {
    .responsive-table-container {
        max-width: var(--table-max-width-xl);
        margin: 1.5rem 0;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: var(--table-padding-xl);
        font-size: var(--table-font-xl);
        line-height: 1.6;
    }
    
    .responsive-table .hide-xl {
        display: table-cell !important;
    }
}

/* =====================================================
   تنظیمات خاص برای رزولوشن 1360x768 (درخواست کاربر)
   ===================================================== */

@media (width: 1360px) and (height: 768px) {
    .responsive-table-container {
        max-width: 95vw;
        height: 70vh;
        overflow: auto;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        padding: 8px 8px;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .responsive-table tbody tr {
        height: 45px;
    }
    
    .responsive-table-container::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .responsive-table-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
    
    .responsive-table-container::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 4px;
    }
    
    .responsive-table-container::-webkit-scrollbar-thumb:hover {
        background: #2980b9;
    }
    
    #usersTable thead th:nth-child(4),
    #usersTable tbody td:nth-child(4),
    #usersTable thead th:nth-child(7),
    #usersTable tbody td:nth-child(7),
    #usersTable thead th:nth-child(10),
    #usersTable tbody td:nth-child(10) {
        display: none;
    }
}

/* =====================================================
   کلاس‌های کمکی برای کنترل نمایش
   ===================================================== */

.hide-xs { display: table-cell !important; }
.hide-sm { display: table-cell !important; }
.hide-md { display: table-cell !important; }
.hide-lg { display: table-cell !important; }
.hide-xl { display: table-cell !important; }

.show-xs-only { display: none !important; }
.show-sm-only { display: none !important; }
.show-md-only { display: none !important; }
.show-lg-only { display: none !important; }
.show-xl-only { display: none !important; }

@media (max-width: 480px) {
    .show-xs-only { display: table-cell !important; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .show-sm-only { display: table-cell !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .show-md-only { display: table-cell !important; }
}

@media (min-width: 1025px) and (max-width: 1366px) {
    .show-lg-only { display: table-cell !important; }
}

@media (min-width: 1367px) {
    .show-xl-only { display: table-cell !important; }
}

/* =====================================================
   انیمیشن‌ها و ترانزیشن‌ها
   ===================================================== */

.responsive-table-container {
    transition: all 0.3s ease;
}

.responsive-table thead th,
.responsive-table td {
    transition: background-color 0.12s ease, color 0.12s ease;
}

.responsive-table-loading {
    position: relative;
    opacity: 0.7;
}

.responsive-table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 204, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

.responsive-table tbody tr.responsive-table-loading,
.responsive-table tbody tr.responsive-table-loading td {
    background: hsl(210, 100%, 40%) !important;
    color: #6f42c1 !important;
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* =====================================================
   تنظیمات چاپ
   ===================================================== */

@media print {
    .responsive-table-container {
        max-width: 100%;
        box-shadow: none;
        background: white;
        color: black;
    }
    
    .responsive-table thead th,
    .responsive-table td {
        border: 1px solid #000;
        padding: 8px;
        font-size: 12px;
    }
    
    .responsive-table tbody tr:hover {
        background: transparent;
        transform: none;
    }
}

/* =====================================================
   کلاس‌های اضافی برای Bootstrap
   ===================================================== */

.table-responsive .responsive-table,
.table-responsive .responsive-table-container {
    width: 100%;
}

.responsive-table.table-bordered {
    border: 1px solid var(--glass-border);
}

.responsive-table.table-bordered th,
.responsive-table.table-bordered td {
    border: 1px solid var(--glass-border);
}

.responsive-table.table-striped tbody tr:nth-of-type(odd) {
    background: #FAFAFA;
}

.responsive-table.table-striped tbody tr:nth-of-type(even) {
    background: #FFFFFF;
}

.responsive-table.table-hover tbody tr:hover {
    background: rgba(var(--color-primary-rgb, 91, 111, 224), 0.1);
    color: var(--color-primary, #5b6fe0);
}

/* =====================================================
   کلاس‌های JavaScript برای کنترل داینامیک
   ===================================================== */

.responsive-table-compact {
    font-size: 0.8rem;
}

.responsive-table-compact thead th,
.responsive-table-compact td {
    padding: 6px 8px;
}

.responsive-table-expanded {
    font-size: 1.1rem;
}

.responsive-table-expanded thead th,
.responsive-table-expanded td {
    padding: 18px 20px;
}

.responsive-table-fixed-height {
    height: 60vh;
    overflow-y: auto;
}

.responsive-table-auto-height {
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
}

/* enhanced-tickets.css به tickets.css منتقل شد (فاز ۶ — حذف @import سراسری) */

:root {
    /* Theme / motion — color tokens owned by design-tokens.css */
    --theme-transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    --animation-speed: 0.2s;
    --animation-bounce: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Keep aliases in sync with design-tokens (no pastel semantic colors) */
    --primary-color: var(--color-primary, #5b6fe0);
    --primary-dark: var(--color-primary-dark, #4a5bc7);
    --primary-light: var(--color-primary-light, #7b8ef0);
    --secondary-color: var(--color-secondary, #64748b);
    --accent-color: var(--color-info, #0284c7);
    --success-color: var(--color-success, #0d9488);
    --success-dark: var(--color-success-dark, #0f766e);
    --success-light: var(--color-success-light, #2dd4bf);
    --warning-color: var(--color-warning, #d97706);
    --warning-dark: var(--color-warning-dark, #b45309);
    --warning-light: var(--color-warning-light, #fbbf24);
    --danger-color: var(--color-danger, #dc2626);
    --danger-dark: var(--color-danger-dark, #b91c1c);
    --danger-light: var(--color-danger-light, #f87171);
    --info-color: var(--color-info, #0284c7);
    --info-dark: var(--color-info-dark, #0369a1);
    --info-light: var(--color-info-light, #38bdf8);

    --neon-pink: #2d1b69;
    --neon-blue: #1e3a8a;
    --neon-green: #5b21b6;
    --neon-purple: #8b5cf6;
    --neon-orange: #3b82f6;
    --space-dark: #0a0a0a;
    --space-deep: #1a1a2e;
    --space-blue: #16213e;
    --nebula-purple: #533483;
    --star-white: #ffffff;

    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #64748b 0%, #475569 100%);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --success-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --warning-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --danger-gradient: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);

    --bg-primary: var(--color-bg, #ffffff);
    --bg-secondary: var(--color-bg-subtle, #f8fafc);
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-hover: rgba(255, 255, 255, 0.95);

    --text-primary: var(--color-text-main, #1e293b);
    --text-secondary: #475569;
    --text-tertiary: var(--color-text-muted, #64748b);
    --text-inverse: #ffffff;

    --border-primary: var(--color-border, #e2e8f0);
    --border-secondary: #cbd5e1;
    --border-accent: rgba(91, 111, 224, 0.25);

    --white: #ffffff;
    --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: var(--shadow-token-sm, 0 1px 2px rgba(15, 23, 42, 0.05));
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: var(--shadow-token-md, 0 4px 12px rgba(15, 23, 42, 0.08));
    --shadow-lg: var(--shadow-token-lg, 0 10px 24px rgba(15, 23, 42, 0.1));
    --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.12);
    --shadow-2xl: 0 25px 50px rgba(15, 23, 42, 0.18);
    --shadow-glow: 0 0 16px rgba(91, 111, 224, 0.2);

    --font-family: var(--font-family-main, 'IRANSans', 'Tahoma', sans-serif);
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;

    --navbar-height: 70px;
    --footer-height: 60px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --content-padding: 1.5rem;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    /* Dark Theme Colors */
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --success-dark: #059669;
    --success-light: #34d399;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fbbf24;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #f87171;
    --info-color: #3b82f6;
    --info-dark: #1d4ed8;
    --info-light: #60a5fa;
    
    /* Dark Theme Gradients */
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    --secondary-gradient: linear-gradient(135deg, #64748b 0%, #475569 100%);
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    
    /* Dark Theme Backgrounds */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-glass: rgba(30, 41, 59, 0.8);
    --bg-glass-hover: rgba(30, 41, 59, 0.9);
    
    /* Dark Theme Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f172a;
    
    /* Dark Theme Borders */
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-accent: rgba(139, 92, 246, 0.3);
    
    /* Dark Theme Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
    font-weight: normal;
    transition: var(--theme-transition);
    position: relative;
    overflow-x: hidden;
}

/* Space Background - Temporarily Disabled */
body::before {
    display: none; /* Temporarily disabled to fix click issues */
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, var(--star-white), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--star-white), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--star-white), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--star-white), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--star-white), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s infinite;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Shooting Stars - Temporarily Disabled */
body::after {
    display: none; /* Temporarily disabled to fix click issues */
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, var(--star-white) 50%, transparent 70%);
    background-size: 200px 200px;
    animation: shooting-star 6s infinite;
    z-index: -1;
}

@keyframes shooting-star {
    0% { transform: translateX(-100%) translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100vw) translateY(100vh); opacity: 0; }
}

/* Modern Navbar — sticky (نه fixed) تا با header-layout و offset سایدبار هم‌خوان باشد */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    height: var(--navbar-height);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-index-sticky, 1020);
    padding: 0 var(--spacing-6);
    backdrop-filter: blur(10px);
    transition: var(--theme-transition);
}

.navbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.navbar-brand i {
    font-size: var(--font-size-2xl);
    color: var(--primary-color);
}

.navbar-search {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.navbar-search input {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) var(--spacing-12);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    background: var(--white);
    font-size: var(--font-size-sm);
    transition: all 0.2s ease;
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.navbar-search i {
    position: absolute;
    left: var(--spacing-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: var(--font-size-lg);
    transition: var(--theme-transition);
}

.navbar-search .search-loading {
    position: absolute;
    left: var(--spacing-4);
    top: 50%;
    transform: translateY(-50%);
}

.navbar-search .search-loading .spinner-border {
    color: var(--primary-color);
    width: 16px;
    height: 16px;
}



.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

.navbar-actions .btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--gray-600);
    padding: var(--spacing-2);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.navbar-actions .btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.navbar-actions .btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modern Sidebar */
.dashboard-sidebar {
    position: fixed !important;
    top: 70px !important;
    right: 0 !important;
    width: 280px !important;
    height: calc(100vh - 70px) !important;
    /* حذف گرادینت و سایه برای سایدبار؛ پس‌زمینه ساده و ثابت */
    background: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 999 !important;
    transform: translateX(0) !important; /* در دسکتاپ همیشه نمایش داده می‌شود */
}

/* Scrollbar Styling for Sidebar */
.dashboard-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}



.sidebar-header {
    padding: 1.5rem !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.sidebar-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 1.125rem !important;
    transition: transform 0.3s ease !important;
}

.sidebar-logo:hover {
    transform: scale(1.05) !important;
}

.sidebar-logo i {
    font-size: 1.875rem !important;
    color: #ffffff !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
    /* animation: pulse 2s ease-in-out infinite !important; */ /* چشمک‌زن حذف شد */
}

/* @keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
} */

.sidebar-title {
    font-family: var(--font-family, 'IRANSans', 'Tahoma', 'Arial', sans-serif) !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    letter-spacing: 0.5px !important;
    font-size: 1.125rem !important;
}



.sidebar-menu {
    list-style: none;
    padding: var(--spacing-4) 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 2px var(--spacing-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu li:hover {
    transform: translateX(-4px);
}

.sidebar-menu a {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    color: #334155 !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 0.5rem !important;
    position: relative !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    overflow: hidden !important;
    margin: 2px 8px !important;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.sidebar-menu a:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%) !important;
    color: #667eea !important;
    transform: translateX(-4px) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
}

.sidebar-menu a:hover::before {
    width: 4px;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    transform: translateX(-4px) !important;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--white);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
}

.sidebar-menu a.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateX(-6px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.sidebar-menu i {
    margin-left: 0.75rem !important;
    margin-right: 0 !important;
    font-size: 1.125rem !important;
    width: 24px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
}

.sidebar-menu a:hover i {
    transform: scale(1.2) !important;
}

.sidebar-menu a.active i {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) !important;
}

.sidebar-menu span {
    position: relative !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
    flex: 1 !important;
}

.submenu {
    list-style: none;
    padding: var(--spacing-2) 0;
    margin: var(--spacing-2) 0 0 0;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.03) 0%, transparent 100%);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    border-right: 3px solid transparent;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: none;
    opacity: 0;
}

.menu-item-has-children.active .submenu {
    max-height: 500px;
    border-right-color: var(--primary-color);
    display: block !important;
    opacity: 1;
    padding: var(--spacing-2) 0;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.submenu li {
    margin: 2px var(--spacing-2);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: fadeInLeft 0.3s ease forwards;
    opacity: 0;
}

.menu-item-has-children.active .submenu li {
    animation: fadeInLeft 0.4s ease forwards;
}

.menu-item-has-children.active .submenu li:nth-child(1) { animation-delay: 0.05s; }
.menu-item-has-children.active .submenu li:nth-child(2) { animation-delay: 0.1s; }
.menu-item-has-children.active .submenu li:nth-child(3) { animation-delay: 0.15s; }
.menu-item-has-children.active .submenu li:nth-child(4) { animation-delay: 0.2s; }
.menu-item-has-children.active .submenu li:nth-child(5) { animation-delay: 0.25s; }
.menu-item-has-children.active .submenu li:nth-child(6) { animation-delay: 0.3s; }

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

.submenu li a {
    padding: 0.5rem 1rem 0.5rem 3rem !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 0.375rem !important;
    display: flex !important;
    align-items: center !important;
    margin: 2px 8px !important;
}

.submenu li a::before {
    content: '';
    position: absolute;
    right: var(--spacing-4);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: all 0.3s ease;
}

.submenu li a:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%) !important;
    color: #667eea !important;
    transform: translateX(-4px) !important;
    padding-right: 1.5rem !important;
}

.submenu li a:hover::before {
    background: var(--primary-color);
    width: 8px;
    height: 8px;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.submenu li a.active {
    background: linear-gradient(135deg, #667eea 0%, #5a6fd8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    transform: translateX(-4px) !important;
    font-weight: 600 !important;
}

.submenu li a.active::before {
    background: var(--white);
    width: 8px;
    height: 8px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Submenu Title - استایل عمومی برای تمام submenu-title ها */
.submenu-title {
    display: flex !important;
    align-items: center !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    gap: 0.5rem !important;
}

.submenu-title span {
    display: inline-block !important;
    font-family: var(--font-family, 'IRANSans', 'Tahoma', 'Arial', sans-serif) !important;
}

.submenu-title i {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
    font-size: 0.875rem !important;
    width: auto !important;
    text-align: center !important;
    transition: transform 0.3s ease !important;
    color: inherit !important;
}

.submenu-title:hover {
    color: var(--primary-color, #667eea) !important;
}

.submenu-title:hover i {
    transform: scale(1.2) !important;
    color: var(--primary-color, #667eea) !important;
}

/* Submenu Section (Separator) */
.submenu-section {
    padding: 1rem 1.5rem 0.5rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    position: relative !important;
    border-top: 1px solid #e2e8f0 !important;
}

.submenu-section:first-child {
    border-top: none !important;
    padding-top: 0.5rem !important;
}

.submenu-section::before {
    content: '';
    position: absolute;
    right: 1.5rem;
    left: 1.5rem;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #cbd5e1 50%, transparent 100%);
}

.submenu-section .submenu-title {
    display: flex !important;
    align-items: center !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 0.5rem 0 !important;
    transition: color 0.3s ease !important;
    gap: 0.5rem !important;
}

.submenu-section .submenu-title:hover {
    color: var(--primary-color, #667eea) !important;
}

.submenu-section .submenu-title i {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
    font-size: 0.875rem !important;
    transition: transform 0.3s ease !important;
    color: inherit !important;
}

.submenu-section .submenu-title:hover i {
    transform: scale(1.2) !important;
    color: var(--primary-color, #667eea) !important;
}

/* Logout Link Styling */
.sidebar-menu .logout-link {
    margin-top: var(--spacing-4);
    border-top: 2px solid var(--gray-200);
    padding-top: var(--spacing-4);
}

.sidebar-menu .logout-link::before {
    display: none;
}

.sidebar-menu .logout-link:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    transform: translateX(-4px);
}

.sidebar-menu .logout-link:hover i {
    color: var(--white);
    transform: scale(1.2) rotate(-10deg);
}

.menu-toggle {
    width: 100%;
    display: flex !important;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.menu-item-has-children {
    position: relative;
}

.menu-item-has-children::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px 0 0 2px;
}

.menu-item-has-children.active::after {
    height: 60%;
}

.submenu-arrow {
    margin-right: auto !important;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1 !important;
    color: #334155 !important; /* مشکی در حالت عادی */
    font-size: 0.875rem !important;
}

.menu-item-has-children.active .submenu-arrow {
    transform: rotate(180deg) !important;
    color: #334155 !important; /* مشکی در حالت باز هم */
}

.menu-item-has-children a:hover .submenu-arrow {
    color: #334155 !important; /* مشکی در hover هم */
    transform: scale(1.2) !important;
}

.menu-item-has-children.active a:hover .submenu-arrow {
    color: #334155 !important; /* مشکی در حالت active و hover هم */
}

/* Main Content */
.main-container {
    margin-top: 0; /* حذف margin-top اضافی */
    margin-right: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background: var(--gray-50);
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    padding: var(--content-padding);
    flex: 1;
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
}

/* Cards — سطح مات خوانا (بدون glass / بدون پرش hover) */
.card {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--animation-speed) var(--animation-smooth), border-color var(--animation-speed) ease;
    overflow: hidden;
    position: relative;
}

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

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--spacing-6);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: var(--spacing-6);
}

/* Stats Cards - Cyberpunk Style */
.stats-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all var(--animation-speed) var(--animation-smooth);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-card::before {
    display: none; /* Temporarily disabled to fix click issues */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2d1b69, #1e3a8a, #5b21b6);
    animation: neon-flow 3s infinite;
}

@keyframes neon-flow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.stats-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
}

/* Holographic Effect */
.stats-card::after {
    display: none; /* Temporarily disabled to fix click issues */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity var(--animation-speed);
}

.stats-card:hover::after {
    opacity: 1;
    animation: holographic-sweep 2s infinite;
}

@keyframes holographic-sweep {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.stats-card.stats-primary::before {
    background: var(--primary-gradient);
}

.stats-card.stats-success::before {
    background: var(--success-gradient);
}

.stats-card.stats-warning::before {
    background: var(--warning-gradient);
}

.stats-card.stats-danger::before {
    background: var(--danger-gradient);
}

.stats-card.stats-info::before {
    background: var(--accent-gradient);
}

/* Chart canvases — fixed wrapper prevents resize loop / height growth */
.chart-fixed-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.trend-card .card-body {
    position: relative;
}

.trend-card .card-body .chart-fixed-wrap {
    margin-bottom: 0.5rem;
}

.trend-card .card-body canvas,
.chart-fixed-wrap canvas {
    display: block !important;
    width: 100% !important;
    height: 280px !important;
    max-height: 280px !important;
    animation: none !important;
    transition: none !important;
}

.trend-card {
    transition: box-shadow 0.3s ease;
}

.trend-card:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    color: var(--white);
    margin-bottom: var(--spacing-4);
}

.stats-primary .stats-icon {
    background: var(--primary-gradient);
}

.stats-success .stats-icon {
    background: var(--success-gradient);
}

.stats-warning .stats-icon {
    background: var(--warning-gradient);
}

.stats-danger .stats-icon {
    background: var(--danger-gradient);
}

.stats-info .stats-icon {
    background: var(--accent-gradient);
}

.stats-number {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--spacing-1);
}

.stats-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
}

.stats-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-1);
    margin-top: var(--spacing-2);
    font-size: var(--font-size-sm);
}

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

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

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3) var(--spacing-6);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: var(--spacing-2);
}

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

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

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-outline i,
.btn-outline span {
    transition: all 0.3s ease;
}

/* Shimmer Effect for Quick Actions */
.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-outline:hover::before {
    left: 100%;
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--neon-blue));
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(45, 27, 105, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.btn-outline:hover span {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}



/* Timeline (Activities) */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 0;
    bottom: -8px;
    width: 2px;
    background: #E5E7EB;
}

.timeline-dot {
    position: absolute;
    right: -1px;
    top: 2px;
    width: 10px;
    height: 10px;
    background: #6F42C1;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(111,66,193,0.15);
}

.timeline-content {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* Tabs polish */
.nav-tabs .nav-link { color: #6B7280; }
.nav-tabs .nav-link.active { color: #111827; font-weight: 600; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

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

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

.badge.bg-info {
    background: var(--info-color);
    color: var(--white);
}

/* Forms */
.form-control {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    transition: all 0.2s ease;
    background: var(--white);
}

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

.form-label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-weight: 500;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

/* سلکت‌های sm: هم‌ارتفاع با اینپوت‌های تولبار فیلتر و دکمه‌های هم‌ردیف */
.form-select.form-select-sm {
    height: 42px;
    min-height: 42px;
}

/* Generic filter toolbar: one source of truth for control height */
.filter-toolbar .form-control,
.filter-toolbar .form-control.form-control-sm,
.filter-toolbar .form-select,
.filter-toolbar .form-select.form-select-sm,
.filter-toolbar .input-group.input-group-sm .input-group-text,
.filter-toolbar .btn.btn-sm {
    height: 42px;
    min-height: 42px;
}

.filter-toolbar .form-label {
    font-weight: 500;
}

/* Generic inline filter layout for desktop */
@media (min-width: 992px) {
    .filter-toolbar-inline-lg .row {
        flex-wrap: nowrap;
    }

    .filter-toolbar-inline-lg .filter-col {
        width: auto;
        flex: 0 0 auto;
    }

    .filter-toolbar-inline-lg .filter-col-grow {
        flex: 1 1 30%;
        min-width: 280px;
    }

    .filter-toolbar-inline-lg .filter-col-fixed {
        flex: 0 0 14%;
        min-width: 150px;
    }

    .courses-filter-toolbar .row {
        flex-wrap: nowrap;
    }

    .courses-filter-toolbar .filter-col-grow {
        flex: 1 1 200px;
        min-width: 160px;
        max-width: none;
    }

    .courses-filter-toolbar .filter-col-narrow {
        flex: 0 0 10%;
        min-width: 110px;
        max-width: 130px;
    }

    .courses-filter-toolbar .filter-col-medium {
        flex: 0 0 14%;
        min-width: 150px;
        max-width: 180px;
    }

    .courses-filter-toolbar .filter-col-actions {
        flex: 0 0 auto;
        margin-inline-start: auto;
        white-space: nowrap;
    }

    .classes-filter-toolbar .classes-filter-grid-row {
        display: grid;
        grid-template-columns:
            minmax(140px, 2fr)
            minmax(100px, 0.9fr)
            minmax(120px, 1fr)
            minmax(120px, 1fr)
            minmax(108px, 0.85fr)
            minmax(108px, 0.85fr)
            auto;
        column-gap: 0.5rem;
        align-items: end;
        margin-inline: 0;
        flex-wrap: nowrap;
    }

    .classes-filter-toolbar .classes-filter-grid-row > [class*="col-"] {
        width: 100%;
        max-width: none;
        flex: none;
        padding-inline: 0;
    }

    .classes-filter-toolbar .filter-col-grow,
    .classes-filter-toolbar .filter-col-narrow,
    .classes-filter-toolbar .filter-col-medium,
    .classes-filter-toolbar .filter-col-date,
    .classes-filter-toolbar .filter-col-actions {
        min-width: 0;
        max-width: none;
    }

    .classes-filter-toolbar .filter-col-actions {
        white-space: nowrap;
        min-width: max-content;
    }

    .classes-filter-toolbar .learners-filter-actions {
        width: 100%;
        margin-inline-start: 0;
    }

    .classes-filter-toolbar .form-control,
    .classes-filter-toolbar .form-select,
    .classes-filter-toolbar .input-group {
        width: 100%;
        min-width: 0;
    }

    .classes-filter-toolbar .form-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Learners list — multi-row filter toolbar */
.learners-filter-toolbar {
    width: 100%;
}

.learners-filter-toolbar .form-label {
    font-size: var(--font-size-xs);
    font-weight: 400;
    margin-bottom: 0.2rem;
}

.learners-filter-toolbar .learners-filter-row + .learners-filter-row {
    margin-top: 0.35rem;
}

.learners-filter-toolbar .learners-filter-row-advanced {
    margin-top: 0.5rem;
    padding-top: 0.5rem !important;
}

.learners-filter-toolbar .learners-more-filters-btn {
    min-height: auto;
    display: inline-flex;
    align-items: center;
}

.learners-filter-toolbar .learners-filter-actions-col {
    margin-inline-start: auto;
}

.learners-filter-toolbar .learners-filter-actions {
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.35rem;
}

.learners-filter-toolbar .learners-filter-actions .btn {
    font-size: 0.78rem;
    padding: 0.22rem 0.5rem;
    line-height: 1.35;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .learners-filter-toolbar .learners-filter-actions {
        width: auto;
        justify-content: flex-end;
    }
}

.learners-list-card-header .learners-filter-toolbar {
    overflow: visible;
}

#learnersListContent.is-loading,
#coursesListContent.is-loading,
#requestsListContent.is-loading,
#classesListContent.is-loading,
#enrollmentLearnersContent.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(100%) !important; /* در موبایل به صورت پیش‌فرض بسته است */
        width: var(--sidebar-width);
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0) !important; /* در موبایل فقط وقتی active است نمایش داده می‌شود */
    }
    
    .main-container {
        margin-right: 0;
    }
}

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

    .navbar-search.is-open {
        display: flex !important;
    }
    
    .dashboard-content {
        padding: var(--spacing-4);
    }
    
    .stats-card {
        margin-bottom: var(--spacing-4);
    }
    
    .main-footer {
        padding: var(--spacing-3) 0;
        height: auto;
        min-height: var(--footer-height);
        position: sticky !important;
        bottom: 0;
    }
    
    .main-footer p {
        font-size: var(--font-size-xs);
        text-align: center;
        line-height: 1.4;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-2);
    }
    
    .footer-item {
        font-size: var(--font-size-xs);
    }
    
    .footer-separator {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Smart Footer */
.main-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: var(--spacing-4) 0;
    min-height: var(--footer-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: var(--theme-transition);
    animation: footerSlideIn 0.5s ease-out;
}

@keyframes footerSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Smart Footer Logic */
.main-wrapper {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    flex: 1;
    padding: var(--content-padding);
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
}

/* When content is short, footer stays at bottom */
.main-wrapper:has(.dashboard-content:not(:has(*))) .main-footer,
.main-wrapper:has(.dashboard-content:empty) .main-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* When content is long, footer becomes sticky */
.main-wrapper:has(.dashboard-content:has(*)) .main-footer {
    position: sticky;
    bottom: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-3);
    text-align: center;
}

.footer-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: var(--theme-transition);
}

.footer-item:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.footer-item i {
    color: var(--primary-color);
    font-size: var(--font-size-base);
    margin-left: var(--spacing-2);
}

.footer-separator {
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    font-weight: 300;
    margin: 0 var(--spacing-1);
}

.main-footer p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    font-family: var(--font-family-primary);
}

.main-footer .text-danger {
    color: var(--danger-color) !important;
}

.main-footer i {
    font-size: var(--font-size-sm);
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

/* IRANSans Font Weight Utilities */
.font-light {
    font-weight: 300 !important;
}

.font-normal {
    font-weight: normal !important;
}

.font-medium {
    font-weight: 500 !important;
}

.font-bold {
    font-weight: bold !important;
}

.font-black {
    font-weight: 900 !important;
}

.font-ultralight {
    font-weight: 200 !important;
}

/* Typography Enhancements for IRANSans */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: bold;
}

.navbar-brand {
    font-family: var(--font-family-primary);
    font-weight: bold;
}

.card-title {
    font-family: var(--font-family-primary);
    font-weight: bold;
}

.stats-number {
    font-family: var(--font-family-primary);
    font-weight: bold;
}

.btn {
    font-family: var(--font-family-primary);
    font-weight: 500;
}

.sidebar-menu a {
    font-family: var(--font-family-primary);
    font-weight: 500;
}

.sidebar-menu a.active {
    font-family: var(--font-family-primary);
    font-weight: bold;
}

/* Table typography moved to responsive-tables.css */

.badge {
    font-family: var(--font-family-primary);
    font-weight: 500;
}

/* Font Loading Optimization */
.font-loading {
    font-display: swap;
}

/* Theme Toggle - Cyberpunk Style */

/* Interactive surfaces — حرکت ملایم، بدون scale تهاجمی */
.card,
.stats-card {
    transition: box-shadow var(--animation-speed) var(--animation-smooth), border-color var(--animation-speed) ease;
}

.btn {
    transition: background-color var(--animation-speed) ease, border-color var(--animation-speed) ease, color var(--animation-speed) ease, box-shadow var(--animation-speed) ease;
}

/* Page Header Styles */
.page-header {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: none;
    border: 1px solid var(--border-primary);
    position: relative;
    overflow: visible;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* Dark mode fixes for page header */
[data-theme="dark"] .page-header,
.dark .page-header,
body.dark .page-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .page-title,
.dark .page-title,
body.dark .page-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .page-subtitle,
.dark .page-subtitle,
body.dark .page-subtitle {
    color: #cbd5e1 !important;
}

/* General dark mode text fix for page header */
.page-header .page-title {
    color: var(--text-primary);
}

.page-header .page-subtitle {
    color: var(--text-secondary);
}

/* Force white text in dark backgrounds */
.page-header {
    color: #704b94;
}

.page-header .page-title {
    color: #9333ea !important;
}

.page-header .page-subtitle {
    color: #cdc0d3 !important;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.page-actions .btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Table actions moved to responsive-tables.css */

/* Pagination Styles */
/* Pagination styles kept generic; table-specific moved to responsive-tables.css */

.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: var(--gray-100);
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* Reusable table helpers for list pages */
.table-min-width-1200 {
    min-width: 1200px;
}

.table-sticky-edges {
    margin-bottom: 0;
}

.table-sticky-edges th,
.table-sticky-edges td {
    white-space: nowrap;
    vertical-align: middle;
}

.table-sticky-edges th:first-child,
.table-sticky-edges td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

.table-sticky-edges td:first-child {
    background-color: #fff;
}

.table-sticky-edges th:last-child,
.table-sticky-edges td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
}

.table-sticky-edges td:last-child {
    background-color: #fff;
}

/* Particle System - Temporarily Disabled */
.particle {
    display: none; /* Temporarily disabled to fix click issues */
    position: fixed;
    width: 2px;
    height: 2px;
    background: #1e3a8a;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: particle-float 3s infinite;
}

@keyframes particle-float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
} 
/* ---- Round 2: sidebar IA density, filter, mobile close ---- */
.sidebar-header {
    gap: 0.5rem;
}

.sidebar-close-btn {
    display: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    align-items: center;
    justify-content: center;
}

.sidebar-filter {
    padding: 0.65rem 0.85rem 0.35rem;
}

.sidebar-filter input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.875rem;
    background: #f8fafc;
}

.sidebar-menu > li > a {
    padding: 0.55rem 0.9rem;
}

.sidebar-menu .submenu a {
    padding: 0.4rem 0.9rem 0.4rem 0.5rem;
    font-size: 0.875rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 998;
}

.sidebar-backdrop.show {
    display: block;
}

@media (max-width: 1024px) {
    .sidebar-close-btn {
        display: inline-flex;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 359.98px) {
    .dashboard-sidebar {
        width: min(280px, 100vw) !important;
    }
}
