/* Font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ================================
   Цвета текста: приближение к демо Super Admin 3.2
   Демо использует #dee2e6 (холодный серый) вместо rgba(255,255,255,0.85)
   ================================ */
body {
    color: #c6eced !important;
}

.text-muted,
.text-secondary {
    color: rgba(198, 236, 237, 0.55) !important;
}

.navigation li a {
    font-weight: 500 !important;
}

.navigation li:not(.navigation__active):not(.navigation__sub--active) a {
    color: #c6eced !important;
}

.navigation li:not(.navigation__active):not(.navigation__sub--active) a:hover {
    color: #e3f6f6 !important;
}

.navigation > .navigation__active > a,
.navigation > .navigation__sub--active > a {
    color: #4ade80 !important;
    font-weight: 500 !important;
}

p, span, div, li, td, th, label, small {
    color: inherit;
}

/* ================================
   Скроллинг только контента (сайдбар и навбар фиксированы)
   ================================ */
html, body {
    height: 100%;
    overflow: hidden !important;
}

.main {
    height: 100%;
    overflow: hidden;
}

@media (min-width: 1200px) {
    .content:not(.content--boxed):not(.content--full) {
        position: fixed !important;
        top: 60px;
        left: 250px;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 20px 30px 30px 30px !important;
    }
}

@media (max-width: 1199.98px) {
    .content {
        height: calc(100vh - 60px);
        margin-top: 60px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-top: 20px !important;
    }
}

/* Кастомный скроллбар для контента */
.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(198,236,237,.15);
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: rgba(198,236,237,.25);
}

/* Глобальные настройки отступов для карточек */

/* Уменьшаем отступы между рядами */
.row {
    margin-left: -8px;
    margin-right: -8px;
}

.row > [class*='col-'] {
    padding-left: 8px;
    padding-right: 8px;
}

/* Уменьшаем отступы между карточками */
.card {
    margin-bottom: 16px;
    overflow: hidden;
}

/* Уменьшаем отступы для quick-stats */
.quick-stats {
    margin-bottom: 16px;
}

.quick-stats > [class*='col-'] {
    padding-left: 8px;
    padding-right: 8px;
}

.quick-stats__item {
    margin-bottom: 0;
}

/* Уменьшаем отступы для widget-lists card-columns */
.widget-lists.card-columns {
    column-gap: 16px;
}

.widget-lists.card-columns .card {
    margin-bottom: 16px;
}

/* Уменьшаем отступы в content */
.content {
    padding: 20px;
}

/* Корректируем отступ заголовка контента */
.content__title {
    margin-bottom: 16px;
}

/* Адаптивные отступы для мобильных устройств */
@media (max-width: 767px) {
    .content {
        padding: 15px;
    }
    
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .row > [class*='col-'] {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .card {
        margin-bottom: 10px;
    }
}

/* ================================
   DataTables: выравнивание колонки чекбокса
   (thead может быть клонирован/перерисован, поэтому не привязываемся к #data-table)
   ================================ */
.dataTables_wrapper table.dataTable {
    table-layout: fixed;
}

.dataTables_wrapper table.dataTable thead th:first-child,
.dataTables_wrapper table.dataTable tbody td:first-child {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.dataTables_wrapper table.dataTable thead th:first-child::before,
.dataTables_wrapper table.dataTable thead th:first-child::after {
    display: none !important; /* иконки сортировки */
}

.dataTables_wrapper table.dataTable thead th:first-child .custom-control,
.dataTables_wrapper table.dataTable tbody td:first-child .custom-control {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-left: 0 !important; /* bootstrap custom-control */
    width: 100% !important;
    height: 100% !important;
}

.dataTables_wrapper table.dataTable thead th:first-child .custom-control-label::before,
.dataTables_wrapper table.dataTable thead th:first-child .custom-control-label::after,
.dataTables_wrapper table.dataTable tbody td:first-child .custom-control-label::before,
.dataTables_wrapper table.dataTable tbody td:first-child .custom-control-label::after {
    /* Центрируем сам "рисованный" квадрат чекбокса */
    top: 50% !important;
    left: 0% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
}

/* Убираем bootstrap-овский layout custom-checkbox (он рассчитан на текст справа) */
.dataTables_wrapper table.dataTable thead th:first-child .custom-control-label,
.dataTables_wrapper table.dataTable tbody td:first-child .custom-control-label {
    margin: 0 !important;
    padding: 0 !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    position: relative !important;
}

/* Шапка таблицы: не переносим текст заголовков */
.dataTables_wrapper table.dataTable thead th {
    white-space: nowrap;
    line-height: 1.2;
}

/* Если какой-то заголовок не помещается — аккуратно обрежем */
.dataTables_wrapper table.dataTable thead th > * {
    white-space: nowrap;
}

/* ID колонка: делаем компактнее и убираем ощущение "большого отступа справа" */
.dataTables_wrapper table.dataTable thead th:nth-child(2),
.dataTables_wrapper table.dataTable tbody td:nth-child(2) {
    width: 25px !important;
    min-width: 25px !important;
    max-width: 25px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

/* ================================
   Универсальный dropdown с размытым фоном
   ================================ */
.blur-bg-dropdown {
    overflow: hidden;
    background: url(/super_template/resources/img/bg/7.jpg) center/cover fixed;
    isolation: isolate;
    color: rgb(198, 236, 237);
    border: 0;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.15) 0px 8px 16px 0px;
}

/* Размытый фоновый слой */
.blur-bg-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(15px);
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* Темный оверлей */
.blur-bg-dropdown::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 0;
    pointer-events: none;
}

/* Контент должен быть поверх фона */
.blur-bg-dropdown > * {
    position: relative;
    z-index: 1;
}

/* ================================
   Bulk actions: убираем margin и vertical-align у иконок
   ================================ */
.bulk-actions-container .btn i,
.bulk-actions-container .btn--icon-text i {
    margin: 0 !important;
    vertical-align: baseline !important;
}

/* ================================
   Глобальные стили для чекбоксов в таблицах
   Размеры: 1.1rem x 1.1rem
   ================================ */
.custom-control-input {
    width: 1.1rem !important;
    height: 1.1rem !important;
}

.custom-control-label::before,
.custom-control-label::after {
    width: 1.1rem !important;
    height: 1.1rem !important;
}

/* Корректируем позиционирование для чекбоксов в таблицах */
.dataTables_wrapper table.dataTable .custom-control-label {
    width: 1.1rem !important;
    height: 1.1rem !important;
}

/* ================================
   Глобальные стили для выпадающих списков (select/option)
   ================================ */

/* Стили для option элементов во всех select */
select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Стили для option при наведении (работает не во всех браузерах) */
select option:hover {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
}

/* Стили для выбранного option */
select option:checked {
    background-color: #e0e0e0 !important;
    color: #000000 !important;
}

/* Дополнительно для select в таблицах */
table select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Для DataTables */
.dataTables_wrapper select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}


