/* ============================================================
   CITIZEN PROFILES - PART 1
   VARIABLES, RESET, BACKGROUND, LOADER, SCROLLBAR
   پشتیبانی کامل از لایت مود و دارک مود با کنتراست بالا
   ============================================================ */

/* ---------- لایت مود (پیش‌فرض) ---------- */
:root {
    /* رنگ‌های اصلی طلایی */
    --gold-base: #fbbf24;
    --gold-dark: #d97706;
    --gold-bright: #fde047;
    --gold-glow: rgba(251, 191, 36, 0.35);
    --gold-dim: rgba(251, 191, 36, 0.12);
    --gold-border: rgba(251, 191, 36, 0.4);
    
    /* رنگ‌های وضعیت */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --cyan: #06b6d4;
    
    /* پس‌زمینه و شیشه‌ای (لایت) */
    --bg-page: linear-gradient(145deg, #fef9f0 0%, #eef2ff 100%);
    --bg-glass: rgba(255, 255, 255, 0.78);
    --bg-glass-solid: rgba(255, 255, 255, 0.96);
    --bg-glass-light: rgba(255, 255, 255, 0.55);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    
    /* رنگ‌های متن (لایت) - کنتراست بالا */
    --text-primary: #0a0c15;
    --text-secondary: #1e293b;
    --text-muted: #334155;
    --text-dim: #475569;
    --text-light: #64748b;
    
    /* سایه‌ها (لایت) */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 0 12px var(--gold-glow);
    --shadow-gold-strong: 0 0 20px rgba(251, 191, 36, 0.5);
    
    /* افکت متن طلایی در لایت مود (سایه نرم برای خوانایی) */
    --gold-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    
    /* ابعاد و فاصله‌ها */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-2xl: 40px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    --header-height: 88px;
}

/* ---------- دارک مود ---------- */
body.dark-mode {
    /* رنگ‌های طلایی در دارک (کمی روشن‌تر) */
    --gold-base: #fbbf24;
    --gold-dark: #f59e0b;
    --gold-bright: #ffd966;
    --gold-glow: rgba(251, 191, 36, 0.5);
    --gold-dim: rgba(251, 191, 36, 0.18);
    --gold-border: rgba(251, 191, 36, 0.45);
    
    /* پس‌زمینه و شیشه‌ای (دارک) */
    --bg-page: linear-gradient(145deg, #0a0e27, #050814);
    --bg-glass: rgba(15, 21, 53, 0.85);
    --bg-glass-solid: rgba(10, 14, 30, 0.98);
    --bg-glass-light: rgba(15, 21, 53, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    
    /* رنگ‌های متن (دارک) - روشن و خوانا */
    --text-primary: #ffffff;
    --text-secondary: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-dim: #94a3b8;
    --text-light: #64748b;
    
    /* سایه‌ها (دارک) - عمیق‌تر */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 15px var(--gold-glow);
    --shadow-gold-strong: 0 0 25px rgba(251, 191, 36, 0.4);
    
    --gold-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- ریست و پایه ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-page);
    color: var(--text-secondary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.2s ease;
    direction: rtl;
    min-height: 100vh;
}

/* ---------- انیمیشن پس‌زمینه (نورهای شناور) ---------- */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.bg-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    animation: orbFloat 30s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

.layer-1 {
    width: 1000px;
    height: 1000px;
    top: -400px;
    right: -300px;
    background: radial-gradient(circle, var(--gold-glow), transparent 70%);
    animation-duration: 35s;
}

.layer-2 {
    width: 800px;
    height: 800px;
    bottom: -300px;
    left: -200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
    animation-duration: 40s;
    animation-direction: alternate-reverse;
}

@keyframes orbFloat {
    0% {
        opacity: 0.4;
        transform: translate(0, 0) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translate(80px, -60px) scale(1.1);
    }
    100% {
        opacity: 0.5;
        transform: translate(-40px, 50px) scale(0.95);
    }
}

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

body.dark-mode .grain-overlay {
    opacity: 0.015;
}

/* ---------- لودر سراسری ---------- */
#globalLoader {
    position: fixed;
    inset: 0;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

#globalLoader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-seal {
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
    animation: spinLoader 12s linear infinite;
}

.loader-seal svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px var(--gold-glow));
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

.loader-subtitle {
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--gold-base);
    text-align: center;
    margin-top: 1rem;
}

.loader-bar-wrap {
    width: 220px;
    height: 3px;
    background: var(--border-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 1rem auto 0;
}

.loader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-base), var(--gold-dark));
    border-radius: var(--radius-full);
    animation: loadFill 2s ease-out forwards;
}

@keyframes loadFill {
    to { width: 100%; }
}

/* ---------- اسکرول بار سفارشی ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-glass-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-base);
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

/* ---------- هایلایت متن (انتخاب) ---------- */
::selection {
    background: var(--gold-dim);
    color: var(--gold-dark);
}

/* ---------- کاهش حرکت برای کاربرانی که motion را ترجیح نمی‌دهند ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ============================================================
   CITIZEN PROFILES - PART 2
   PROFESSIONAL HEADER, THEME TOGGLE, MOBILE SIDEBAR, USER STATUS
   ============================================================ */

/* ---------- هدر اصلی (ثابت در بالا) ---------- */
.main-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1.5px solid var(--gold-border);
    z-index: 1000;
    transition: var(--transition);
}

.main-header.scrolled {
    height: 70px;
    background: var(--bg-glass-solid);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    gap: 1rem;
}

/* ---------- برند (لوگو + عنوان) ---------- */
.brand-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.brand-link:hover {
    transform: scale(1.02);
}

.brand-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #0f172a;
    box-shadow: 0 0 12px var(--gold-glow);
    transition: 0.2s;
}

.brand-icon i {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.brand-info {
    line-height: 1.2;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gold-base);
    letter-spacing: 1.5px;
    text-shadow: var(--gold-text-shadow);
}

