        html, body { overflow-x: hidden; max-width: 100vw; }
        body { font-family: 'Cairo', sans-serif; transition: background-color 0.3s ease, color 0.3s ease; }
        .hidden-section { display: none !important; }
        .hidden:not([class*="md:"]):not([class*="lg:"]):not([class*="sm:"]) { display: none !important; }
        .health-bar-track { width: 100%; max-width: 250px; height: 12px; border-radius: 9999px; overflow: hidden; }
        .health-bar-fill { height: 100%; transition: width 0.5s ease, background-color 0.5s ease; }

        /* Number Input Spinners and Controls */
        @keyframes ping {
            75%, 100% {
                transform: scale(2.2);
                opacity: 0;
            }
        }
        .animate-ping {
            animation: ping 1.2s cubic-bezier(0, 0, 0.2, 1) infinite;
        }

        @keyframes inputShakeAnim {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-6px); }
            40%, 80% { transform: translateX(6px); }
        }
        .input-shake-error {
            animation: inputShakeAnim 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
        }
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: inner-spin-button !important;
            opacity: 1 !important;
            display: inline-block !important;
        }
        input[type=number] {
            -moz-appearance: number-input !important;
        }

        /* ==========================================================================
           SAFE AREA INSETS & MOBILE UX ESSENTIALS (Notch, Dynamic Island, Gesture Bar)
           ========================================================================== */
        :root {
            --sat: env(safe-area-inset-top, 0px);
            --sab: env(safe-area-inset-bottom, 0px);
            --sal: env(safe-area-inset-left, 0px);
            --sar: env(safe-area-inset-right, 0px);
        }

        /* Native App Touch & Interaction Optimizations */
        button, a, input, select, textarea {
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        /* Safe Area Padding Utilities */
        .safe-area-pt {
            padding-top: max(0.5rem, calc(0.25rem + env(safe-area-inset-top, 0px)));
        }
        .safe-area-pb {
            padding-bottom: max(0.75rem, calc(0.35rem + env(safe-area-inset-bottom, 0px)));
        }
        .safe-area-px {
            padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
            padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
        }

        /* Sticky Top Header Notch Guard */
        header.sticky.top-0,
        #appHeaderSticky {
            padding-top: max(0.5rem, calc(0.35rem + env(safe-area-inset-top, 0px)));
        }

        /* Landing Screen Notch Guard */
        #landingScreen > div:first-child {
            padding-top: max(0.5rem, calc(0.25rem + env(safe-area-inset-top, 0px)));
            padding-bottom: max(0.5rem, calc(0.25rem + env(safe-area-inset-bottom, 0px)));
        }

        /* Mobile Bottom Nav Bar Gesture Bar Guard */
        #mobileBottomNav {
            padding-bottom: max(0.5rem, calc(0.35rem + env(safe-area-inset-bottom, 0px)));
        }

        /* Mobile Content Area Bottom Margin Guard to prevent overlap with Nav Bar */
        @media (max-width: 767px) {
            #mainAppContainer,
            #mainAppContainer > div.max-w-7xl,
            .tab-view,
            body {
                padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
            }
        }

        /* ==========================================================================
           @media print - النمط الأصلي للطباعة
           ========================================================================== */
        @media print {
            body * { visibility: hidden !important; }
            body.in-print-iframe,
            body.in-print-iframe * {
                visibility: visible !important;
            }
            #reportPrintSection.active-print-target,
            #reportPrintSection.active-print-target *,
            #customReportPrintSection.active-print-target,
            #customReportPrintSection.active-print-target * {
                visibility: visible !important;
            }
            #reportPrintSection.active-print-target {
                position: absolute; left: 0; top: 0; width: 100%; display: block !important;
            }
            #customReportPrintSection.active-print-target {
                position: absolute; left: 0; top: 0; width: 100%; display: block !important;
            }
            @page {
                size: A4 portrait;
                margin: 10mm;
            }
            tr { page-break-inside: avoid; break-inside: avoid; }
            .print-break-inside-avoid { break-inside: avoid; page-break-inside: avoid; }
        }


        /* ==========================================================================
           Logo & Branding Consistency (ضمان تناسق أبعاد الشعار ومنع أي تشوه أو انضغاط)
           ========================================================================== */
        .brand-logo-header {
            height: 32px !important;
            width: auto !important;
            max-width: 140px;
            object-fit: contain !important;
            aspect-ratio: auto;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        .brand-logo-login {
            height: 76px !important;
            max-height: 92px !important;
            width: auto !important;
            max-width: 260px !important;
            object-fit: contain !important;
            aspect-ratio: auto;
            display: block;
            margin: 0 auto;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        .brand-logo-report {
            height: 54px !important;
            max-height: 64px !important;
            width: auto !important;
            max-width: 220px !important;
            object-fit: contain !important;
            aspect-ratio: auto;
            flex-shrink: 0;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }

        /* Global image fit protection for brand logos */
        img[src*="logo"], 
        img[src*="Reports_And_App_Headers"],
        img[src*="icon"] {
            object-fit: contain !important;
        }

        /* ==========================================================================
           MODAL Z-INDEX & ACTIVE VISIBILITY GUARANTEES (Driver Tools, OBD & Reports)
           ========================================================================== */
        #driverToolsModal.active,
        #obdEncyclopediaModal.active,
        #customReportExportModal.active {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            width: 100vw !important;
            height: 100vh !important;
            z-index: 99999 !important;
            display: flex !important;
            opacity: 1 !important;
            visibility: visible !important;
            pointer-events: auto !important;
        }
        #driverToolsModal.hidden,
        #obdEncyclopediaModal.hidden,
        #customReportExportModal.hidden {
            display: none !important;
            pointer-events: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
        }

        @media (min-width: 640px) {
            #driverToolsModal.active,
            #obdEncyclopediaModal.active,
            #customReportExportModal.active,
            .modal-bottom-sheet.active {
                align-items: center !important;
                justify-content: center !important;
                padding: 1.5rem !important;
            }
            #driverToolsModal > div,
            #obdEncyclopediaModal > div,
            #customReportExportModal > div,
            .modal-bottom-sheet > div {
                max-height: 90vh !important;
                margin-left: auto !important;
                margin-right: auto !important;
                margin-top: auto !important;
                margin-bottom: auto !important;
                box-sizing: border-box !important;
            }
        }

        /* ==========================================================================
           NATIVE-STYLE BOTTOM SHEET (Material 3 & iOS Standard)
           ========================================================================== */
        @media (max-width: 639px) {
            .modal-bottom-sheet {
                align-items: flex-end !important;
                padding: 0 !important;
            }
            .modal-bottom-sheet > div {
                border-radius: 24px 24px 0 0 !important;
                max-height: 88vh !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                animation: bottomSheetSlideIn 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
            }
        }
        @keyframes bottomSheetSlideIn {
            from {
                transform: translateY(100%);
                opacity: 0.85;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        .drag-handle-bar {
            width: 44px;
            height: 5px;
            border-radius: 9999px;
            margin: 6px auto 10px auto;
            background-color: #cbd5e1;
            flex-shrink: 0;
            cursor: grab;
        }
        .dark .drag-handle-bar {
            background-color: #334155;
        }

        /* Spacing & Typography Refinement */
        .card-compact {
            padding: 12px 14px !important;
        }
        .badge-compact {
            padding: 2px 7px !important;
            font-size: 10px !important;
            font-weight: 800 !important;
            border-radius: 8px !important;
        }