/* ================================
   Глобальные Glass UI стили для дропдаунов действий
   ================================ */

/* Стили для всех dropdown-menu в колонке действий таблиц */
table tbody td:last-child .dropdown-menu,
.dataTables_wrapper table tbody td:last-child .dropdown-menu {
    min-width: 180px;
    background-color: #09404c4f !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
    padding: 8px 0 !important;
    margin-top: 8px !important;
}

table tbody td:last-child .dropdown-item,
.dataTables_wrapper table tbody td:last-child .dropdown-item {
    padding: 10px 16px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease !important;
    border-radius: 0 !important;
}

table tbody td:last-child .dropdown-item:hover,
table tbody td:last-child .dropdown-item:focus,
.dataTables_wrapper table tbody td:last-child .dropdown-item:hover,
.dataTables_wrapper table tbody td:last-child .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 1) !important;
}

table tbody td:last-child .dropdown-item.text-danger,
.dataTables_wrapper table tbody td:last-child .dropdown-item.text-danger {
    color: rgba(220, 53, 69, 0.9) !important;
    font-weight: 600 !important;
}

table tbody td:last-child .dropdown-item.text-danger i,
.dataTables_wrapper table tbody td:last-child .dropdown-item.text-danger i {
    font-weight: bolder !important;
}

table tbody td:last-child .dropdown-item.text-danger:hover,
table tbody td:last-child .dropdown-item.text-danger:focus,
.dataTables_wrapper table tbody td:last-child .dropdown-item.text-danger:hover,
.dataTables_wrapper table tbody td:last-child .dropdown-item.text-danger:focus {
    background-color: rgba(220, 53, 69, 0.15) !important;
    color: rgba(220, 53, 69, 1) !important;
}

table tbody td:last-child .dropdown-item i,
.dataTables_wrapper table tbody td:last-child .dropdown-item i {
    margin-right: 8px;
    width: 16px;
    opacity: 0.8;
}

table tbody td:last-child .dropdown-item:hover i,
table tbody td:last-child .dropdown-item:focus i,
.dataTables_wrapper table tbody td:last-child .dropdown-item:hover i,
.dataTables_wrapper table tbody td:last-child .dropdown-item:focus i {
    opacity: 1;
}

/* Разделитель для дропдауна (если есть) */
table tbody td:last-child .dropdown-divider,
.dataTables_wrapper table tbody td:last-child .dropdown-divider {
    background-color: rgba(255, 255, 255, 0.1) !important;
    margin: 4px 0 !important;
}

/* ================================
   Глобальные стили для модальных окон
   ================================ */