/* ---------- ناوبری دسکتاپ ---------- */
.desktop-nav {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-nav {
        display: flex;
        flex: 1;
        justify-content: center;
    }
}

.nav-list {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
    border-radius: var(--radius-full);
}

.nav-link:hover {
    color: var(--gold-base);
    background: var(--gold-dim);
}

.nav-link.active {
    color: var(--gold-base);
    background: var(--gold-dim);
    box-shadow: 0 0 8px var(--gold-glow);
}

/* ---------- بخش راست هدر (وضعیت کاربر، دکمه‌ها) ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* اطلاعات کاربر */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--bg-glass-light);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.2s;
}

.user-info i {
    color: var(--gold-base);
    font-size: 1rem;
    text-shadow: var(--gold-text-shadow);
}

/* دکمه ورود */
.btn-login {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    border: none;
    border-radius: var(--radius-full);
    color: #0f172a;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.25s;
    box-shadow: 0 2px 6px var(--gold-glow);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--gold-glow);
}

/* دکمه خروج */
.btn-logout {
    padding: 0.4rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.25s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* دکمه همبرگر (موبایل) */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
}

@media (max-width: 1023px) {
    .burger-menu {
        display: flex;
    }
}

.burger-menu span {
    width: 28px;
    height: 3px;
    background: var(--text-secondary);
    border-radius: 3px;
    transition: 0.25s;
}

/* ---------- سایدبار موبایل ---------- */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -320px;
    width: 300px;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--gold-border);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.mobile-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    color: var(--gold-base);
    font-size: 1rem;
}

.close-sidebar {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--danger);
    transition: 0.2s;
}

.close-sidebar:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.m-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: 0.2s;
    font-weight: 500;
}

.m-link i {
    width: 24px;
    color: var(--gold-base);
}

.m-link:hover,
.m-link.active {
    background: var(--gold-dim);
    color: var(--gold-base);
    transform: translateX(-4px);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
}

.m-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.full-width {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* ---------- دکمه تغییر تم (دایره شناور پایین سمت چپ) ---------- */
.theme-toggle-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gold-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    color: var(--gold-base);
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-gold);
}

/* ---------- دکمه بازگشت به بالا ---------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gold-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    color: var(--gold-base);
    font-size: 1.2rem;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--gold-base);
    color: #0f172a;
    transform: translateY(-3px);
}

/* ---------- ریسپانسیو هدر ---------- */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    .header-inner {
        padding: 0 1rem;
    }
    .brand-sub {
        display: none;
    }
    .brand-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .brand-title {
        font-size: 0.9rem;
    }
    .user-info span:first-of-type {
        display: none;
    }
    .user-info {
        padding: 0.3rem 0.8rem;
    }
    .btn-login, .btn-logout {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    .theme-toggle-btn, .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        bottom: 16px;
    }
    .theme-toggle-btn {
        left: 16px;
    }
    .back-to-top {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .brand-info {
        display: none;
    }
    .brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
/* ============================================================
   CITIZEN PROFILES - PART 3
   TABS, MAIN CONTAINERS, CITIZENS LIST (CARDS, SEARCH, STATS, PAGINATION)
   با پشتیبانی کامل از لایت مود و رفع مشکلات کنتراست
   ============================================================ */

/* ---------- محتوای اصلی ---------- */
.page-main {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* ---------- نوار تب‌ها ---------- */
.tabs-container {
    position: sticky;
    top: var(--header-height);
    z-index: 199;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    margin-top: var(--header-height);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: all 0.25s;
}

.tab i {
    font-size: 1rem;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--gold-base);
}

.tab.active i {
    color: var(--gold-base);
    text-shadow: var(--gold-text-shadow);
}

/* انیمیشن محتوا */
.tab-content {
    display: none;
    animation: fadeUp 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- کانتینرهای شیشه‌ای (لیست، فرم، پروفایل) ---------- */
.list-container,
.form-container,
.profile-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.list-container:hover,
.form-container:hover {
    border-color: var(--gold-border);
    box-shadow: var(--shadow-md);
}

/* ---------- هدر بخش (آمار سریع) ---------- */
.list-header-advanced {
    margin-bottom: 2rem;
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.form-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--gold-dim);
    border: 1px solid var(--gold-border);
    color: var(--gold-base);
    transition: 0.2s;
}

.form-icon.list {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.header-title-section h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.header-title-section p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* ---------- کارت‌های آمار سریع ---------- */
.quick-stats {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-glass-solid);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 180px;
    transition: all 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- بخش جستجو ---------- */
.advanced-search-container {
    background: var(--bg-glass-solid);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.search-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-glass-light);
}

.search-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold-base);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-shadow: var(--gold-text-shadow);
}

.search-content {
    padding: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-base);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.search-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    background: var(--bg-glass-light);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--gold-base);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-input-wrapper input::placeholder {
    color: var(--text-light);
}

.clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.clear-search:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ---------- گرید کارت‌های شهروندان ---------- */
.citizens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.8rem;
    margin: 2rem 0;
}

/* کارت شهروند */
.citizen-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    overflow: hidden;
}

.citizen-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-base), #ff0505, var(--gold-base));
    opacity: 0;
    transition: opacity 0.3s;
}

.citizen-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-lg);
}

.citizen-card:hover::before {
    opacity: 1;
}

/* هدر کارت */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.citizen-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    color: var(--gold-base);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: 0.2s;
}

.citizen-code:hover {
    background: var(--gold-dim);
    transform: translateY(-1px);
}

.blacklist-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 0.2rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 700;
}

