diff --git a/src/components/bookings/BookingModal.tsx b/src/components/bookings/BookingModal.tsx
index 7d9d24c..8d696d1 100644
--- a/src/components/bookings/BookingModal.tsx
+++ b/src/components/bookings/BookingModal.tsx
@@ -450,7 +450,12 @@ export function BookingModal({ open, draft, rooms, bookings = [], onClose, onSav
)}
- {/* 3. ФИО гостя */}
+
+
+ {/* ── RIGHT COLUMN ── */}
+
+
+ {/* Гость */}
-
-
- {/* 4. Взрослые / Дети / Статус */}
-
-
-
- set('adults', parseInt(e.target.value) || 1)}
- />
-
-
-
- set('children', parseInt(e.target.value) || 0)}
- />
-
-
-
-
+
+
+
+ set('adults', parseInt(e.target.value) || 1)}
+ />
+
+
+
+ set('children', parseInt(e.target.value) || 0)}
+ />
+
+
+
+
+
-
-
- {/* ── RIGHT COLUMN ── */}
-
-
{/* Доп. места */}
diff --git a/src/contexts/ThemeContext.tsx b/src/contexts/ThemeContext.tsx
index e061338..1efe964 100644
--- a/src/contexts/ThemeContext.tsx
+++ b/src/contexts/ThemeContext.tsx
@@ -12,9 +12,8 @@ interface ThemeContextValue {
const ThemeContext = createContext(null)
-function getAutoTheme(): Theme {
- const h = new Date().getHours()
- return h >= 7 && h < 22 ? 'light' : 'dark'
+function getSystemTheme(): Theme {
+ return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
export function ThemeProvider({ children }: { children: React.ReactNode }) {
@@ -26,14 +25,16 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
const stored = localStorage.getItem('hotelsync-theme') as ThemeMode | null
if (!stored || stored === 'light') return 'light'
if (stored === 'dark') return 'dark'
- return getAutoTheme()
+ return getSystemTheme()
})
useEffect(() => {
if (mode === 'auto') {
- setTheme(getAutoTheme())
- const interval = setInterval(() => setTheme(getAutoTheme()), 60_000)
- return () => clearInterval(interval)
+ setTheme(getSystemTheme())
+ const mq = window.matchMedia('(prefers-color-scheme: dark)')
+ const handler = (e: MediaQueryListEvent) => setTheme(e.matches ? 'dark' : 'light')
+ mq.addEventListener('change', handler)
+ return () => mq.removeEventListener('change', handler)
} else {
setTheme(mode)
}