diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php
index f8c9642a2..9f9f41f06 100644
--- a/resources/views/layouts/admin.blade.php
+++ b/resources/views/layouts/admin.blade.php
@@ -5,14 +5,13 @@
+ {{-- Apply dark mode BEFORE any CSS loads to prevent white flash --}}
+ @include('partials.theme-init')
+
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 77d2c3bed..1a3058519 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -7,6 +7,9 @@
+ {{-- Apply dark mode BEFORE any CSS loads to prevent white flash --}}
+ @include('partials.theme-init')
+
{{ config('app.name', 'Laravel') }}
diff --git a/resources/views/layouts/guest.blade.php b/resources/views/layouts/guest.blade.php
index 3685f1014..08d5cc2d2 100644
--- a/resources/views/layouts/guest.blade.php
+++ b/resources/views/layouts/guest.blade.php
@@ -6,6 +6,9 @@
+ {{-- Apply dark mode BEFORE any CSS loads to prevent white flash --}}
+ @include('partials.theme-init')
+
{{ config('app.name') }}
diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php
index f84b2e2a4..c95541c32 100644
--- a/resources/views/layouts/main.blade.php
+++ b/resources/views/layouts/main.blade.php
@@ -8,6 +8,9 @@
+ {{-- Apply dark mode BEFORE any CSS loads to prevent white flash --}}
+ @include('partials.theme-init')
+
{{ $meta_title ?? config('app.name') }}@if(isset($meta_title) && $meta_title != '' && $site['metatitle'] != '') - @endif{{ $site['metatitle'] ?? '' }}
@@ -25,36 +28,6 @@
@vite(['resources/css/app.css', 'resources/js/app.js'])
@stack('styles')
-
-
-
diff --git a/resources/views/partials/theme-init.blade.php b/resources/views/partials/theme-init.blade.php
new file mode 100644
index 000000000..c0f01522b
--- /dev/null
+++ b/resources/views/partials/theme-init.blade.php
@@ -0,0 +1,19 @@
+{{--
+ Dark mode initialization - MUST be included at the very top of ,
+ BEFORE any CSS/Vite tags, to prevent white flash on page load.
+ This tiny blocking script applies the 'dark' class to synchronously
+ before the browser paints any content.
+--}}
+