/* Glassmorphism Dark Theme v3 — финальная */

:root {
    --bg: #0a0a14;
    --glass: rgba(20, 20, 50, 0.55);
    --glass-hover: rgba(30, 30, 70, 0.7);
    --border: rgba(255, 255, 255, 0.06);
    --text: #d4d4dc;
    --soft-white: #e8e8f0;
    --accent: #ff6b7a;
    --accent2: #ffb84d;
    --radius: 20px;
}

html, body {
    background: linear-gradient(160deg, #08081a 0%, #14143a 50%, #0a0a24 100%) !important;
    color: var(--text) !important;
    min-height: 100vh;
}

/* Принудительно тёмная тема — всегда */
html[data-theme="light"], html[data-theme="auto"], :root {
    --body-bg: #0a0a14 !important;
    --darkened-bg: #1a1a2e !important;
    --hairline-color: rgba(255,255,255,0.06) !important;
}

/* Header */
#header {
    background: rgba(10, 10, 25, 0.65) !important;
    backdrop-filter: blur(24px) saturate(120%);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
    border-bottom: 1px solid var(--border) !important;
}

/* Убираем надпись и кнопку темы */
#branding h1, #header #branding h1, #site-name { display: none !important; }
#header button.theme-toggle, button.theme-toggle, [class*="theme-toggle"] { display: none !important; }

/* Sidebar */
#nav-sidebar {
    background: rgba(10, 10, 25, 0.45) !important;
    backdrop-filter: blur(24px) saturate(120%);
    border-right: 1px solid var(--border) !important;
}
#nav-sidebar a { color: #b0b0c0 !important; border-radius: 12px !important; margin: 2px 6px !important; padding: 10px 14px !important; }
#nav-sidebar a:hover { color: var(--soft-white) !important; background: var(--glass-hover) !important; }

/* ВСЕ карточки и таблицы */
.module, .results, .change-form, #content, #main, .dashboard, 
.app-list, .model-list, table, .form-row, .aligned, .submit-row,
.inline-group, .tabular, .stacked {
    background: var(--glass) !important;
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--text) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
}

.module h2, .module caption, .inline-group h2 {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--accent2) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* Таблицы */
table { background: transparent !important; }
thead th, th {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--accent2) !important;
    border-color: var(--border) !important;
}
td, tbody td { border-color: var(--border) !important; color: #c8c8d4 !important; background: transparent !important; }
tr:nth-child(even) td { background: rgba(255,255,255,0.01) !important; }
tr:hover td { background: var(--glass-hover) !important; }

/* Кнопки */
.button, input[type="submit"], input[type="button"], .submit-row input, button {
    background: rgba(255, 107, 122, 0.15) !important;
    border: 1px solid rgba(255, 107, 122, 0.25) !important;
    color: var(--soft-white) !important;
    border-radius: 14px !important;
    padding: 11px 20px !important;
    backdrop-filter: blur(10px);
}
.button:hover, input[type="submit"]:hover { background: rgba(255, 107, 122, 0.3) !important; }
.button.default { background: rgba(46, 213, 115, 0.2) !important; border-color: rgba(46, 213, 115, 0.3) !important; }

/* Инпуты */
input[type="text"], input[type="password"], input[type="email"], textarea, select, .vTextField, .vLargeTextField {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border) !important;
    color: var(--soft-white) !important;
    border-radius: 14px !important;
    padding: 11px 14px !important;
}

/* Ссылки */
a { color: var(--accent2) !important; }
a:hover { color: var(--soft-white) !important; }

/* Хлебные крошки */
#breadcrumbs { background: transparent !important; color: #888 !important; }

/* Пагинация */
.paginator a { background: var(--glass) !important; border-radius: 12px !important; }

/* Свечение */
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -20%; right: -20%; bottom: -50%;
    background: radial-gradient(ellipse at 30% 40%, rgba(255, 107, 122, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(255, 184, 77, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Скроллбар */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

/* Мобилка */
@media (max-width: 768px) {
    .module, .results, #content { border-radius: 16px !important; }
}
