.salary-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
        .salary-side { min-width:0; display:flex; flex-direction:column; gap:20px; }
        #salary-total-summary { margin:0; }
        #salary-info-card, .salary-history-card { padding:20px; min-width:0; }
        .salary-history-filters { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
        .salary-history-filters .form-control { width:auto; max-width:100%; }
        .salary-history-row { padding:14px 0; border-bottom:1px solid var(--border-color); display:grid; gap:6px; }
        @media(max-width:850px) { .salary-layout { grid-template-columns:1fr; } }
        @media(prefers-reduced-motion:reduce) { #page-salary .soft-blink { animation:none; outline:2px solid var(--warning); } }

        :root {
            --bg-color: #eef5fc;
            --card-color: #ffffff;
            --primary-color: #3b82f6;
            --primary-light: #eff6ff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border-color: #e2eafd;
            --border-radius: 16px;
            --shadow-sm: 0 4px 6px -1px rgba(59, 130, 246, 0.05);
            --shadow-md: 0 10px 15px -3px rgba(59, 130, 246, 0.08);
            --shadow-lg: 0 20px 25px -5px rgba(59, 130, 246, 0.1);
            --success: #10b981;
            --success-light: #ecfdf5;
            --danger: #ef4444;
            --danger-light: #fef2f2;
            --warning: #f59e0b;
            --warning-light: #fefbeb;
            --daily-indigo: #6366f1;
            --daily-indigo-light: #eef2ff;
            --daily-purple: #8b5cf6;
            --sidebar-bg: rgba(255, 255, 255, 0.85);
        }

        body.dark {
            --bg-color: #0f172a;
            --card-color: #1e293b;
            --primary-light: #1e3a5f;
            --text-main: #f1f5f9;
            --text-muted: #94a3b8;
            --border-color: #334155;
            --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            --success-light: #064e3b;
            --danger-light: #450a0a;
            --warning-light: #451a03;
            --daily-indigo-light: #312e81;
            --sidebar-bg: rgba(30, 41, 59, 0.92);
        }

        body.dark .sidebar {
            background: var(--sidebar-bg);
            border-color: var(--border-color);
        }

        body.dark .financial-summary {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        }

        body.dark .auth-container,
        body.dark .modal-container {
            background-color: var(--card-color);
            color: var(--text-main);
        }

        body.dark .category-card,
        body.dark .filter-btn,
        body.dark .form-control {
            background-color: #0f172a;
            color: var(--text-main);
        }

        body.dark .salary-due-banner {
            background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        }

        body.dark .nav-item .tooltip {
            background-color: #020617;
            color: #f8fafc;
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35);
        }

        .pwa-install-banner {
            position: fixed;
            left: 20px;
            bottom: 20px;
            z-index: 9999;
            display: none;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 14px;
            background: linear-gradient(135deg, var(--primary-color), #7c3aed);
            color: #fff;
            box-shadow: var(--shadow-lg);
            max-width: min(320px, calc(100vw - 24px));
        }

        .pwa-install-banner.show {
            display: flex;
        }

        .pwa-install-banner button {
            border: none;
            background: #fff;
            color: var(--primary-color);
            border-radius: 999px;
            padding: 8px 12px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap;
        }

        .pwa-install-banner button:hover {
            opacity: 0.95;
        }

        body.dark .note-card {
            background-color: #0f172a !important;
            color: #f8fafc;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
        }

        body.dark .note-title,
        body.dark .note-content,
        body.dark .note-card .card-actions,
        body.dark .note-card .action-icon {
            color: #f8fafc;
        }

        body.dark .note-card .action-icon {
            background-color: rgba(255, 255, 255, 0.12);
        }

        body.dark .form-control,
        body.dark textarea.form-control,
        body.dark input.form-control {
            background-color: #0f172a;
            color: #f8fafc;
        }

        body.dark .form-control::placeholder,
        body.dark textarea.form-control::placeholder {
            color: #94a3b8;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Vazirmatn', sans-serif;
            transition: background-color 0.2s, border-color 0.2s;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            overflow-x: hidden;
        }

        /* استایل سایدبار مدرن و شیشه‌ای در سمت راست */
        .sidebar {
            position: fixed;
            top: 20px;
            right: 20px;
            bottom: 20px;
            width: 76px;
            background: var(--sidebar-bg, rgba(255, 255, 255, 0.85));
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 24px;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 30px 0;
            box-shadow: var(--shadow-md);
            z-index: 100;
        }

        .logo-container {
            margin-bottom: 32px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 0 8px;
            text-align: center;
        }

        .logo-container .dayer-logo-svg {
            width: 42px;
            height: 42px;
            display: block;
            flex-shrink: 0;
        }

        .logo-wordmark {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            line-height: 1.1;
        }

        .logo-wordmark-title {
            font-size: 13px;
            font-weight: 800;
            letter-spacing: -0.03em;
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #7c3aed 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .logo-wordmark-sub {
            font-size: 9px;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.14em;
            text-transform: uppercase;
        }

        .auth-brand {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            margin-bottom: 24px;
        }

        .auth-brand .dayer-logo-svg {
            width: 52px;
            height: 52px;
        }

        .auth-brand-title {
            font-size: 20px;
            font-weight: 800;
            margin: 0;
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #7c3aed 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .auth-brand-sub {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.12em;
            text-transform: uppercase;
            margin-top: -4px;
        }

        .nav-menu {
            display: flex;
            flex-direction: column;
            gap: 20px;
            flex-grow: 1;
            width: 100%;
            align-items: center;
        }

        .nav-item {
            position: relative;
            width: 48px;
            height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-muted);
            border: none;
            background: transparent;
            outline: none;
        }

        .nav-item:hover {
            background-color: rgba(59, 130, 246, 0.08);
            color: var(--primary-color);
        }

        .nav-item.active {
            background-color: var(--primary-color);
            color: white;
            box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
        }

        /* نمایش عنوان با هاور روی سایدبار */
        .nav-item .tooltip {
            position: absolute;
            right: 85px;
            background-color: var(--text-main);
            color: white;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 12px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s, transform 0.2s;
            transform: translateX(10px);
        }

        .nav-item:hover .tooltip {
            opacity: 1;
            transform: translateX(0);
        }

        /* محتوای اصلی */
        .main-content {
            margin-right: 116px;
            padding: 30px;
            width: calc(100% - 116px);
            min-height: 100vh;
        }

        /* انیمیشن محو شدن و ظاهر شدن صفحات */
        .page {
            display: none;
            animation: fadeIn 0.4s ease-in-out forwards;
        }

        .page.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* هدر صفحات */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            flex-wrap: wrap;
            gap: 16px;
        }

        /* نوار بالای اپ — چپ بالا در RTL */
        .app-topbar {
            display: none;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
            padding: 0 0 20px;
            margin-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }

        body.logged-in .app-topbar {
            display: flex;
        }

        .topbar-btn {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--card-color);
            color: var(--text-muted);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s, color 0.2s;
        }

        .topbar-btn:hover {
            background: var(--primary-light);
            color: var(--primary-color);
        }

        .profile-dropdown-wrap {
            position: relative;
        }

        .profile-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            min-width: 200px;
            background: var(--card-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            padding: 8px;
            z-index: 200;
            display: none;
        }

        .profile-menu.open { display: block; }

        .profile-menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border: none;
            background: transparent;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            font-size: 13px;
            color: var(--text-main);
            text-align: right;
        }

        .profile-menu-item:hover {
            background: var(--primary-light);
            color: var(--primary-color);
        }

        .profile-menu-item.logout-item {
            margin-top: 4px;
            border-top: 1px solid var(--border-color);
            padding-top: 12px;
            color: var(--danger);
        }

        .profile-menu-item.logout-item:hover {
            background: var(--danger-light);
            color: var(--danger);
        }

        .profile-menu-header {
            padding: 8px 12px 12px;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 4px;
        }

        .profile-menu-header strong {
            display: block;
            font-size: 14px;
        }

        .profile-menu-header small {
            color: var(--text-muted);
            font-size: 12px;
        }

        .page-title h1 {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-main);
        }

        .page-title p {
            font-size: 14px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* دکمه‌های پرمیوم */
        .btn {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
            outline: none;
        }

        .btn:hover {
            opacity: 0.9;
        }

        .btn-secondary {
            background-color: transparent;
            color: var(--primary-color);
            border: 2px solid var(--primary-color);
            box-shadow: none;
        }

        .btn-danger {
            background-color: var(--danger);
            box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
        }

        /* ساختار شبکه کاشی‌طور (Grid layout) */
        .tile-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 24px;
        }

        .card {
            background-color: var(--card-color);
            border-radius: var(--border-radius);
            padding: 24px;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .card:hover {
            box-shadow: var(--shadow-md);
        }

        .users-management-grid {
            display: grid;
            grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
            gap: 24px;
            align-items: start;
            margin-bottom: 24px;
        }

        .users-list-scroll {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 520px;
            overflow-y: auto;
            padding-right: 6px;
        }

        .d-flex { display: flex; }
        .align-items-center { align-items: center; }
        .justify-content-between { justify-content: space-between; }

        .users-list-header {
            margin-bottom: 16px;
        }

        .users-list-header h3 {
            margin-bottom: 0;
            font-size: 16px;
        }

        .users-list-pagination {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 10px;
            margin-top: 0;
            flex-wrap: wrap;
        }

        .users-list-pagination button {
            border: 1px solid var(--border-color);
            background: var(--card-color);
            color: var(--text-main);
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 12px;
            cursor: pointer;
        }

        .users-list-pagination button:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        @media (max-width: 1024px) {
            .users-management-grid {
                grid-template-columns: 1fr;
            }
        }

        /* بخش امور مالی و دارایی‌ها */
        .financial-summary {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            border: 1px solid rgba(59, 130, 246, 0.1);
            border-radius: var(--border-radius);
            padding: 24px;
            margin-top: 30px;
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
            gap: 20px;
        }

        .summary-item {
            text-align: center;
        }

        .summary-item label {
            display: block;
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }

        .summary-item span {
            font-size: 20px;
            font-weight: 700;
            color: var(--primary-color);
        }

        /* استایل یادداشت‌ها */
        .note-card {
            min-height: 200px;
        }

        .note-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .note-content {
            font-size: 14px;
            color: var(--text-main);
            white-space: pre-wrap;
            flex-grow: 1;
            line-height: 1.6;
        }

        .card-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 15px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            padding-top: 12px;
        }

        .action-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: none;
            background-color: var(--primary-light);
            color: var(--primary-color);
        }

        .action-icon.delete {
            background-color: var(--danger-light);
            color: var(--danger);
        }

        /* تسک‌ها */
        .task-card {
            border-right: 4px solid var(--primary-color);
        }

        .task-card.completed {
            border-right-color: var(--success);
            background-color: #fafbfc;
        }

        .task-title {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .task-card.completed .task-title {
            text-decoration: line-through;
            color: var(--text-muted);
        }

        .task-meta {
            font-size: 12px;
            color: var(--text-muted);
            display: flex;
            gap: 15px;
            margin-top: 10px;
        }

        .badge {
            background-color: var(--primary-light);
            color: var(--primary-color);
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 600;
        }

        /* دسته‌بندی تسک‌ها */
        .category-badge-pill {
            background-color: var(--primary-color);
            color: white;
            border-radius: 999px;
            padding: 2px 8px;
            font-size: 12px;
            margin-right: auto;
        }

        .category-card {
            border: 1px solid var(--border-color);
            padding: 20px;
            border-radius: var(--border-radius);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
        }

        /* انیمیشن چشمک‌زن نرم برای موارد فوری */
        @keyframes soft-blink {
            0%, 100% { background-color: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.25); }
            50% { background-color: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.55); }
        }

        .soft-blink {
            animation: soft-blink 2.2s infinite ease-in-out;
            border: 1px solid rgba(245, 158, 11, 0.3) !important;
        }

        .dashboard-card-urgent {
            animation: soft-blink 2.2s infinite ease-in-out;
            border: 1px solid rgba(245, 158, 11, 0.35) !important;
        }

        /* سازگاری با اقساط — از همان انیمیشن نرم استفاده می‌شود */
        .installment-urgent {
            animation: soft-blink 2.2s infinite ease-in-out;
            border: 1px solid rgba(245, 158, 11, 0.35) !important;
        }

        .daily-task-badge {
            background-color: var(--daily-indigo-light);
            color: var(--daily-indigo);
        }

        .task-card.daily-task {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.07) 100%) !important;
            border-right: 4px solid var(--daily-indigo) !important;
            box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
        }

        body.dark .task-card.daily-task {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%) !important;
        }

        .priority-high { background: var(--danger-light); color: var(--danger); }
        .priority-medium { background: var(--warning-light); color: var(--warning); }
        .priority-low { background: #f1f5f9; color: var(--text-muted); }
        body.dark .priority-low { background: #334155; color: #cbd5e1; }

        .view-toggle { display: flex; gap: 4px; background: var(--border-color); padding: 4px; border-radius: 12px; }
        .view-toggle-btn {
            padding: 8px 14px; border: none; border-radius: 8px; cursor: pointer;
            font-size: 13px; font-weight: 600; background: transparent; color: var(--text-muted);
        }
        .view-toggle-btn.active { background: var(--card-color); color: var(--primary-color); box-shadow: var(--shadow-sm); }

        .kanban-board {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-top: 10px;
        }
        .kanban-column {
            background: var(--card-color);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 16px;
            min-height: 320px;
        }
        .kanban-column-header {
            font-weight: 700; font-size: 14px; margin-bottom: 14px;
            padding-bottom: 10px; border-bottom: 2px solid var(--border-color);
        }
        .kanban-column.todo .kanban-column-header { color: var(--primary-color); border-color: var(--primary-color); }
        .kanban-column.in_progress .kanban-column-header { color: var(--warning); border-color: var(--warning); }
        .kanban-column.done .kanban-column-header { color: var(--success); border-color: var(--success); }
        .kanban-item {
            background: var(--bg-color);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 10px;
            font-size: 13px;
            cursor: grab;
        }
        .kanban-item.daily-task { border-right: 3px solid var(--daily-indigo); background: var(--daily-indigo-light); }
        .kanban-item.kanban-dragging { opacity: 0.7; }
        .kanban-item.kanban-ghost { opacity: 0.4; }
        .kanban-column-list {
            min-height: 180px;
            display: flex;
            flex-direction: column;
        }
        body.dark .kanban-item { background: #0f172a; }

        .dark-mode-toggle {
            width: 48px; height: 48px; border-radius: 14px; border: none; cursor: pointer;
            background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center;
        }
        .dark-mode-toggle:hover { background: rgba(59, 130, 246, 0.08); color: var(--primary-color); }

        .asset-distribution {
            background: var(--card-color);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 24px;
            margin-top: 24px;
        }
        .donut-chart {
            width: 160px; height: 160px; border-radius: 50%;
            margin: 0 auto 20px;
            position: relative;
        }
        .donut-hole {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            width: 90px; height: 90px; border-radius: 50%; background: var(--card-color);
            display: flex; align-items: center; justify-content: center; font-size: 12px;
            font-weight: 700; color: var(--text-muted); text-align: center;
        }
        .distribution-legend { display: flex; flex-direction: column; gap: 8px; }
        .legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
        .legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

        .balance-history-table {
            width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 16px;
        }
        .balance-history-table th,
        .balance-history-table td {
            padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border-color);
        }
        .balance-history-table th { color: var(--text-muted); font-weight: 600; }

        .salary-dash-check {
            width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--success);
            background: white; color: var(--success); cursor: pointer; font-size: 18px;
            display: inline-flex; align-items: center; justify-content: center;
            animation: soft-blink 2.2s infinite ease-in-out;
        }

        .nav-item.admin-only { display: none; }
        body.is-woxman .nav-item.admin-only { display: flex; }

        .tile-grid .card.admin-only { display: none; }
        body.is-woxman .tile-grid .card.admin-only { display: flex; }

        @media print {
            .sidebar, .app-topbar, .page-header .btn, .filter-bar, .card-actions, .view-toggle,
            #auth-modal, .nav-item, .kanban-item select { display: none !important; }
            body { background: white; color: black; }
            .main-content { margin: 0; width: 100%; padding: 20px; }
            .page { display: block !important; }
            #print-tasks-area { display: block !important; }
            .card, .task-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
        }

        #print-tasks-area { display: none; }

        @media (max-width: 768px) {
            .kanban-board { grid-template-columns: 1fr; }
        }

        .salary-due-banner {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border: 2px solid var(--warning);
            border-radius: var(--border-radius);
            padding: 20px 24px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 16px;
        }

        .salary-check-btn {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 3px solid var(--success);
            background: white;
            color: var(--success);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            transition: transform 0.2s, background-color 0.2s;
            flex-shrink: 0;
        }

        .salary-check-btn:hover {
            background-color: var(--success-light);
            transform: scale(1.08);
        }

        .salary-check-btn.paid {
            border-color: var(--success);
            background-color: var(--success);
            color: white;
            cursor: default;
        }

        /* مودال‌های لایت‌باکسی */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(30, 41, 59, 0.6);
            backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
            padding: 16px;
        }

        .modal-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-container {
            background-color: white;
            border-radius: 20px;
            width: 100%;
            max-width: 480px;
            /* allow modal to scroll on small viewports so buttons remain visible */
            max-height: calc(100vh - 40px);
            padding: 20px;
            box-shadow: var(--shadow-lg);
            transform: scale(0.9);
            transition: transform 0.3s ease;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .modal-overlay.active .modal-container {
            transform: scale(1);
        }

        .modal-dialog {
            width: 100%;
            max-width: 480px;
            margin: 0 auto;
        }

        .modal-dialog.modal-lg {
            max-width: 800px;
        }

        .modal-dialog.modal-lg .modal-container {
            max-width: none;
            width: 100%;
        }

        @media (min-width: 992px) {
            .modal-dialog.modal-lg {
                max-width: 800px;
            }
        }

        @media (max-width: 480px) {
            .modal-container {
                border-radius: 12px;
                padding: 16px;
                max-height: calc(100vh - 24px);
            }
        }

        .row {
            display: flex;
            flex-wrap: wrap;
            margin-right: -12px;
            margin-left: -12px;
        }

        .col-12,
        .col-md-6 {
            position: relative;
            width: 100%;
            padding-right: 12px;
            padding-left: 12px;
        }

        .mb-3 {
            margin-bottom: 1rem;
        }

        @media (min-width: 768px) {
            .col-md-6 {
                flex: 0 0 50%;
                max-width: 50%;
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 700;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: var(--text-muted);
        }

        /* فرم‌ها */
        .form-group {
            margin-bottom: 12px;
        }

        .form-group label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 6px;
        }

        .form-control {
            width: 100%;
            padding: 12px 14px;
            border: 2px solid var(--border-color);
            border-radius: 12px;
            font-family: inherit;
            outline: none;
            font-size: 14px;
        }

        .form-control:focus {
            border-color: var(--primary-color);
        }

        /* انتخاب رنگ یادداشت */
        .color-picker {
            display: flex;
            gap: 10px;
            margin-top: 8px;
        }

        .color-option {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid transparent;
        }

        .color-option.selected {
            border-color: var(--text-main);
        }

        /* مودال لاگین قفل‌کننده داشبورد */
        #auth-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-color);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 12px;
            overflow: hidden;
        }

        .auth-modal-header {
            position: absolute;
            top: 15px;
            left: 15px;
            right: auto;
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .auth-modal-header button {
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: background-color 0.2s;
        }

        .auth-modal-header button:hover {
            background-color: var(--primary-light);
        }

        .auth-container {
            position: relative;
            background-color: white;
            padding: 24px 20px;
            border-radius: 24px;
            box-shadow: var(--shadow-lg);
            width: 100%;
            max-width: 400px;
            max-height: calc(100vh - 24px);
            overflow: hidden;
        }

        .auth-tabs {
            display: flex;
            border-bottom: 2px solid var(--border-color);
            margin-bottom: 16px;
        }

        .auth-tab {
            flex: 1;
            text-align: center;
            padding: 10px;
            cursor: pointer;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 14px;
        }

        .auth-tab.active {
            color: var(--primary-color);
            border-bottom: 2px solid var(--primary-color);
        }

        .hidden {
            display: none !important;
        }

        /* ساختار فیلترهای بالا صفحات */
        .filter-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .filter-btn {
            background-color: white;
            border: 1px solid var(--border-color);
            padding: 8px 16px;
            border-radius: 10px;
            font-size: 13px;
            cursor: pointer;
        }

        .filter-btn.active {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .filter-btn.has-expiry-alert {
            border-color: var(--danger);
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
        }

        .client-section-tabs {
            display: inline-flex;
            gap: 6px;
            padding: 5px;
            margin: -8px 0 24px;
            background: var(--border-color);
            border-radius: 12px;
        }

        .client-section-tab {
            border: 0;
            border-radius: 9px;
            padding: 10px 18px;
            background: transparent;
            color: var(--text-muted);
            font-family: inherit;
            font-weight: 700;
            cursor: pointer;
        }

        .client-section-tab.active {
            background: var(--card-color);
            color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

        .client-info-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 22px;
        }

        .client-info-header h2 { font-size: 20px; margin-bottom: 5px; }
        .client-info-header p { color: var(--text-muted); font-size: 13px; }

        .client-info-card {
            position: relative;
            border-top: 4px solid var(--primary-color);
        }

        .client-info-card.expiring { border-top-color: var(--warning); }
        .client-info-card.expired { border-top-color: var(--danger); }

        .client-info-type {
            display: inline-flex;
            padding: 4px 9px;
            border-radius: 999px;
            background: var(--primary-light);
            color: var(--primary-color);
            font-size: 11px;
            font-weight: 700;
        }

        .client-expiry-status {
            margin-top: 14px;
            padding: 10px 12px;
            border-radius: 10px;
            background: var(--primary-light);
            font-size: 13px;
        }

        .client-expiry-status.warning { background: var(--warning-light); color: #b45309; }
        .client-expiry-status.danger { background: var(--danger-light); color: var(--danger); }

        .date-select-row { display: flex; gap: 8px; }

        /* طراحی ریسپانسیو */
        @media (max-width: 768px) {
            .client-info-header { align-items: stretch; flex-direction: column; }
            .client-section-tabs { display: flex; width: 100%; }
            .client-section-tab { flex: 1; padding: 10px 8px; }
            .date-select-row { flex-direction: column; }
            .sidebar {
                top: auto;
                right: 0;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 60px;
                flex-direction: row;
                justify-content: space-around;
                padding: 0;
                border-radius: 0;
                border-top: 1px solid var(--border-color);
            }
            .logo-container {
                display: none;
            }
            .nav-menu {
                flex-direction: row;
                justify-content: space-around;
                align-items: center;
            }
            .main-content {
                margin-right: 0;
                padding: 15px;
                padding-bottom: 80px;
                width: 100%;
            }
            .nav-item .tooltip {
                display: none;
            }
        }