/* Стили для всех glass-modal */
.glass-modal {
    background-color: #08465a2e !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
}

/* Стили для кнопки закрытия модального окна */
.modal-close-btn {
    padding: 0 !important;
    margin: 0 !important;
}

/* Стили для кнопок в футере модальных окон */
.modal-footer .btn,
.glass-modal-footer .btn {
    border: none !important;
    border-radius: 6px !important;
}

.glass-modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.glass-modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.glass-modal-footer .btn-primary {
    background: rgb(0 255 15 / 14%) !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.glass-modal-footer .btn-primary:hover {
    background: rgb(0 255 15 / 20%) !important;
}


/* ================================
   Paid Access Status Badge (PRO/FREE)
   Requirements: 5.2
   ================================ */

/* Контейнер для имени пользователя и бейджа */
.user__name-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Базовые стили для бейджа статуса */
.user-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    text-transform: uppercase;
    line-height: 1.4;
}

/* PRO бейдж - зеленый */
.user-status-badge.badge-pro {
    background: linear-gradient(135deg, rgba(0, 255, 100, 0.25) 0%, rgba(0, 200, 80, 0.2) 100%);
    color: #4ade80;
    border: 1px solid rgba(0, 255, 100, 0.3);
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.15);
}

/* FREE бейдж - серый */
.user-status-badge.badge-free {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ================================
   Sidebar: прозрачный фон как на демо Super Admin
   ================================ */
@media (min-width: 1200px) {
    .sidebar {
        background-color: transparent !important;
    }
}

/* ================================
   Навбар: полупрозрачный тёмный фон как на демо
   ================================ */
.header {
    background-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: none !important;
}

.header--scrolled {
    background-color: rgba(0, 0, 0, 0.55) !important;
    box-shadow: 0 0 13px rgba(0, 0, 0, 0.22) !important;
}

/* ================================
   Phosphor Icons в навигации сайдбара
   ================================ */
.navigation > li > a > i.ph {
    font-size: 1.35rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
    width: 1.5rem;
    text-align: center;
    margin-right: 0.6rem;
    font-weight: normal !important;
}

/* ================================
   Активный пункт сайдбара: как на демо Super Admin
   ================================ */
.navigation > .navigation__active > a,
.navigation > .navigation__sub--active > a {
    border-left: 2px solid #4ade80 !important;
    border-radius: 4px !important;
    color: #4ade80 !important;
    background-color: rgba(74, 222, 128, 0.06) !important;
}

.navigation > .navigation__active > a > i,
.navigation > .navigation__sub--active > a > i {
    color: #4ade80 !important;
}

/* ================================
   User email в сайдбаре
   ================================ */
.user__email {
    padding-top: 2px;
}

/* Скрываем блок пользователя в сайдбаре (аватарка перенесена в навбар) */
.sidebar .user {
    display: none !important;
}

/* ================================
   Аватарка в навбаре (top-nav)
   ================================ */
.top-nav__avatar {
    position: relative;
}

.top-nav__avatar > a {
    padding: 0 0.4rem !important;
    min-width: auto !important;
    display: flex !important;
    align-items: center !important;
}

.top-nav__avatar .avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(198,236,237,.25), rgba(74,222,128,.2));
    border: 2px solid rgba(198,236,237,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #c6eced;
    text-transform: uppercase;
    transition: border-color .2s, box-shadow .2s;
}

.top-nav__avatar > a:hover,
.top-nav__avatar.show > a {
    background-color: transparent !important;
}

.top-nav__avatar > a:hover .avatar-circle,
.top-nav__avatar.show .avatar-circle {
    border-color: rgba(198,236,237,.5);
}

.top-nav__avatar .dropdown-menu {
    min-width: 160px;
    background: rgba(4, 27, 31, 0.55) !important;
    backdrop-filter: blur(24px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.4) !important;
    border: 1px solid rgba(198,236,237,.08) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.25) !important;
    padding: 6px 0 !important;
    margin-top: 8px !important;
    right: 0;
    left: auto;
}

.top-nav__avatar .dropdown-item {
    padding: 9px 16px !important;
    color: #c6eced !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: background .2s !important;
}

.top-nav__avatar .dropdown-item:hover,
.top-nav__avatar .dropdown-item:focus {
    background: rgba(198,236,237,.08) !important;
    color: #e3f6f6 !important;
}

.top-nav__avatar .dropdown-item i.ph {
    font-size: 16px;
    opacity: .7;
}

.top-nav__avatar .dropdown-divider {
    border-color: rgba(198,236,237,.1) !important;
    margin: 4px 0 !important;
}

.navbar-pro-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(0,255,100,.22), rgba(0,200,80,.18));
    color: #4ade80;
    border: 1px solid rgba(0,255,100,.25);
    margin-right: 6px;
    line-height: 1;
    vertical-align: middle;
}