/* بدنه کارت */
.card-body .name {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.card-body .phone,
.card-body .steam {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* فوتر کارت (آمار) */
.card-footer {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-footer span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- صفحه‌بندی ---------- */
.pagination-advanced {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 42px;
    text-align: center;
    font-weight: 700;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gold-dim);
    border-color: var(--gold-border);
    color: var(--gold-base);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    border-color: var(--gold-base);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 0 10px var(--gold-glow);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--text-light);
    padding: 0 0.25rem;
}

/* ---------- حالت خالی (بدون داده) ---------- */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--gold-base);
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 992px) {
    .page-main {
        padding: 1rem;
    }
    .list-container,
    .form-container {
        padding: 1.5rem;
    }
    .quick-stats {
        flex-direction: column;
    }
    .stat-card {
        min-width: auto;
    }
    .citizens-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .tabs {
        padding: 0 1rem;
    }
    .tab {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }
    .header-title-section {
        flex-direction: column;
        text-align: center;
    }
    .form-icon {
        margin: 0 auto;
    }
    .search-input-wrapper input {
        font-size: 0.9rem;
        padding: 0.8rem 2.5rem;
    }
    .citizen-card {
        padding: 1.2rem;
    }
    .card-footer {
        font-size: 0.7rem;
    }
    .pagination-btn {
        padding: 0.3rem 0.7rem;
        min-width: 36px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 1.3rem;
    }
    .citizen-code {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    .card-body .name {
        font-size: 1rem;
    }
}

/* ============================================================
   CITIZEN PROFILES - PART 4
   PROFILE: HERO, STATS CARDS, COURT CASES TABLE, DOCUMENTS, RECORDS, BLINK BANNERS
   با پشتیبانی کامل از لایت مود و رفع مشکلات کنتراست
   ============================================================ */

/* ---------- کانتینر پروفایل ---------- */
.profile-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: 0;
    overflow: hidden;
    animation: fadeUp 0.4s var(--transition);
}

/* ---------- هدر پروفایل (Hero Section) ---------- */
.profile-hero {
    background: linear-gradient(135deg, var(--gold-dim), rgba(0, 0, 0, 0.3));
    padding: 2rem;
    border-bottom: 2px solid var(--gold-border);
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--gold-glow), transparent 70%);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
}

.profile-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* آواتار و عنوان */
.profile-avatar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.profile-avatar-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, var(--gold-base), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #0f172a;
    box-shadow: 0 10px 25px var(--shadow-gold);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s var(--transition);
}

.profile-avatar-icon:hover {
    transform: scale(1.03) rotate(3deg);
}

.profile-title h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.citizen-code-large {
    font-family: monospace;
    background: rgba(91, 91, 91, 1);
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    color: var(--gold-base);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.citizen-code-large:hover {
    background: var(--gold-dim);
    color: var(--gold-bright);
    transform: translateY(-2px);
}

/* متادیتا */
.profile-meta {
    background: rgba(151, 151, 151, 1);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(8px);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-meta-item i {
    width: 20px;
    color: var(--gold-base);
    text-shadow: var(--gold-text-shadow);
}

/* ---------- کارت‌های آمار در پروفایل ---------- */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-glass);
}

.profile-stat-card {
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 1.2rem;
    text-align: center;
    transition: all 0.25s;
    cursor: default;
}

