/* =====================================================
   NewLife — Night Theme (Smooth + No White Blocks + Mobile Fast)
   ===================================================== */

/* ===== БАЗОВЫЙ ФОН (как на странице проверок, но оптимизированный) ===== */
html, body {
    background:
        radial-gradient(1100px 650px at 12% 10%, rgba(96,165,250,.26), rgba(0,0,0,0) 62%),
        radial-gradient(900px 520px at 88% 14%, rgba(34,197,94,.16), rgba(0,0,0,0) 58%),
        radial-gradient(980px 520px at 55% 0%, rgba(168,85,247,.14), rgba(0,0,0,0) 60%),
        radial-gradient(720px 520px at 22% 92%, rgba(59,130,246,.10), rgba(0,0,0,0) 60%),
        linear-gradient(180deg, #0b1220 0%, #0b0f17 55%, #0a0c14 100%) !important;
    background-repeat: no-repeat !important;
    color: #e6eaf2 !important;
}

/* На мобильных fixed-фон часто лагает — отключаем */
@media (max-width: 900px) {
    html, body {
        background-attachment: scroll !important;
    }
}

/* ===== ПЛАВНОСТЬ (лёгкая, без лагов) ===== */
* {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===== УНИВЕРСАЛЬНО УБИВАЕМ “БЕЛЫЕ” КЛАССЫ ===== */
.bg-white,
.white,
.white-bg,
.white-box,
.panel-white,
.card-white,
.bg-light,
.bg-default {
    background: rgba(15,20,34,.88) !important;
    color: #e6eaf2 !important;
}

/* ===== ОСНОВНЫЕ КОНТЕЙНЕРЫ/БЛОКИ (самое важное) ===== */
.wrapper,
.content-wrapper,
.main-panel,
.page-content,
.container,
.container-fluid,
.content,
.content-body,
#content,
.panel,
.panel-body,
.panel-heading,
.card,
.card-body,
.card-header,
.box,
.box-body,
.box-header,
.widget,
.widget-body,
.widget-content,
.tile,
.tile-body,
.modal-content,
.dropdown-menu,
.popover,
.tooltip-inner,
.list-group,
.list-group-item,
.nav-tabs,
.tab-content {
    background: rgba(15,20,34,.88) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* Тени делаем лёгкими (тяжёлые тени лагали) */
.panel,
.card,
.box,
.widget,
.modal-content,
.dropdown-menu,
.list-group-item {
    box-shadow: 0 10px 28px rgba(0,0,0,.26) !important;
    border-radius: 12px !important;
}

/* Убираем тяжёлый blur (он и делал “глючит”) */
.panel,
.card,
.box,
.widget,
.modal-content,
.dropdown-menu {
    backdrop-filter: none !important;
}

/* ===== ШАПКА / SIDEBAR ===== */
.sidebar,
.left-sidebar,
.sidebar-nav,
.navbar,
.navbar-default,
.navbar-header,
.topbar,
.header,
.app-header {
    background: rgba(11,16,32,.94) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* Ссылки и пункты меню */
.sidebar a,
.left-sidebar a,
.navbar a,
.sidebar-nav a,
.nav > li > a {
    color: rgba(230,234,242,.86) !important;
}
.sidebar a:hover,
.left-sidebar a:hover,
.navbar a:hover,
.sidebar-nav a:hover,
.nav > li > a:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,.04) !important;
}

/* ===== ТЕКСТ / ЗАГОЛОВКИ ===== */
h1, h2, h3, h4, h5, h6,
.title, .page-title, .panel-title {
    color: #f7f8fb !important;
}

/* Серый текст делаем читаемым */
small, .text-muted, .muted, .help-block {
    color: rgba(230,234,242,.60) !important;
}

/* ===== ТАБЛИЦЫ (включая “белые” обёртки) ===== */
.table,
table,
thead,
tbody,
tr,
td,
th,
.table-responsive,
.dataTables_wrapper,
.dataTables_scrollBody {
    background: rgba(15,20,34,.88) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

thead tr,
.table thead tr {
    background: rgba(31,41,55,.92) !important;
    color: #ffffff !important;
}

/* Чередование строк */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255,255,255,.03) !important;
}

/* ===== ФОРМЫ ===== */
input,
select,
textarea,
.form-control,
.input-group-addon,
.select2-container--default .select2-selection--single,
.select2-dropdown {
    background: rgba(11,16,32,.94) !important;
    color: #e6eaf2 !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
}

input::placeholder,
textarea::placeholder {
    color: rgba(230,234,242,.55) !important;
}

/* ===== КНОПКИ ===== */
.btn,
.btn-default,
.btn-primary,
.btn-success,
.btn-danger,
.btn-warning {
    background: linear-gradient(180deg, rgba(37,99,235,.95), rgba(29,78,216,.92)) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(37,99,235,.18) !important;
}
.btn:hover { filter: brightness(1.08); }

/* Серые вторичные кнопки */
.btn-default,
.btn-secondary {
    background: rgba(31,41,55,.92) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.22) !important;
}

