/* من تصميم النظام الأصلي + تحسينات التذييل والخطوط */


        /* ================================================================
           DESIGN SYSTEM - مطابق للصفحة الرئيسية
           ================================================================ */
        :root {
            --primary: var(--primary);
            --primary-light: #1a2e46;
            --primary-dark: #08131f;
            --accent: var(--accent);
            --accent-light: var(--accent-light);
            --accent-dark: var(--accent-dark);
            --accent-tint: rgba(220, 38, 38, 0.08);
            --success: #1c7a4e;
            --success-bg: #e6f3ec;
            --danger: #ad3f39;
            --danger-bg: #f7e8e6;
            --info: #2d6088;
            --info-bg: #e6edf4;
            --warning: #ad7f2e;
            --warning-bg: #f6eee1;
            --bg: var(--bg);
            --surface: #ffffff;
            --surface-alt: var(--surface-alt);
            --border: var(--border);
            --border-light: var(--border-light);
            --text: var(--text);
            --text-secondary: var(--text-secondary);
            --text-tertiary: var(--text-tertiary);
            --text-inverse: #f5f3ec;
            --shadow-sm: 0 1px 2px rgba(14,28,46,0.04), 0 1px 3px rgba(14,28,46,0.06);
            --shadow-md: 0 2px 8px rgba(14,28,46,0.06), 0 6px 16px rgba(14,28,46,0.06);
            --shadow-lg: 0 10px 30px rgba(14,28,46,0.10);
            --radius-sm: 4px;
            --radius-md: 6px;
            --radius-lg: 10px;
            --radius-full: 9999px;
            --t-base: 0.2s ease;
            --sidebar-width: 260px;
            --header-height: 60px;
            --font-display: 'Inter', 'Cairo', sans-serif;
            --font-body: 'Cairo', 'Inter', sans-serif;
        }

        /* ================================================================
           RESET & BASE
           ================================================================ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-body);
            background: var(--bg);
            color: var(--text);
            overflow-x: hidden;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            font-size: 13px;
            line-height: 1.5;
            display: flex;
            flex-direction: column;
        }

        a {
            text-decoration: none;
            color: inherit;
        }
        button {
            cursor: pointer;
            font-family: inherit;
        }

        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }

        /* ================================================================
           SIDEBAR
           ================================================================ */
        .sidebar {
            position: fixed;
            top: 0;
            right: 0;
            width: var(--sidebar-width);
            height: 100vh;
            background: var(--primary);
            z-index: 1050;
            overflow-y: auto;
            transition: transform 0.3s ease;
            border-left: 1px solid rgba(255,255,255,0.05);
            display: flex;
            flex-direction: column;
        }

        .sidebar::-webkit-scrollbar {
            width: 3px;
        }
        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.12);
        }

        .sidebar.collapsed {
            transform: translateX(calc(var(--sidebar-width) + 20px));
        }

        .sidebar-brand {
            padding: 20px 20px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
        }

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

        .brand-logo-img {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            object-fit: contain;
            flex-shrink: 0;
            background: rgba(255,255,255,0.05);
            padding: 2px;
            display: none;
        }

        .brand-logo-img.visible {
            display: block;
        }

        .brand-mark {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            background: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: var(--font-display);
            font-weight: 800;
            font-size: 14px;
            color: var(--text-inverse);
            flex-shrink: 0;
        }

        .brand-mark.hidden {
            display: none;
        }

        .brand-text {
            font-family: var(--font-display);
            font-size: 16px;
            font-weight: 700;
            color: var(--text-inverse);
            line-height: 1.2;
        }

        .brand-text span {
            color: var(--accent-light);
        }

        .brand-text small {
            display: block;
            font-size: 9px;
            font-weight: 400;
            letter-spacing: 0.5px;
            color: rgba(255,255,255,0.3);
            margin-top: 1px;
        }

        .sidebar-nav {
            padding: 10px 8px;
            flex: 1;
        }

        .nav-section-title {
            font-size: 9px;
            font-weight: 700;
            color: rgba(255,255,255,0.2);
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 14px 12px 6px;
            font-family: var(--font-display);
        }

        .nav-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .nav-list li {
            margin-bottom: 0;
        }

        .nav-list a {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            color: rgba(255,255,255,0.5);
            font-size: 12.5px;
            font-weight: 500;
            transition: var(--t-base);
            position: relative;
        }

        .nav-list a:hover {
            background: rgba(255,255,255,0.05);
            color: var(--text-inverse);
        }

        .nav-list a.active {
            background: rgba(220, 38, 38, 0.12);
            color: var(--text-inverse);
            font-weight: 600;
        }

        .nav-list a.active i {
            color: var(--accent-light);
        }

        .nav-list a.active::before {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 2px;
            height: 16px;
            background: var(--accent);
        }

        .nav-list a i {
            width: 16px;
            text-align: center;
            font-size: 14px;
            flex-shrink: 0;
            opacity: 0.7;
        }

        .sidebar-badge {
            margin-right: auto;
            font-size: 8px;
            font-weight: 700;
            padding: 1px 8px;
            border-radius: var(--radius-full);
            background: rgba(220, 38, 38, 0.18);
            color: var(--accent-light);
            border: 1px solid rgba(220, 38, 38, 0.15);
            font-family: var(--font-display);
        }

        .sidebar-footer {
            padding: 12px 16px 16px;
            border-top: 1px solid rgba(255,255,255,0.05);
            flex-shrink: 0;
        }

        .logout-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 7px 12px;
            border-radius: var(--radius-sm);
            color: rgba(255,255,255,0.3);
            transition: var(--t-base);
            font-size: 12.5px;
            font-weight: 500;
        }

        .logout-btn:hover {
            background: rgba(184, 74, 62, 0.12);
            color: #e8a09a;
        }

        .logout-btn i {
            font-size: 14px;
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.35);
            z-index: 1045;
        }

        .sidebar-overlay.active {
            display: block;
        }

        /* ================================================================
           MAIN CONTENT
           ================================================================ */
        .main-content {
            margin-right: var(--sidebar-width);
            min-height: 100vh;
            transition: margin-right 0.3s ease;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .main-content.expanded {
            margin-right: 0;
        }

        /* ================================================================
           NAVBAR
           ================================================================ */
        .navbar-custom {
            background: var(--bg);
            padding: 0 24px;
            height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 1040;
            border-bottom: 1px solid var(--border);
        }

        .navbar-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .sidebar-toggle {
            width: 32px;
            height: 32px;
            border: 1px solid var(--border);
            background: transparent;
            font-size: 16px;
            color: var(--text-secondary);
            transition: var(--t-base);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .sidebar-toggle:hover {
            background: var(--surface);
            border-color: var(--text-tertiary);
        }

        .navbar-logo-container {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-right: 4px;
        }

        .navbar-logo-img {
            height: 28px;
            width: 28px;
            object-fit: contain;
            border-radius: var(--radius-sm);
            display: none;
        }

        .navbar-logo-img.visible {
            display: block;
        }

        .navbar-logo-text {
            font-size: 13px;
            font-weight: 700;
            color: var(--text);
            font-family: var(--font-display);
        }

        .navbar-logo-text span {
            color: var(--accent);
        }

        .page-title {
            font-family: var(--font-display);
            font-size: 15px;
            font-weight: 700;
            color: var(--text);
        }

        .page-title small {
            font-size: 11px;
            font-weight: 400;
            color: var(--text-tertiary);
            margin-right: 6px;
        }

        .navbar-right {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .nav-btn {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-size: 15px;
            transition: var(--t-base);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .nav-btn:hover {
            background: var(--surface);
            color: var(--text);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 3px 4px 3px 12px;
            border-radius: var(--radius-full);
            cursor: pointer;
            transition: var(--t-base);
            border: 1px solid transparent;
        }

        .user-profile:hover {
            background: var(--surface);
            border-color: var(--border);
        }

        .user-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--accent);
            color: var(--text-inverse);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 12px;
            font-family: var(--font-display);
            flex-shrink: 0;
        }

        .user-info {
            line-height: 1.2;
        }

        .user-name {
            font-size: 12px;
            font-weight: 600;
            color: var(--text);
        }

        .user-role {
            font-size: 10px;
            color: var(--text-tertiary);
        }

        /* ================================================================
           DASHBOARD CONTENT
           ================================================================ */
        .dashboard-content {
            padding: 20px 24px 30px;
            flex: 1;
        }

        /* ================================================================
           PAGE HEADER
           ================================================================ */
        .page-header {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 18px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .page-header .ph-left h2 {
            font-family: var(--font-display);
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            margin: 0;
        }

        .page-header .ph-left p {
            font-size: 12px;
            color: var(--text-tertiary);
            margin: 0;
        }

        .page-header .ph-right {
            font-size: 12px;
            color: var(--text-tertiary);
            text-align: left;
        }

        .page-header .ph-right strong {
            display: block;
            font-weight: 600;
            color: var(--text);
            font-size: 13px;
        }

        /* ================================================================
           STAT CARDS
           ================================================================ */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 12px;
            margin-bottom: 18px;
        }

        .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 14px 16px;
            transition: var(--t-base);
            cursor: pointer;
        }

        .stat-card:hover {
            border-color: var(--accent);
            box-shadow: var(--shadow-sm);
            transform: translateY(-1px);
        }

        .stat-card .stat-number {
            font-family: var(--font-display);
            font-size: 20px;
            font-weight: 800;
            color: var(--text);
            line-height: 1.2;
        }

        .stat-card .stat-label {
            font-size: 10px;
            color: var(--text-tertiary);
            margin-top: 2px;
        }

        .stat-card .stat-icon {
            float: left;
            font-size: 18px;
            color: var(--accent-light);
            opacity: 0.5;
        }

        .stat-blue .stat-number {
            color: var(--info);
        }
        .stat-green .stat-number {
            color: var(--success);
        }
        .stat-gold .stat-number {
            color: var(--accent);
        }
        .stat-red .stat-number {
            color: var(--danger);
        }

        /* ================================================================
           BUTTONS
           ================================================================ */
        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 16px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            font-size: 12px;
            transition: var(--t-base);
            border: 1px solid transparent;
            font-family: var(--font-display);
        }

        .btn-primary {
            background: var(--primary);
            border-color: var(--primary);
            color: var(--text-inverse);
        }

        .btn-primary:hover {
            background: var(--primary-light);
            border-color: var(--primary-light);
            color: var(--text-inverse);
        }

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

        .btn-success:hover {
            background: #166a4a;
            border-color: #166a4a;
            color: white;
        }

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

        .btn-danger:hover {
            background: #a03d32;
            border-color: #a03d32;
            color: white;
        }

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

        .btn-outline:hover {
            border-color: var(--accent);
            color: var(--accent-dark);
            background: var(--accent-tint);
        }

        .btn-sm {
            font-size: 10px;
            padding: 4px 10px;
        }

        .btn-icon {
            width: 28px;
            height: 28px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-sm);
            border: 1px solid transparent;
            font-size: 12px;
            transition: var(--t-base);
        }

        .btn-icon-edit {
            background: var(--info-bg);
            color: var(--info);
            border-color: var(--border);
        }

        .btn-icon-edit:hover {
            background: var(--info);
            color: white;
        }

        .btn-icon-delete {
            background: var(--danger-bg);
            color: var(--danger);
            border-color: var(--border);
        }

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

        /* ================================================================
           PANEL
           ================================================================ */
        .panel {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }

        .panel-header {
            padding: 10px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 6px;
        }

        .panel-title {
            font-family: var(--font-display);
            font-size: 12px;
            font-weight: 700;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 6px;
            margin: 0;
        }

        .panel-title i {
            color: var(--accent);
            font-size: 13px;
        }

        .record-count {
            font-size: 11px;
            color: var(--text-tertiary);
            font-weight: 500;
        }

        /* ================================================================
           TABLE
           ================================================================ */
        .table-wrap {
            overflow-x: auto;
        }

        .table-custom {
            width: 100%;
            border-collapse: collapse;
            font-size: 12.5px;
        }

        .table-custom thead {
            background: var(--bg);
        }

        .table-custom th {
            padding: 8px 12px;
            text-align: right;
            font-weight: 600;
            color: var(--text-tertiary);
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            border-bottom: 1px solid var(--border);
            font-family: var(--font-display);
            white-space: nowrap;
        }

        .table-custom td {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border-light);
            vertical-align: middle;
            color: var(--text);
        }

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

        .table-custom tr:hover td {
            background: var(--surface-alt);
        }

        .badge-custom {
            padding: 1px 8px;
            border-radius: var(--radius-full);
            font-size: 9px;
            font-weight: 600;
            display: inline-block;
            font-family: var(--font-display);
        }

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

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

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

        /* ================================================================
           MODAL
           ================================================================ */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            z-index: 1060;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal-box {
            background: var(--surface);
            border-radius: var(--radius-lg);
            padding: 28px 32px;
            max-width: 520px;
            width: 92%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            animation: modalFadeIn 0.3s ease;
        }

        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: scale(0.95) translateY(10px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .modal-box h3 {
            font-family: var(--font-display);
            font-size: 17px;
            font-weight: 800;
            color: var(--text);
            margin-bottom: 16px;
        }

        .modal-box h3 i {
            color: var(--accent);
            margin-left: 8px;
        }

        .modal-box label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }

        .modal-box select,
        .modal-box input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-family: var(--font-body);
            font-size: 13px;
            margin-bottom: 12px;
            transition: var(--t-base);
            background: var(--surface);
            color: var(--text);
        }

        .modal-box select:focus,
        .modal-box input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
        }

        .modal-actions {
            display: flex;
            gap: 10px;
            margin-top: 16px;
            justify-content: flex-end;
        }

        /* ================================================================
           TOAST
           ================================================================ */
        .toast-notification {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: var(--surface);
            padding: 12px 18px;
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            border-right: 3px solid var(--accent);
            z-index: 9999;
            animation: slideUp 0.3s ease forwards;
            max-width: 380px;
            font-size: 12.5px;
        }

        .toast-notification.toast-success {
            border-right-color: var(--success);
        }

        .toast-notification.toast-error {
            border-right-color: var(--danger);
        }

        .toast-notification.toast-warning {
            border-right-color: var(--warning);
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

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

        /* ================================================================
           SHIMMER
           ================================================================ */
        .shimmer {
            background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
            background-size: 200% 100%;
            animation: shimmer-animation 1.5s ease-in-out infinite;
            border-radius: var(--radius-sm);
        }

        @keyframes shimmer-animation {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }

        /* ================================================================
           FOOTER - تذييل الصفحة
           ================================================================ */
        .footer-custom {
            background: var(--surface);
            border-top: 2px solid var(--border);
            padding: 12px 24px;
            flex-shrink: 0;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
            margin-top: auto;
        }

        .footer-custom .footer-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            max-width: 1400px;
            margin: 0 auto;
        }

        .footer-custom .footer-right {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .footer-custom .footer-brand {
            font-family: var(--font-display);
            font-weight: 700;
            color: var(--text);
            font-size: 13px;
        }

        .footer-custom .footer-brand span {
            color: var(--accent);
        }

        .footer-custom .footer-copy {
            font-size: 12px;
        }

        .footer-custom .footer-copy strong {
            color: var(--accent-dark);
            font-weight: 700;
        }

        .footer-custom .footer-divider {
            color: var(--border);
            font-size: 14px;
        }

        .footer-custom .footer-left {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .footer-custom .footer-version {
            font-family: var(--font-display);
            font-size: 11px;
            color: var(--text-tertiary);
            background: var(--bg);
            padding: 2px 10px;
            border-radius: var(--radius-full);
        }

        .footer-custom .footer-link {
            color: var(--text-tertiary);
            transition: var(--t-base);
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
        }

        .footer-custom .footer-link:hover {
            color: var(--accent);
        }

        /* ================================================================
           RESPONSIVE
           ================================================================ */
        @media (max-width: 1200px) {
            .sidebar {
                transform: translateX(calc(var(--sidebar-width) + 20px));
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .main-content {
                margin-right: 0;
            }
            .sidebar-overlay.active {
                display: block;
            }
        }

        @media (max-width: 992px) {
            .dashboard-content {
                padding: 16px 18px;
            }
            .navbar-custom {
                padding: 0 16px;
            }
            .user-info {
                display: none;
            }
            .page-header .ph-right {
                display: none;
            }
            .navbar-logo-text {
                display: none;
            }
            .footer-custom .footer-divider {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .navbar-right .nav-btn:not(:first-child) {
                display: none;
            }
            .navbar-custom {
                height: 54px;
                padding: 0 12px;
            }
            .page-title {
                font-size: 14px;
            }
            .page-title small {
                display: none;
            }
            .sidebar-toggle {
                width: 28px;
                height: 28px;
                font-size: 14px;
            }
            .dashboard-content {
                padding: 12px 12px;
            }
            .page-header h2 {
                font-size: 15px;
            }
            .stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 8px;
            }
            .stat-card .stat-number {
                font-size: 16px;
            }
            .table-custom {
                font-size: 11px;
            }
            .table-custom th,
            .table-custom td {
                padding: 6px 8px;
            }
            .modal-box {
                padding: 20px;
            }
            .navbar-logo-img {
                height: 24px;
                width: 24px;
            }
            .footer-custom {
                padding: 8px 14px;
            }
            .footer-custom .footer-content {
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 4px;
            }
            .footer-custom .footer-right {
                flex-wrap: wrap;
                justify-content: center;
                font-size: 11px;
            }
            .footer-custom .footer-left {
                font-size: 11px;
                flex-wrap: wrap;
                justify-content: center;
            }
        }

        @media (max-width: 576px) {
            .dashboard-content {
                padding: 10px 10px;
            }
            .stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 6px;
            }
            .stat-card {
                padding: 10px 12px;
            }
            .stat-card .stat-number {
                font-size: 14px;
            }
            .stat-card .stat-label {
                font-size: 9px;
            }
            .stat-card .stat-icon {
                font-size: 14px;
            }
            .user-avatar {
                width: 28px;
                height: 28px;
                font-size: 11px;
            }
            .modal-box {
                padding: 16px;
            }
            .modal-box h3 {
                font-size: 15px;
            }
            .footer-custom .footer-copy {
                font-size: 10px;
            }
            .footer-custom .footer-version {
                font-size: 10px;
                padding: 1px 8px;
            }
        }

        /* ================================================================
           DARK MODE
           ================================================================ */
        body.dark-mode {
            background: var(--primary-dark);
            color: #e0dcd2;
        }

        body.dark-mode .navbar-custom {
            background: var(--primary-dark);
            border-bottom-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .navbar-logo-text {
            color: #e0dcd2;
        }

        body.dark-mode .stat-card {
            background: var(--primary);
            border-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .stat-card .stat-number {
            color: #e0dcd2;
        }

        body.dark-mode .panel {
            background: var(--primary);
            border-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .panel-header {
            border-bottom-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .table-custom thead {
            background: var(--primary-light);
        }

        body.dark-mode .table-custom th {
            color: rgba(232,228,220,0.4);
            border-bottom-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .table-custom td {
            border-bottom-color: rgba(255,255,255,0.04);
            color: #e0dcd2;
        }

        body.dark-mode .table-custom tr:hover td {
            background: var(--primary-light);
        }

        body.dark-mode .page-header {
            border-bottom-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .page-header .ph-left h2 {
            color: #e0dcd2;
        }

        body.dark-mode .page-header .ph-left p {
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .btn-outline {
            border-color: rgba(255,255,255,0.08);
            color: rgba(232,228,220,0.6);
        }

        body.dark-mode .btn-outline:hover {
            border-color: var(--accent);
            color: var(--accent-light);
            background: rgba(220, 38, 38, 0.1);
        }

        body.dark-mode .btn-primary {
            background: var(--accent);
            border-color: var(--accent);
            color: var(--text);
        }

        body.dark-mode .btn-primary:hover {
            background: var(--accent-light);
            border-color: var(--accent-light);
            color: var(--text);
        }

        body.dark-mode .btn-success {
            background: #166a4a;
            border-color: #166a4a;
        }

        body.dark-mode .btn-danger {
            background: #a03d32;
            border-color: #a03d32;
        }

        body.dark-mode .sidebar-toggle {
            border-color: rgba(255,255,255,0.08);
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .sidebar-toggle:hover {
            background: var(--primary);
            border-color: rgba(255,255,255,0.15);
            color: #e0dcd2;
        }

        body.dark-mode .nav-btn {
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .nav-btn:hover {
            background: var(--primary);
            color: #e0dcd2;
        }

        body.dark-mode .user-profile:hover {
            background: var(--primary);
            border-color: rgba(255,255,255,0.08);
        }

        body.dark-mode .user-name {
            color: #e0dcd2;
        }

        body.dark-mode .toast-notification {
            background: var(--primary);
            color: #e0dcd2;
            border-right-color: var(--accent);
        }

        body.dark-mode .toast-notification.toast-success {
            border-right-color: var(--success);
        }

        body.dark-mode .toast-notification.toast-error {
            border-right-color: var(--danger);
        }

        body.dark-mode .toast-notification.toast-warning {
            border-right-color: var(--warning);
        }

        body.dark-mode .modal-box {
            background: var(--primary);
            color: #e0dcd2;
        }

        body.dark-mode .modal-box h3 {
            color: #e0dcd2;
        }

        body.dark-mode .modal-box select,
        body.dark-mode .modal-box input {
            background: var(--primary-light);
            color: #e0dcd2;
            border-color: rgba(255,255,255,0.08);
        }

        body.dark-mode .modal-box select:focus,
        body.dark-mode .modal-box input:focus {
            border-color: var(--accent);
        }

        body.dark-mode .badge-admin {
            background: rgba(58, 107, 143, 0.2);
            color: #8ab4d4;
        }

        body.dark-mode .badge-finance {
            background: rgba(30, 122, 85, 0.2);
            color: #7bc4a0;
        }

        body.dark-mode .badge-user {
            background: rgba(184, 148, 58, 0.2);
            color: #d4b87a;
        }

        body.dark-mode .btn-icon-edit {
            background: rgba(58, 107, 143, 0.2);
            color: #8ab4d4;
        }

        body.dark-mode .btn-icon-edit:hover {
            background: var(--info);
            color: white;
        }

        body.dark-mode .btn-icon-delete {
            background: rgba(184, 74, 62, 0.2);
            color: #dba09a;
        }

        body.dark-mode .btn-icon-delete:hover {
            background: var(--danger);
            color: white;
        }

        body.dark-mode .shimmer {
            background: linear-gradient(90deg, var(--primary-light) 25%, var(--primary) 50%, var(--primary-light) 75%);
        }

        body.dark-mode .footer-custom {
            background: var(--primary);
            border-top-color: rgba(255,255,255,0.06);
        }

        body.dark-mode .footer-custom .footer-brand {
            color: #e0dcd2;
        }

        body.dark-mode .footer-custom .footer-copy {
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .footer-custom .footer-copy strong {
            color: var(--accent-light);
        }

        body.dark-mode .footer-custom .footer-version {
            background: var(--primary-light);
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .footer-custom .footer-link {
            color: rgba(232,228,220,0.5);
        }

        body.dark-mode .footer-custom .footer-link:hover {
            color: var(--accent-light);
        }
    
        /* ================================================================
           STATUS BADGES (إضافي)
           ================================================================ */
        .status-badge {
            padding: 1px 8px;
            border-radius: var(--radius-full);
            font-size: 9px;
            font-weight: 600;
            display: inline-block;
            font-family: var(--font-display);
        }
        .status-active { background: var(--success-bg); color: var(--success); }
        .status-pending { background: var(--warning-bg); color: var(--warning); }
        .status-completed { background: var(--info-bg); color: var(--info); }
        .status-cancelled { background: var(--danger-bg); color: var(--danger); }
        .status-info { background: var(--info-bg); color: var(--info); }

    

/* ===== تثبيت التذييل أسفل الشاشة بدون تمرير إجباري ===== */
html, body {
    height: 100%;
    margin: 0;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 13.5px !important;
}
body > .sidebar { flex-shrink: 0; }
body > .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.dashboard-content {
    flex: 1 0 auto;
}
.footer-custom {
    flex-shrink: 0;
    margin-top: auto;
}
/* توحيد أحجام الخطوط كما في الأصل */
.page-title { font-size: 15px !important; }
.page-title small { font-size: 11px !important; }
.page-header h2 { font-size: 17px !important; }
.page-header p { font-size: 12.5px !important; }
.stat-value { font-size: 21px !important; }
.stat-label { font-size: 11px !important; }
.nav-list a { font-size: 12.5px !important; }
.navbar-logo-text { font-size: 14px !important; }
.table-erp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-erp thead th {
    background: var(--surface-alt, var(--surface-alt));
    padding: 9px 12px;
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, var(--text-secondary));
    border-bottom: 1px solid var(--border, var(--border));
    white-space: nowrap;
}
.table-erp tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-light, var(--border-light));
    font-size: 12.5px;
}
.table-erp tbody tr:hover { background: rgba(220,38,38,0.05); }
.toolbar-erp { display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:space-between; margin-bottom:12px; }
.search-erp {
    display:flex; align-items:center; gap:8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 7px 12px; min-width: 220px;
}
.search-erp input { border:none; outline:none; background:transparent; font-family:inherit; font-size:12.5px; width:100%; color:var(--text); }
.btn-erp {
    display:inline-flex; align-items:center; gap:6px; padding:7px 14px;
    border-radius: 8px; font-family:inherit; font-size:12.5px; font-weight:600;
    cursor:pointer; border:1px solid transparent;
}
.btn-erp-primary { background: var(--accent); color:#fff; }
.btn-erp-outline { background: var(--surface); border-color: var(--border); color: var(--text-secondary); }
.badge { display:inline-block; padding:2px 9px; border-radius:9999px; font-size:10.5px; font-weight:600; }
.badge-success { background:#e6f3ec; color:#1c7a4e; }
.badge-danger { background:#f7e8e6; color:#ad3f39; }
.badge-warning { background:#f6eee1; color:#ad7f2e; }
.badge-info { background:#e6edf4; color:#2d6088; }
.badge-secondary { background:#f0eee8; color:var(--text-secondary); }
.empty-erp { text-align:center; padding:36px 16px; color:var(--text-tertiary); font-size:12.5px; }
.empty-erp i { font-size:28px; display:block; margin-bottom:8px; opacity:0.35; }
.card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}


/* ===== تقارير — مطابق للتصميم الأصلي ===== */
.report-tabs {
    display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.report-tab {
    padding: 10px 18px; border: none; background: transparent; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 700;
    color: var(--text-secondary); border-bottom: 3px solid transparent;
    transition: all .15s;
}
.report-tab:hover { color: var(--accent); }
.report-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.report-tab-panel { display: none; }
.report-tab-panel.active { display: block; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border-light, var(--border-light));
}
.panel-title { font-size: 13.5px; font-weight: 700; margin: 0; }
.record-count { font-size: 11.5px; color: var(--text-tertiary); }

.chart-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 14px 16px;
}
.chart-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.chart-header h6 { font-size: 13px; font-weight: 700; margin: 0; }
.chart-badge {
    font-size: 10.5px; padding: 2px 8px; border-radius: 9999px;
    background: rgba(220,38,38,.1); color: var(--accent); font-weight: 600;
}
.chart-bars {
    display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px;
}
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar-group { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; justify-content: center; }
.chart-bar {
    width: 14px; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 4px;
}
.chart-bar.sec { background: #ad3f39; opacity: .8; }
.chart-bar-label { font-size: 10px; color: var(--text-tertiary); margin-top: 6px; }

.stat-card .stat-number { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-card .stat-icon { float: left; font-size: 18px; color: var(--accent); opacity: .5; }
.stat-gold .stat-number { color: var(--accent); }
.stat-green .stat-number { color: var(--success); }
.stat-red .stat-number { color: var(--danger); }
.stat-blue .stat-number { color: var(--info); }

.table-custom { width: 100%; border-collapse: collapse; }
.table-custom thead th {
    background: var(--surface-alt, var(--surface-alt)); padding: 9px 12px; text-align: right;
    font-size: 11px; font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.table-custom tbody td {
    padding: 9px 12px; border-bottom: 1px solid var(--border-light, var(--border-light)); font-size: 12.5px;
}
.table-custom tbody tr:hover { background: rgba(220,38,38,.05); }
.table-custom tfoot td { font-weight: 800; border-top: 2px solid var(--border); background: var(--surface-alt, var(--surface-alt)); }
.table-wrap { overflow-x: auto; }

.report-cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.report-link-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 18px 16px; transition: all .15s;
}
.report-link-card:hover {
    border-color: var(--accent); box-shadow: 0 4px 14px rgba(14,28,46,.06); transform: translateY(-2px);
}
.report-link-card .ric-icon {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: rgba(220,38,38,.1); color: var(--accent); font-size: 18px; margin-bottom: 12px;
}
.report-link-card h5 { font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.report-link-card p { font-size: 12px; color: var(--text-tertiary); margin: 0; }


/* ===== نوافذ منبثقة احترافية (فوق كل العناصر) ===== */
.erp-modal-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(14, 28, 46, 0.5) !important;
    z-index: 10000 !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    overflow-y: auto;
}
.erp-modal-overlay.is-open {
    display: flex !important;
}
.erp-modal-box {
    background: var(--surface, #fff);
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(14, 28, 46, 0.22);
    border: 1px solid var(--border, var(--border));
    margin: auto;
}
.erp-modal-box.modal-lg { max-width: 820px; }
.erp-modal-box.modal-xl { max-width: 960px; }
.erp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, var(--border));
    position: sticky;
    top: 0;
    background: var(--surface, #fff);
    z-index: 1;
}
.erp-modal-header strong, .erp-modal-title {
    font-size: 14px;
    font-weight: 700;
}
.erp-modal-close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-tertiary, var(--text-tertiary));
    line-height: 1;
    padding: 4px 8px;
}
.erp-modal-body { padding: 16px 18px; }
.erp-modal-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px solid var(--border, var(--border));
    position: sticky;
    bottom: 0;
    background: var(--surface, #fff);
}

/* هوية العلامة */
.brand-mark {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.nav-list a.active {
    background: rgba(220, 38, 38, 0.14) !important;
}
.nav-list a.active i { color: #f87171 !important; }
.nav-list a.active::before {
    background: #dc2626 !important;
}
.btn-erp-primary, .btn-primary {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}
.btn-erp-primary:hover, .btn-primary:hover {
    background: #b91c1c !important;
}
.stat-gold .stat-number { color: #dc2626 !important; }
.chart-bar { background: #dc2626 !important; }
.chart-bar.sec { background: #0f172a !important; opacity: 0.85; }
.chart-badge {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #dc2626 !important;
}
#fabMain, .fab-main {
    background: #dc2626 !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4) !important;
}
.report-link-card .ric-icon {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #dc2626 !important;
}
.report-tab.active {
    color: #dc2626 !important;
    border-bottom-color: #dc2626 !important;
}

/* QuickData dark — متوافق مع الهوية الحمراء */
body.dark-mode, .dark-mode {
    --bg: #020617;
    --surface: #0f172a;
    --surface-alt: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-tint: rgba(220, 38, 38, 0.15);
}
.dark-mode .sidebar { background: #020617; }
.dark-mode .btn-erp-outline {
    background: var(--surface-alt);
    color: var(--text-secondary);
}