.profile-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-border);
    background: var(--gold-dim);
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold-base);
    line-height: 1.2;
    margin-bottom: 0.3rem;
    text-shadow: var(--gold-text-shadow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-stat-card.blacklisted {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.profile-stat-card.blacklisted .stat-number {
    color: var(--danger);
}

/* ---------- بنرهای چشمک‌زن (بلک‌لیست و تحت تعقیب) ---------- */
@keyframes blinkWarning {
    0% {
        opacity: 1;
        background: linear-gradient(90deg, #ef4444, #b91c1c);
    }
    50% {
        opacity: 0.85;
        background: linear-gradient(90deg, #dc2626, #991b1b);
        box-shadow: 0 0 15px #ef4444;
    }
    100% {
        opacity: 1;
        background: linear-gradient(90deg, #ef4444, #b91c1c);
    }
}

.blacklist-blink {
    animation: blinkWarning 1.2s infinite;
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    color: white;
    text-align: center;
    padding: 0.8rem;
    margin: 0 2rem 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@keyframes blinkWanted {
    0% {
        opacity: 1;
        background: linear-gradient(90deg, #f97316, #c2410c);
    }
    50% {
        opacity: 0.85;
        background: linear-gradient(90deg, #ea580c, #9a3412);
        box-shadow: 0 0 15px #f97316;
    }
    100% {
        opacity: 1;
        background: linear-gradient(90deg, #f97316, #c2410c);
    }
}

.wanted-blink {
    animation: blinkWanted 1.2s infinite;
    background: linear-gradient(90deg, #f97316, #c2410c);
    color: white;
    text-align: center;
    padding: 0.8rem;
    margin: 0 2rem 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* ---------- بخش‌های پروفایل (عنوان + دکمه فیلتر) ---------- */
.profile-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
}

.profile-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold-base);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold-border);
    flex-wrap: wrap;
}

.section-title i {
    font-size: 1.2rem;
    text-shadow: var(--gold-text-shadow);
}

.btn-filter {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-full);
    padding: 0.3rem 0.9rem;
    font-size: 0.75rem;
    color: var(--gold-base);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
}

.btn-filter:hover {
    background: var(--gold-dim);
    transform: translateY(-2px);
}

/* ---------- جدول پرونده‌های دادگاه ---------- */
.cases-table-wrapper {
    overflow-x: auto;
    margin-top: 0.5rem;
    border-radius: var(--radius-lg);
}

.cases-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.cases-table th {
    background: var(--bg-glass-light);
    color: var(--gold-base);
    padding: 0.8rem 1rem;
    font-weight: 800;
    text-align: right;
    border-bottom: 2px solid var(--gold-border);
    font-size: 0.8rem;
    text-shadow: var(--gold-text-shadow);
}

.cases-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-secondary);
    vertical-align: middle;
    font-size: 0.85rem;
}

.cases-table tr:hover td {
    background: var(--gold-dim);
}

/* شماره پرونده و کد سند (قابل کلیک) */
.case-number,
.doc-code {
    font-family: monospace;
    color: var(--gold-base);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-shadow: var(--gold-text-shadow);
}

.case-number:hover,
.doc-code:hover {
    text-shadow: 0 0 6px var(--gold-glow);
    transform: scale(1.02);
}

/* بدج نقش‌ها در جدول دادگاه */
.case-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

/* نقش‌های اصلی دادگاه */
.case-badge.role-suspect { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.case-badge.role-judge { background: var(--gold-dim); color: var(--gold-base); }
.case-badge.role-case_officer { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.case-badge.role-lawyer { background: rgba(139, 92, 246, 0.2); color: var(--purple); }
.case-badge.role-prosecutor { background: rgba(236, 72, 153, 0.2); color: var(--pink); }
.case-badge.role-jury { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.case-badge.role-special_team { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.case-badge.role-forensic { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.case-badge.role-security_officer { background: rgba(100, 116, 139, 0.2); color: var(--text-dim); }
.case-badge.role-court_supervisor { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.case-badge.role-other { background: rgba(100, 116, 139, 0.2); color: var(--text-dim); }

/* نقش‌های اسناد */
.case-badge.role-seller { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.case-badge.role-buyer { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.case-badge.role-lessor { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.case-badge.role-lessee { background: rgba(236, 72, 153, 0.2); color: var(--pink); }
.case-badge.role-lender { background: rgba(139, 92, 246, 0.2); color: var(--purple); }
.case-badge.role-borrower { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.case-badge.role-witness { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.case-badge.role-creator { background: var(--gold-dim); color: var(--gold-base); }
.case-badge.role-depositor,
.case-badge.role-depository,
.case-badge.role-partner { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

/* وضعیت پرونده */
.case-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 0.4rem;
}
.case-status.pending { background: var(--warning); box-shadow: 0 0 4px var(--warning); }
.case-status.in_progress { background: var(--info); box-shadow: 0 0 4px var(--info); }
.case-status.completed { background: var(--success); box-shadow: 0 0 4px var(--success); }
.case-status.archived { background: var(--text-light); }

/* ---------- لیست سوابق اضافی ---------- */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.record-item {
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-right: 3px solid var(--purple);
    transition: all 0.2s;
}

.record-item:hover {
    background: var(--gold-dim);
    border-right-color: var(--gold-base);
    transform: translateX(-3px);
}

.record-type {
    font-weight: 700;
    color: var(--purple);
    background: rgba(139, 92, 246, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    display: inline-block;
    margin-left: 0.5rem;
}

.record-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.record-date {
    font-size: 0.7rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.record-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: 0.2s;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* ---------- صفحه‌بندی داخلی بخش‌ها ---------- */
.pagination-section {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* ---------- پیام خالی ---------- */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ---------- دکمه بازگشت به لیست ---------- */
.back-to-list {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
}

.btn-back {
    background: var(--bg-glass-light);
    border: 1.5px solid var(--border-glass);
    padding: 0.7rem 2rem;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.btn-back:hover {
    border-color: var(--gold-base);
    color: var(--gold-base);
    transform: translateY(-2px);
    background: var(--gold-dim);
}

/* ---------- اسپینر کوچک برای بارگذاری ---------- */
.loading-spinner-mini {
    text-align: center;
    padding: 1rem;
    color: var(--gold-base);
}

/* ---------- ریسپانسیو پروفایل ---------- */
@media (max-width: 992px) {
    .profile-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-avatar {
        flex-direction: column;
        text-align: center;
    }
    .profile-meta {
        text-align: center;
    }
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .profile-section {
        padding: 1rem;
    }
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
    .profile-hero {
        padding: 1rem;
    }
    .profile-avatar-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    .profile-title h2 {
        font-size: 1.3rem;
    }
    .stat-number {
        font-size: 1.6rem;
    }
    .cases-table th,
    .cases-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    .blacklist-blink,
    .wanted-blink {
        margin: 0 1rem 1rem 1rem;
        font-size: 0.85rem;
        padding: 0.6rem;
    }
    .section-title {
        font-size: 1rem;
        flex-wrap: wrap;
    }
    .btn-filter {
        margin-right: 0;
        margin-top: 0.5rem;
    }
    .record-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .record-actions {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .profile-stat-card {
        padding: 0.8rem;
    }
    .cases-table th,
    .cases-table td {
        padding: 0.4rem;
        font-size: 0.7rem;
    }
    .case-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
    .btn-back {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* ============================================================
   CITIZEN PROFILES - PART 5
   MODALS, TOASTS, LOADING OVERLAY, CONTEXT MENU, FORMS
   با پشتیبانی کامل از لایت مود و دارک مود
   ============================================================ */

/* ---------- مودال عمومی ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

.modal-content {
    background: var(--bg-glass-solid);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--gold-border);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.2);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* هدر مودال */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-glass-light);
    position: sticky;
    top: 0;
    z-index: 5;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-header h3 i {
    color: var(--gold-base);
    text-shadow: var(--gold-text-shadow);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
    border-color: var(--danger);
}

/* بدنه مودال */
.modal-body {
    padding: 1.8rem;
    color: var(--text-secondary);
}

.modal-footer {
    padding: 1rem 1.8rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ---------- فرم‌ها در مودال و صفحه ---------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--gold-base);
    width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    background: var(--bg-glass-light);
    border: 1.5px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.25s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-base);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.required {
    color: var(--danger);
    font-weight: bold;
    margin-right: 0.25rem;
}

.input-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* فرم ثبت شهروند (گرید دو ستونه) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* دکمه‌های عمومی */
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    color: #0f172a;
    box-shadow: 0 2px 8px var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--gold-glow);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--gold-dim);
    border-color: var(--gold-base);
    color: var(--gold-base);
    transform: translateY(-2px);
}

/* ---------- توستر (نوتیفیکیشن) ---------- */
.toasts {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 0.8rem 1.2rem;
    border-right: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    transform: translateX(-120%) scale(0.9);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.2), opacity 0.3s;
    min-width: 280px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast.success {
    border-right-color: var(--success);
}
.toast.error {
    border-right-color: var(--danger);
}
.toast.warning {
    border-right-color: var(--warning);
}
.toast.info {
    border-right-color: var(--info);
}

.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: currentColor;
    color: var(--text-primary);
}

.toast-icon i {
    font-size: 1rem;
}

.toast-content {
    flex: 1;
}

.toast-content h4 {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.toast-content p {
    font-size: 0.75rem;
    opacity: 0.8;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* ---------- لودینگ اوورلی ---------- */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10003;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--gold-base);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- مودال تأیید (Confirm Modal) ---------- */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 10004;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.confirm-modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.2s;
}

.confirm-modal {
    background: var(--bg-glass-solid);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--gold-border);
    border-radius: var(--radius-2xl);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
    animation: modalPop 0.3s;
}

.confirm-modal-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
}

.confirm-modal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--gold-dim);
    border: 2px solid var(--gold-border);
    color: var(--gold-base);
}

.confirm-modal-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

.confirm-modal-icon.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.confirm-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.confirm-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.confirm-modal-body {
    padding: 1.2rem 1.5rem;
    background: var(--bg-glass-light);
}

.summary-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-right: 3px solid var(--gold-base);
}

.confirm-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.confirm-btn-primary {
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    color: #0f172a;
}

.confirm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--gold-glow);
}

.confirm-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--border-glass);
    color: var(--text-secondary);
}

.confirm-btn-secondary:hover {
    background: var(--gold-dim);
    border-color: var(--gold-base);
    color: var(--gold-base);
}

.confirm-btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
}

.confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.4);
}

/* ---------- منوی راست‌کلیک (Context Menu) ---------- */
.custom-context-menu {
    position: fixed;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(24px);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0;
    min-width: 170px;
    box-shadow: var(--shadow-lg);
    z-index: 10005;
    animation: contextMenuFade 0.2s ease;
}

@keyframes contextMenuFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-item {
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.context-item i {
    width: 22px;
    color: var(--gold-base);
    font-size: 1rem;
}

.context-item:hover {
    background: var(--gold-dim);
    color: var(--gold-base);
    padding-right: 1.5rem;
}

/* ---------- ریسپانسیو برای مودال‌ها و توستر ---------- */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        border-radius: var(--radius-xl);
    }
    .modal-header {
        padding: 1rem 1.2rem;
    }
    .modal-body {
        padding: 1.2rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .toasts {
        left: 1rem;
        bottom: 1rem;
        right: 1rem;
    }
    .toast {
        min-width: auto;
        width: 100%;
        max-width: none;
    }
    .confirm-modal {
        max-width: 95%;
    }
    .confirm-modal-header {
        padding: 1.2rem;
    }
    .confirm-modal-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    .confirm-modal-title {
        font-size: 1.1rem;
    }
    .custom-context-menu {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .confirm-modal-footer {
        flex-direction: column;
    }
    .confirm-btn {
        width: 100%;
    }
    .toast {
        padding: 0.6rem 1rem;
    }
    .toast-content h4 {
        font-size: 0.8rem;
    }
    .toast-content p {
        font-size: 0.7rem;
    }
}
/* ============================================================
   CITIZEN PROFILES - PART 6 (FINAL)
   EXTRA RESPONSIVE, ADVANCED ANIMATIONS, ACCESSIBILITY & POLISH
   ============================================================ */

/* ---------- انیمیشن ورود پلکانی برای کارت‌ها ---------- */
.citizen-card {
    animation: cardFadeIn 0.5s ease backwards;
}

.citizen-card:nth-child(1) { animation-delay: 0.05s; }
.citizen-card:nth-child(2) { animation-delay: 0.1s; }
.citizen-card:nth-child(3) { animation-delay: 0.15s; }
.citizen-card:nth-child(4) { animation-delay: 0.2s; }
.citizen-card:nth-child(5) { animation-delay: 0.25s; }
.citizen-card:nth-child(6) { animation-delay: 0.3s; }
.citizen-card:nth-child(7) { animation-delay: 0.35s; }
.citizen-card:nth-child(8) { animation-delay: 0.4s; }
.citizen-card:nth-child(9) { animation-delay: 0.45s; }
.citizen-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- انیمیشن شناور برای آواتار ---------- */
@keyframes floatAvatar {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.profile-avatar-icon {
    animation: floatAvatar 4s ease-in-out infinite;
}

/* ---------- انیمیشن درخشش برای دکمه طلایی ---------- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.btn-primary {
    background-size: 200% auto;
    transition: all 0.3s;
}

.btn-primary:hover {
    animation: shimmer 0.8s ease-in-out;
    background-position: 200% 0;
}

/* ---------- انیمیشن نبض برای دکمه تغییر تم ---------- */
@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--gold-glow);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0);
    }
}

.theme-toggle-btn {
    animation: gentlePulse 2s infinite;
}

/* ---------- انیمیشن hover برای لینک‌ها ---------- */
.nav-link, .m-link, .tab {
    position: relative;
    overflow: hidden;
}

.nav-link::after, .m-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gold-base);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .m-link:hover::after {
    width: 100%;
}

/* ---------- افکت شیشه‌ای قوی‌تر روی hover کارت‌ها ---------- */
.citizen-card:hover {
    backdrop-filter: blur(20px);
    background: var(--bg-glass);
}

/* ---------- بهبود اسکرول نرم ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

/* ---------- فوکوس ویزیبل برای دسترسی ---------- */
:focus-visible {
    outline: 3px solid var(--gold-base);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ---------- بهبود انتخاب متن ---------- */
::selection {
    background: var(--gold-dim);
    color: var(--gold-dark);
}

/* ---------- ریسپانسیو دسکتاپ بزرگ (1600px+) ---------- */
@media (min-width: 1600px) {
    .page-main {
        max-width: 1800px;
        padding: 2rem 3rem;
    }
    .citizens-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 2rem;
    }
    .profile-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .cases-table {
        min-width: 800px;
    }
    .cases-table th, .cases-table td {
        padding: 1rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ---------- ریسپانسیو تبلت عمودی (768px - 991px) - تکمیل ---------- */
@media (min-width: 768px) and (max-width: 991px) {
    .page-main {
        padding: 1.5rem;
    }
    .citizens-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    .quick-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .stat-card {
        min-width: calc(50% - 0.6rem);
    }
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tabs {
        padding: 0 1rem;
    }
    .tab {
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* ---------- ریسپانسیو موبایل متوسط (480px - 767px) ---------- */
@media (min-width: 480px) and (max-width: 767px) {
    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .profile-stat-card {
        padding: 0.8rem;
    }
    .stat-number {
        font-size: 1.4rem;
    }
    .cases-table th, .cases-table td {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    .section-title {
        font-size: 1rem;
    }
    .btn-filter {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* ---------- ریسپانسیو موبایل بسیار کوچک (زیر 360px) ---------- */
@media (max-width: 359px) {
    .stat-value {
        font-size: 1rem;
    }
    .stat-label {
        font-size: 0.6rem;
    }
    .citizen-code {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
    }
    .card-body .name {
        font-size: 0.9rem;
    }
    .profile-title h2 {
        font-size: 1rem;
    }
    .citizen-code-large {
        font-size: 0.7rem;
    }
    .profile-meta-item {
        font-size: 0.7rem;
    }
    .cases-table th, .cases-table td {
        padding: 0.3rem;
        font-size: 0.6rem;
    }
    .pagination-btn {
        padding: 0.2rem 0.5rem;
        min-width: 30px;
        font-size: 0.65rem;
    }
}

/* ---------- حالت با کنتراست بالا (برای دسترسی) ---------- */
@media (prefers-contrast: high) {
    .citizen-card,
    .profile-stat-card,
    .list-container,
    .modal-content {
        border: 2px solid currentColor;
        background: var(--bg-glass-solid);
        backdrop-filter: none;
    }
    .btn-primary, .btn-gold {
        border: 2px solid black;
    }
    .cases-table th {
        background: black;
        color: white;
    }
    .case-badge {
        border: 1px solid currentColor;
        background: transparent;
    }
}

/* ---------- کاهش حرکت (برای کاربرانی که motion را ترجیح نمی‌دهند) ---------- */
@media (prefers-reduced-motion: reduce) {
    .citizen-card,
    .profile-avatar-icon,
    .btn-primary,
    .theme-toggle-btn {
        animation: none !important;
    }
    .citizen-card {
        transform: none !important;
    }
    .citizen-card:hover {
        transform: translateY(-4px) !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------- چاپ پروفایل (Print Styles) ---------- */
@media print {
    .animated-bg,
    .grain-overlay,
    .main-header,
    .tabs-container,
    .theme-toggle-btn,
    .back-to-top,
    .btn,
    .btn-filter,
    .modal,
    .toasts,
    .loading-overlay,
    .custom-context-menu,
    .record-actions,
    .back-to-list {
        display: none !important;
    }
    body {
        background: white;
        color: black;
        padding: 0;
        margin: 0;
    }
    .page-main {
        padding: 0;
        margin: 0;
    }
    .profile-container {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        padding: 0;
    }
    .profile-hero {
        background: #f5f5f5;
        border-bottom: 2px solid #ddd;
    }
    .profile-avatar-icon {
        background: #ddd;
        color: black;
        box-shadow: none;
    }
    .citizen-code-large {
        background: #eee;
        color: black;
    }
    .cases-table th {
        background: #ddd;
        color: black;
    }
    .cases-table td {
        border-bottom: 1px solid #ccc;
        color: black;
    }
    .case-badge {
        border: 1px solid #999;
        background: transparent !important;
        color: black !important;
    }
    .blacklist-blink,
    .wanted-blink {
        background: #f0f0f0;
        color: black;
        border: 1px solid #ccc;
        animation: none;
        box-shadow: none;
    }
    .record-item {
        border: 1px solid #ccc;
        background: #fafafa;
    }
    .profile-stat-card {
        border: 1px solid #ddd;
        background: #f9f9f9;
    }
    .stat-number {
        color: black;
    }
}

/* ---------- بهبود نمایش اسکرول در حالت دارک ---------- */
body.dark-mode ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
}

/* ---------- جلوگیری از overflow افقی در موبایل ---------- */
body {
    overflow-x: hidden;
}

img, svg, iframe {
    max-width: 100%;
}

/* ---------- استایل اضافی برای دکمه تمام عرض در سایدبار ---------- */
.full-width {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* ---------- اصلاح فاصله تب‌ها در حالت اسکرول ---------- */
.tabs-container {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ---------- رفع مشکل سفیدی بیش از حد در لایت مود ---------- */
body:not(.dark-mode) .bg-glass-solid {
    background: rgba(255, 255, 255, 0.96);
}

body:not(.dark-mode) .modal-content {
    background: rgba(255, 255, 255, 0.98);
}

/* ---------- پایان استایل‌های صفحه پروفایل شهروندان ---------- */

/* ============================================================
   PATCH: MISSING STYLES FOR BUTTONS & COMPONENTS
   (اضافه کردن کلاس‌های دکمه‌های طلایی و حاشیه‌ای)
   ============================================================ */

/* ---------- دکمه طلایی (برای هدر و سایر بخش‌ها) ---------- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
    color: #0f172a;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--gold-glow);
}

.btn-gold:active {
    transform: translateY(1px);
}

/* ---------- دکمه حاشیه‌ای (outline) برای هدر و سایدبار ---------- */
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gold-border);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s;
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--gold-dim);
    border-color: var(--gold-base);
    color: var(--gold-base);
    transform: translateY(-2px);
}

/* ---------- دکمه تمام عرض در سایدبار (تکمیل) ---------- */
.full-width {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.full-width:last-child {
    margin-bottom: 0;
}

/* ---------- استایل لیست آمار آنلاین در سایدبار (در صورت نیاز) ---------- */
.m-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.m-stats i {
    color: var(--gold-base);
}

/* ---------- اطمینان از استایل درست تب‌ها در حالت اسکرول ---------- */
.tabs-container {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-glass-solid);
}

/* ---------- استایل برای حالت لودینگ اولیه پروفایل ---------- */
.profile-loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-dim);
}

.profile-loading i {
    font-size: 2.5rem;
    color: var(--gold-base);
    margin-bottom: 1rem;
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ---------- استایل برای پیام‌های خالی در بخش‌های مختلف ---------- */
.empty-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-style: italic;
    background: var(--bg-glass-light);
    border-radius: var(--radius-lg);
}

/* ---------- استایل دکمه بستن مودال (تکمیل) ---------- */
.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
    border-color: var(--danger);
}

/* ---------- استایل برای صفحه‌بندی داخلی بخش‌ها ---------- */
.pagination-section {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* ---------- استایل برای لینک‌های داخل سایدبار ---------- */
.m-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.m-link i {
    width: 24px;
    color: var(--gold-base);
}

.m-link:hover, .m-link.active {
    background: var(--gold-dim);
    color: var(--gold-base);
    transform: translateX(-4px);
}

/* ---------- استایل برای هدر سایدبار ---------- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 800;
    color: var(--gold-base);
    font-size: 1rem;
}

/* ---------- اطمینان از رنگ مناسب متن در لایت مود برای دکمه ورود/خروج ---------- */
body:not(.dark-mode) .btn-login {
    color: #0f172a;
}

body:not(.dark-mode) .btn-logout {
    color: var(--danger);
}

body:not(.dark-mode) .btn-logout:hover {
    color: white;
}

/* ---------- تکمیل استایل دکمه بازگشت به لیست ---------- */
.btn-back {
    background: var(--bg-glass-light);
    border: 1.5px solid var(--border-glass);
    padding: 0.7rem 2rem;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.btn-back:hover {
    border-color: var(--gold-base);
    color: var(--gold-base);
    transform: translateY(-2px);
    background: var(--gold-dim);
}

/* ---------- ریسپانسیو برای دکمه‌های سایدبار در موبایل ---------- */
@media (max-width: 480px) {
    .btn-gold, .btn-outline {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
    .sidebar-footer .btn-gold,
    .sidebar-footer .btn-outline {
        margin-bottom: 0.5rem;
    }
}

/* ---------- اطمینان از عدم تداخل انیمیشن لودر با محتوا ---------- */
#globalLoader.hidden {
    display: none;
}

/* ---------- استایل برای فوتر سایدبار (تکمیل) ---------- */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* ============================================================
   CITIZEN PROFILES - PART 7 (FINAL FIXES)
   TAB IMPROVEMENTS + LIGHT MODE GRAYNESS FIX
   ============================================================ */

/* ---------- بهبود تب‌ها (جلوگیری از چسبیدن به محتوای پایین، افکت شیشه‌ای قوی‌تر) ---------- */
.tabs-container {
    position: sticky;
    top: var(--header-height);
    z-index: 199;
    background: var(--bg-glass-solid);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gold-border);
    margin-top: var(--header-height);
    margin-bottom: 1.5rem; /* فاصله از محتوای پایین */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* افکت سایه نرم زیر تب‌ها */
.tabs-container::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
}

/* افکت hover و active برای تب‌ها با انیمیشن نرم */
.tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
}

/* افکت درخشش روی hover */
.tab:hover {
    color: var(--text-secondary);
    transform: translateY(-2px);
}

.tab:hover i {
    transform: scale(1.05);
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--gold-base);
    text-shadow: 0 0 4px var(--gold-glow);
}

.tab.active i {
    color: var(--gold-base);
    text-shadow: var(--gold-text-shadow);
}

/* زیرخط متحرک طلایی برای تب فعال (افکت روان) */
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-base), transparent);
    border-radius: 3px;
    animation: tabUnderline 0.3s ease-out;
}

@keyframes tabUnderline {
    from {
        width: 0%;
        left: 50%;
    }
    to {
        width: 60%;
        left: 20%;
    }
}

/* ---------- رفع مشکل خاکستری بودن بخش‌ها در لایت مود ---------- */

/* 1. profile-hero در لایت مود (پس‌زمینه شفاف با طلایی ملایم) */
body:not(.dark-mode) .profile-hero {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(0, 0, 0, 0.02));
    border-bottom-color: rgba(251, 191, 36, 0.3);
}

