/* Modern Persian & English Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@font-face {
    font-family: 'IRANSansWeb';
    src: url('../fonts/IRANSansWeb(FaNum).eot');
    src: url('../fonts/IRANSansWeb(FaNum).eot?#iefix') format('embedded-opentype'),
         url('../fonts/IRANSansWeb(FaNum).woff2') format('woff2'),
         url('../fonts/IRANSansWeb(FaNum).woff') format('woff'),
         url('../fonts/IRANSansWeb(FaNum).ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* HSL Color System */
    --primary: hsl(224, 82%, 56%);
    --primary-hover: hsl(224, 82%, 46%);
    --primary-light: hsl(224, 82%, 96%);
    
    --success: hsl(142, 70%, 45%);
    --success-light: hsl(142, 70%, 95%);
    
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 95%);
    
    --danger: hsl(346, 84%, 55%);
    --danger-light: hsl(346, 84%, 95%);
    
    --background: hsl(220, 20%, 97%);
    --surface: hsl(0, 0%, 100%);
    --border: hsl(220, 15%, 89%);
    
    --text-primary: hsl(220, 30%, 10%);
    --text-secondary: hsl(220, 15%, 45%);
    --text-muted: hsl(220, 15%, 65%);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    min-height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'IRANSansWeb', 'Inter', 'Vazirmatn', Tahoma, sans-serif;
    background-color: #f3f6fc;
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 45%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 45%),
        radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.06) 0px, transparent 45%),
        radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.05) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

input, select, option, textarea, button {
    font-family: 'IRANSansWeb', 'Inter', 'Vazirmatn', Tahoma, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.8);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =========================
   Navbar (Frosted Glass)
   ========================= */
.navbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.04);
}

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

.brand-icon {
    font-size: 24px;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, hsl(224, 82%, 56%), hsl(244, 75%, 55%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.select-control {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.select-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group .select-control {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    font-size: 13.5px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    text-decoration: none;
    margin-left: 6px;
    transition: var(--transition);
}

.notif-bell:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
}

.notif-badge-bubble {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =========================
   Layout & Frosted Sidebar
   ========================= */
.app-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-left: 1px solid rgba(226, 232, 240, 0.7);
    padding: 24px 16px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 12px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-title-icon {
    font-size: 15px;
    color: var(--primary);
}

.sidebar-menu {
    list-style: none;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), 0 1px 1px rgba(255, 255, 255, 0.9);
}

.sidebar-link i {
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sidebar-link:hover i {
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, hsl(224, 82%, 56%), hsl(224, 82%, 48%));
    color: #ffffff;
    box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-right: auto;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.content {
    flex: 1;
    padding: 32px 36px;
    min-width: 0;
}

/* =========================
   Breadcrumb & Headers
   ========================= */
.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.breadcrumb strong {
    color: var(--text-primary);
    font-weight: 700;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =========================
   Glassmorphism Hero & Cards
   ========================= */
.glass-hero-banner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(240, 245, 255, 0.72) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 36px -8px rgba(37, 99, 235, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.6), inset 0 1px 0 #ffffff;
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 26px;
    position: relative;
}

.glass-hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #0ea5e9, #10b981);
    border-radius: 20px 20px 0 0;
}

.glass-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.glass-hero-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.glass-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, hsl(224, 82%, 56%), hsl(244, 75%, 55%));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.35);
}

.glass-hero-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.glass-hero-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.glass-county-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.18);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.glass-quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.glass-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.glass-action-btn:hover {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.glass-action-btn i {
    font-size: 16px;
    color: var(--primary);
}

.glass-action-btn.primary {
    background: linear-gradient(135deg, hsl(224, 82%, 56%), hsl(224, 82%, 48%));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.glass-action-btn.primary i {
    color: #ffffff;
}

.glass-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.38);
    color: #ffffff;
}

/* =========================
   Glass Cards & Stats
   ========================= */
.card, .glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    position: relative;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(226, 232, 240, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 18px 18px 0;
    opacity: 0.8;
}

.stat-card.variant-success::after { background: #10b981; }
.stat-card.variant-warning::after { background: #f59e0b; }
.stat-card.variant-danger::after { background: #ef4444; }
.stat-card.variant-purple::after { background: #8b5cf6; }
.stat-card.variant-cyan::after { background: #06b6d4; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px -6px rgba(37, 99, 235, 0.1), 0 0 0 1px rgba(37, 99, 235, 0.25), inset 0 1px 0 #ffffff;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    letter-spacing: -0.5px;
}

.stat-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-icon {
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.18);
    backdrop-filter: blur(8px);
    transition: transform 0.25s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(-4deg);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.22);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.22);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.22);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
    border-color: rgba(139, 92, 246, 0.22);
}

.stat-icon.cyan {
    background: rgba(6, 182, 212, 0.12);
    color: #0891b2;
    border-color: rgba(6, 182, 212, 0.22);
}

/* =========================
   Glass Badges & Tables
   ========================= */
.badge-glass {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(6px);
    border: 1px solid transparent;
}

.badge-glass-success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-glass-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.28);
}

.badge-glass-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.25);
}