/* ===== ССЫЛКИ ===== */
a { color: #7aa2ff !important; }
a:hover { color: #a5b4fc !important; text-decoration: none !important; }

/* ===== МОДАЛКИ / ВСПЛЫВАШКИ ===== */
.modal-header,
.modal-footer {
    background: rgba(15,20,34,.92) !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* ===== FOOTER ===== */
footer,
.page-footer {
    background: rgba(11,16,32,.94) !important;
    color: rgba(230,234,242,.75) !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
}

/* ===== МЕЛОЧИ ===== */
hr { border-color: rgba(255,255,255,.10) !important; }

/* Плавный скролл / меньше “дёрганий” на мобилках */
* {
    -webkit-overflow-scrolling: touch;
}

/* ===== FIX: SIDEBAR STILL WHITE ===== */

/* Сам контейнер сайдбара */
#sidebar,
#left-sidebar,
#side-menu,
.aside,
aside,
.left-aside,
.sidebar-container,
.sidebar-content,
.sidenav,
.side-nav,
.drawer,
.mdl-layout__drawer,
.mdl-layout__drawer .mdl-navigation,
.mdl-layout__drawer-button {
    background: rgba(11,16,32,.94) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* Внутренние блоки/обёртки внутри меню */
#sidebar * ,
#left-sidebar * ,
#side-menu * ,
aside * ,
.left-aside * ,
.sidebar-container * ,
.sidebar-content * ,
.sidenav * ,
.side-nav * ,
.drawer * ,
.mdl-layout__drawer * {
    border-color: rgba(255,255,255,.10) !important;
}

/* Пункты меню */
#sidebar a,
#left-sidebar a,
#side-menu a,
aside a,
.left-aside a,
.sidebar-container a,
.sidebar-content a,
.sidenav a,
.side-nav a,
.drawer a,
.mdl-layout__drawer a,
.mdl-navigation__link {
    color: rgba(230,234,242,.86) !important;
    background: transparent !important;
}

/* Hover/active */
#sidebar a:hover,
#left-sidebar a:hover,
#side-menu a:hover,
aside a:hover,
.left-aside a:hover,
.sidebar-container a:hover,
.sidebar-content a:hover,
.sidenav a:hover,
.side-nav a:hover,
.drawer a:hover,
.mdl-layout__drawer a:hover,
.mdl-navigation__link:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,.05) !important;
}

/* Если фон задаётся на списках */
#sidebar ul,
#left-sidebar ul,
#side-menu ul,
aside ul,
.left-aside ul,
.sidebar-container ul,
.sidebar-content ul,
.sidenav ul,
.side-nav ul,
.drawer ul,
.mdl-layout__drawer ul {
    background: transparent !important;
}

/* ===== FIX: PAGINATION / PAGE INPUT ===== */

/* Контейнер пагинации */
.pagination,
.pagination-wrapper,
.dataTables_paginate,
.page-navigation {
    background: transparent !important;
}

/* Кнопки страниц */
.pagination .page-item .page-link,
.pagination a,
.page-link {
    background: rgba(15,20,34,.90) !important;
    color: #e6eaf2 !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 10px !important;
}

/* Активная страница */
.pagination .active .page-link,
.pagination .page-link.active {
    background: linear-gradient(
        180deg,
        rgba(37,99,235,.95),
        rgba(29,78,216,.92)
    ) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.22) !important;
}

/* Поле ввода номера страницы (ТО САМОЕ БЕЛОЕ) */
.pagination input,
.page-navigation input,
.dataTables_paginate input,
input[type="number"],
input[type="text"] {
    background: rgba(11,16,32,.94) !important;
    color: #e6eaf2 !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-radius: 10px !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05) !important;
}

/* Стрелки вперёд/назад */
.pagination .page-link:hover,
.pagination a:hover {
    background: rgba(255,255,255,.06) !important;
    color: #ffffff !important;
}

/* Убираем белые иконки-фоны */
.pagination svg,
.pagination img {
    background: transparent !important;
}

/* ===== Pagination: smooth animation + active glow ===== */

/* Плавное появление/нажатие */
.pagination .page-link,
.pagination a,
.page-link {
    transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease !important;
    will-change: transform;
}

/* Лёгкий “подъём” при наведении (на телефоне почти не мешает) */
.pagination .page-link:hover,
.pagination a:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,.25) !important;
}