/* 2. profile-stats-grid در لایت مود (پس‌زمینه روشن با حاشیه نرم) */
body:not(.dark-mode) .profile-stats-grid {
    background: rgba(0, 0, 0, 0.02);
}

body:not(.dark-mode) .profile-stat-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: #e2e8f0;
}

body:not(.dark-mode) .profile-stat-card:hover {
    border-color: var(--gold-base);
    background: rgba(251, 191, 36, 0.08);
}

/* 3. search-header در لایت مود */
body:not(.dark-mode) .search-header {
    background: rgba(0, 0, 0, 0.02);
    border-bottom-color: #e2e8f0;
}

body:not(.dark-mode) .search-header h3 {
    color: var(--gold-dark);
}

/* 4. search-input-wrapper در لایت مود (فیلد جستجو) */
body:not(.dark-mode) .search-input-wrapper input {
    background: white;
    border-color: #e2e8f0;
    color: #1e293b;
}

body:not(.dark-mode) .search-input-wrapper input::placeholder {
    color: #94a3b8;
}

body:not(.dark-mode) .search-input-wrapper input:focus {
    border-color: var(--gold-base);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

body:not(.dark-mode) .search-icon {
    color: var(--gold-dark);
}

/* 5. citizen-code در لایت مود */
body:not(.dark-mode) .citizen-code {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gold-dark);
}