.badge-glass-primary {
    background: rgba(37, 99, 235, 0.12);
    color: #1e40af;
    border-color: rgba(37, 99, 235, 0.25);
}

.badge-glass-purple {
    background: rgba(139, 92, 246, 0.12);
    color: #5b21b6;
    border-color: rgba(139, 92, 246, 0.25);
}

.badge-glass-muted {
    background: rgba(100, 116, 139, 0.12);
    color: #334155;
    border-color: rgba(100, 116, 139, 0.25);
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.glass-table th {
    background: rgba(241, 245, 249, 0.7);
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    font-size: 12px;
}

.glass-table th:first-child { border-radius: 0 10px 10px 0; }
.glass-table th:last-child { border-radius: 10px 0 0 10px; }

.glass-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    color: var(--text-primary);
    vertical-align: middle;
}

.glass-table tr:last-child td {
    border-bottom: none;
}

.glass-table tr:hover td {
    background: rgba(248, 250, 252, 0.85);
}

/* =========================
   Buttons & Forms
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

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

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

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

.btn-danger:hover {
    background: hsl(346, 84%, 45%);
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    font-size: 13.5px;
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

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

/* =========================
   Table Styles
   ========================= */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.table {
    width: 100%;
    min-width: 550px;
    border-collapse: collapse;
    font-size: 13px;
}

.table th, .table td {
    padding: 16px 20px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: hsl(220, 20%, 98%);
    color: var(--text-secondary);
    font-weight: 700;
}

.table tr:hover td {
    background: hsl(220, 20%, 99%);
}

/* =========================
   Alerts & Toasts
   ========================= */
.messages-container {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1050;
    width: 320px;
    max-width: calc(100vw - 48px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-right: 4px solid var(--success);
}

.alert-danger, .alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border-right: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-right: 4px solid var(--warning);
}

/* =========================
   Modal Screen
   ========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 540px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 16px;
    font-weight: 800;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* =========================
   Wizards & Steps
   ========================= */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 36px;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--background);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.step-dot.active .step-number {
    background: var(--primary);
    color: var(--surface);
    border-color: var(--primary);
}

.step-dot.completed .step-number {
    background: var(--success);
    color: var(--surface);
    border-color: var(--success);
}

/* =========================
   Responsive Adjustments
   ========================= */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-left: none;
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
    }
    
    .sidebar-menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .sidebar-link {
        padding: 11px 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .content {
        padding: 16px 12px !important;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }

    /* Navbar mobile style */
    .navbar {
        height: auto !important;
        min-height: 70px;
        flex-wrap: wrap;
        padding: 10px 16px !important;
        gap: 10px;
        justify-content: center;
    }
    .navbar-brand {
        flex: 1 1 100%;
        justify-content: center;
        margin-bottom: 2px;
        text-align: center;
    }
    .navbar-panel {
        flex: 1 1 auto;
        display: flex;
        justify-content: center;
    }
    .navbar-user {
        flex: 1 1 auto;
        justify-content: center;
        gap: 8px;
    }

    /* Steps Indicator mobile style */
    .step-label {
        display: none !important;
    }
    .steps-indicator {
        padding: 12px !important;
        margin-bottom: 20px !important;
        gap: 4px;
    }
    .step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
        border-width: 1.5px !important;
    }

    /* Responsive Tables inside wrappers */
    .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    .table {
        min-width: 650px;
    }
    .table th, .table td {
        padding: 10px 12px !important;
    }
}

@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    /* Hide verbose user name/role to save space on very small screens */
    .navbar-user .user-info {
        display: none !important;
    }

    /* Make grid-based inline forms single column */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure Jalali Datepicker is always on top of all modal and wizard layers */
#jdp-container {
    z-index: 99999999 !important;
}

/* ========================================================
   Stat Cards Sub-Breakdown & Time Metrics
   ======================================================== */
.stat-card.clickable {
    cursor: pointer;
    position: relative;
    user-select: none;
}
.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.stat-card-hint {
    font-size: 10.5px;
    color: var(--primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}
.stat-card.clickable:hover .stat-card-hint {
    opacity: 1;
    text-decoration: underline;
}

.stat-subbreakdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(203, 213, 225, 0.8);
    width: 100%;
}

.stat-subitem {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(248, 250, 252, 0.7);
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-align: center;
}

.stat-subitem-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stat-subitem-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
    font-family: inherit;
}

/* ========================================================
   Glass Modal Component for Pure Numbers Breakdown
   ======================================================== */
.glass-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.glass-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.glass-modal-box {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 28px;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
}

.glass-modal-backdrop.active .glass-modal-box {
    transform: scale(1) translateY(0);
}

.glass-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 20px;
}

.glass-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.glass-modal-close {
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.8);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
}

.glass-modal-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-stat-section {
    margin-bottom: 18px;
}

.modal-section-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.modal-stat-card {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.modal-stat-card:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-stat-number {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-stat-number.primary { color: var(--primary); }
.modal-stat-number.success { color: #059669; }
.modal-stat-number.warning { color: #d97706; }
.modal-stat-number.danger { color: #dc2626; }