/* Нажатие */
.pagination .page-link:active,
.pagination a:active {
    transform: translateY(0px) scale(0.98) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.22) !important;
}

/* Подсветка активной страницы (мягкий “неон”) */
.pagination .active .page-link,
.pagination .page-link.active,
.pagination li.active a {
    box-shadow:
        0 0 0 1px rgba(255,255,255,.16),
        0 10px 26px rgba(37,99,235,.28),
        0 0 22px rgba(168,85,247,.18) !important;
}

/* Чуть мягче края у активной */
.pagination .active .page-link,
.pagination .page-link.active,
.pagination li.active a {
    border-radius: 12px !important;
}

/* =====================================================
   FIX PACK — убираем оставшиеся белые модалки и блоки
   (вставь В САМЫЙ КОНЕЦ файла)
   ===================================================== */

/* ---------- 1) SweetAlert / Swal2 (белая модалка) ---------- */
.swal2-container,
.swal2-popup,
.swal2-modal,
.swal2-toast,
.swal-modal,
.swal-overlay,
.swal-overlay--show-modal,
.sweet-alert,
.sweet-overlay {
    background: rgba(15,20,34,.92) !important;
    color: #e6eaf2 !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 44px rgba(0,0,0,.35) !important;
}

/* Текст/заголовки/контент внутри модалки */
.swal2-title,
.swal2-html-container,
.swal2-content,
.swal-title,
.swal-text,
.sweet-alert h2,
.sweet-alert p {
    color: #e6eaf2 !important;
}

/* Кнопки в swal (если они внезапно серые/белые) */
.swal2-actions .swal2-confirm,
.swal2-actions .swal2-cancel,
.swal-button {
    background: linear-gradient(180deg, rgba(37,99,235,.95), rgba(29,78,216,.92)) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
}

/* Затемнение фона позади модалки */
.swal2-backdrop-show,
.swal-overlay {
    background: rgba(0,0,0,.55) !important;
}

/* ---------- 2) Дожим “белых карточек” на странице (часто inline background) ---------- */
/* Если где-то жёстко прописан белый фон через style="" */
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color:#fff"],
[style*="background-color: #fff"],
[style*="background-color:white"],
[style*="background-color: white"],
[style*="background:rgb(255,255,255)"],
[style*="background-color:rgb(255,255,255)"] {
    background: rgba(15,20,34,.88) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* Частые “белые контейнеры” в админках/шаблонах */
section,
.section,
.content-section,
.block,
.block-content,
.block-body,
.well,
.jumbotron,
.card-content,
.panel-default,
.panel-default > .panel-heading,
.panel-default > .panel-body,
.table-container,
.table-wrapper,
.profile,
.profile-box,
.profile-card,
.profile-content {
    background: rgba(15,20,34,.88) !important;
    color: #e6eaf2 !important;
    border-color: rgba(255,255,255,.10) !important;
}

/* ---------- 3) Комментарии / поле ввода (на скрине всё ещё белит) ---------- */
.comments,
.comment,
.comment-form,
.comment-box,
.comment-body,
.comment-input,
.add-comment,
.add-comment textarea,
.add-comment input,
textarea.comment,
input.comment,
[contenteditable="true"] {
    background: rgba(11,16,32,.94) !important;
    color: #e6eaf2 !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 12px !important;
}

/* Плейсхолдеры в комментариях */
.comments ::placeholder,
.comment-form ::placeholder,
.add-comment ::placeholder {
    color: rgba(230,234,242,.55) !important;
}

/* ---------- 4) На всякий: если белый фон задаётся псевдо-элементом ---------- */
.panel:before, .panel:after,
.card:before, .card:after,
.box:before, .box:after,
.widget:before, .widget:after {
    background: transparent !important;
}