body:not(.dark-mode) .citizen-code:hover {
    background: var(--gold-dim);
    color: var(--gold-dark);
}

/* 6. card-footer در لایت مود */
body:not(.dark-mode) .card-footer {
    border-top-color: #e2e8f0;
    color: #64748b;
}

/* 7. جدول پرونده‌ها در لایت مود */
body:not(.dark-mode) .cases-table th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--gold-dark);
}

body:not(.dark-mode) .cases-table td {
    border-bottom-color: #e2e8f0;
    color: #334155;
}

body:not(.dark-mode) .cases-table tr:hover td {
    background: rgba(251, 191, 36, 0.08);
}

/* 8. سوابق (record-item) در لایت مود */
body:not(.dark-mode) .record-item {
    background: rgba(0, 0, 0, 0.02);
    border-right-color: var(--purple);
}

body:not(.dark-mode) .record-item:hover {
    background: rgba(251, 191, 36, 0.08);
}

/* 9. دکمه فیلتر در لایت مود */
body:not(.dark-mode) .btn-filter {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(251, 191, 36, 0.4);
    color: var(--gold-dark);
}

body:not(.dark-mode) .btn-filter:hover {
    background: var(--gold-dim);
    color: var(--gold-dark);
}

/* 10. پیام خالی (empty-message) در لایت مود */
body:not(.dark-mode) .empty-message {
    background: rgba(0, 0, 0, 0.02);
    color: #64748b;
}

/* 11. کارت آمار سریع (stat-card) در لایت مود */
body:not(.dark-mode) .stat-card {
    background: white;
    border-color: #e2e8f0;
}

body:not(.dark-mode) .stat-card:hover {
    border-color: var(--gold-base);
    background: rgba(251, 191, 36, 0.05);
}

body:not(.dark-mode) .stat-value {
    color: #0f172a;
}

/* 12. کانتینر جستجو (advanced-search-container) در لایت مود */
body:not(.dark-mode) .advanced-search-container {
    background: white;
    border-color: #e2e8f0;
}

/* 13. دکمه بازگشت به لیست (btn-back) در لایت مود */
body:not(.dark-mode) .btn-back {
    background: rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
    color: #475569;
}

body:not(.dark-mode) .btn-back:hover {
    background: var(--gold-dim);
    border-color: var(--gold-base);
    color: var(--gold-dark);
}

/* 14. بنرهای چشمک‌زن در لایت مود (رنگ‌ها را حفظ کن اما شفافیت کمتر) */
body:not(.dark-mode) .blacklist-blink {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

body:not(.dark-mode) .wanted-blink {
    background: linear-gradient(90deg, #f97316, #c2410c);
    color: white;
}

/* 15. اطمینان از خوانایی متن طلایی در لایت مود */
body:not(.dark-mode) .gold-text,
body:not(.dark-mode) .section-title,
body:not(.dark-mode) .cases-table th {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* 16. رفع مشکل کنتراست دکمه ورود در لایت مود */
body:not(.dark-mode) .btn-login {
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

/* ---------- ریسپانسیو برای تب‌ها در موبایل ---------- */
@media (max-width: 768px) {
    .tabs {
        padding: 0 1rem;
    }
    .tab {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }
    .tabs-container::after {
        display: none;
    }
    .tabs-container {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .tab span {
        display: none; /* در موبایل فقط آیکون نمایش داده شود */
    }
    .tab i {
        font-size: 1.2rem;
        margin: 0;
    }
    .tab {
        padding: 0.7rem;
    }
}

/* ============================================================
   BLACKLIST & WANTED BANNERS - ULTIMATE VERSION
   ============================================================ */

/* بنر بلک‌لیست (قرمز چشمک‌زن با افکت شیشه‌ای و درخشش) */
.blacklist-blink {
    animation: blinkWarning 1.2s infinite;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    text-align: center;
    padding: 1rem 1.5rem;
    margin: 1rem 2rem 1.5rem 2rem;  /* تغییر: اضافه شدن margin-top: 1rem */
    border-radius: var(--radius-xl);
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}
.blacklist-blink i {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* افکت درخشش متحرک روی بنر */
.blacklist-blink::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* بنر تحت تعقیب (نارنجی-قرمز با افکت شعله) */
.wanted-blink {
    animation: blinkWanted 1.2s infinite;
    background: linear-gradient(135deg, #f97316, #c2410c);
    color: white;
    text-align: center;
    padding: 1rem 1.5rem;
    margin: 1rem 2rem 1.5rem 2rem;  /* تغییر: اضافه شدن margin-top: 1rem */
    border-radius: var(--radius-xl);
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}
.wanted-blink i {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wanted-blink::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* انیمیشن چشمک‌زن بلک‌لیست */
@keyframes blinkWarning {
    0% { opacity: 1; background: linear-gradient(135deg, #ef4444, #b91c1c); }
    50% { opacity: 0.92; background: linear-gradient(135deg, #dc2626, #991b1b); box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6); }
    100% { opacity: 1; background: linear-gradient(135deg, #ef4444, #b91c1c); }
}

/* انیمیشن چشمک‌زن تحت تعقیب */
@keyframes blinkWanted {
    0% { opacity: 1; background: linear-gradient(135deg, #f97316, #c2410c); }
    50% { opacity: 0.92; background: linear-gradient(135deg, #ea580c, #9a3412); box-shadow: 0 8px 25px rgba(249, 115, 22, 0.6); }
    100% { opacity: 1; background: linear-gradient(135deg, #f97316, #c2410c); }
}

/* افکت درخشش (shimmer) */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .blacklist-blink, .wanted-blink {
        margin: 0 1rem 1rem 1rem;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        gap: 0.7rem;
    }
    .blacklist-blink i, .wanted-blink i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .blacklist-blink, .wanted-blink {
        flex-direction: column;
        text-align: center;
    }
}

.doc-code-hidden {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dim);
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: not-allowed;
}