/* ============================================================
   KAPITAN — Modern AI Theme v1.1
   Подключать ПОСЛЕ AdminLTE и skin-blue-light.css
   Переопределяет хедер, сайдбар, меню и все элементы
   ============================================================ */

/* --- Импорт шрифта --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS-ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
    /* Основная палитра */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);
    
    /* Фоны */
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-elevated: rgba(30, 41, 59, 0.6);
    
    /* Поверхности */
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --surface-active: rgba(99, 102, 241, 0.08);
    
    /* Границы */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    /* Текст */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    /* Скругления */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Тени */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    /* Переходы */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   БАЗОВЫЕ СТИЛИ
   ============================================================ */

body,
body.skin-blue-light,
.content-wrapper,
.main-sidebar,
.wrapper,
.box,
.box-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary) !important;
    color: var(--text-primary);
}

/* Убираем стандартный белый/светлый фон */
.content-wrapper {
    background: var(--bg-primary) !important;
}

/* --- Скроллбар --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   ШАПКА (MAIN HEADER) — Полное переопределение
   ============================================================ */

/* --- Контейнер хедера --- */
.main-header,
.skin-blue-light .main-header {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border) !important;
}

/* --- Навбар --- */
.main-header .navbar,
.skin-blue-light .main-header .navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border) !important;
    margin-left: 0;
}

/* --- Логотип --- */
.main-header .logo,
.skin-blue-light .main-header .logo {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border) !important;
    border-right: 1px solid var(--border) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
    transition: all var(--transition);
}

.main-header .logo:hover,
.skin-blue-light .main-header .logo:hover {
    background: var(--bg-secondary) !important;
}

/* Мини-лого */
.main-header .logo .logo-mini {
    color: var(--text-primary) !important;
}

/* Большой лого */
.main-header .logo .logo-lg {
    color: var(--text-primary) !important;
}

/* --- Кнопка сворачивания сайдбара --- */
.main-header .navbar .sidebar-toggle,
.skin-blue-light .main-header .navbar .sidebar-toggle {
    color: var(--text-secondary) !important;
    transition: all var(--transition);
}

.main-header .navbar .sidebar-toggle:hover,
.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
    color: var(--text-primary) !important;
    background: var(--surface-hover) !important;
}

/* --- Ссылки в навбаре --- */
.main-header .navbar .nav > li > a,
.skin-blue-light .main-header .navbar .nav > li > a {
    color: var(--text-secondary) !important;
    transition: color var(--transition);
}

.main-header .navbar .nav > li > a:hover,
.skin-blue-light .main-header .navbar .nav > li > a:hover {
    color: var(--text-primary) !important;
    background: var(--surface-hover) !important;
}

/* --- Меню пользователя (user-menu) --- */
.main-header .navbar .nav > li.user-menu > a,
.skin-blue-light .main-header .navbar .nav > li.user-menu > a {
    color: var(--text-secondary) !important;
}

.main-header .navbar .nav > li.user-menu > a:hover,
.skin-blue-light .main-header .navbar .nav > li.user-menu > a:hover {
    color: var(--text-primary) !important;
}

/* --- Выпадающее меню пользователя --- */
.main-header .navbar .dropdown-menu,
.skin-blue-light .main-header .navbar .dropdown-menu {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg);
}

/* Заголовок в выпадающем меню */
.main-header .navbar .dropdown-menu .user-header,
.skin-blue-light .main-header .navbar .dropdown-menu .user-header {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border) !important;
}

.main-header .navbar .dropdown-menu .user-header p,
.skin-blue-light .main-header .navbar .dropdown-menu .user-header p {
    color: var(--text-primary) !important;
}

.main-header .navbar .dropdown-menu .user-header small,
.skin-blue-light .main-header .navbar .dropdown-menu .user-header small {
    color: var(--text-muted) !important;
}

/* Тело выпадающего меню */
.main-header .navbar .dropdown-menu .user-body,
.skin-blue-light .main-header .navbar .dropdown-menu .user-body {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border) !important;
}

.main-header .navbar .dropdown-menu .user-body a,
.skin-blue-light .main-header .navbar .dropdown-menu .user-body a {
    color: var(--text-secondary) !important;
}

.main-header .navbar .dropdown-menu .user-body a:hover,
.skin-blue-light .main-header .navbar .dropdown-menu .user-body a:hover {
    color: var(--primary) !important;
}

/* Футер выпадающего меню */
.main-header .navbar .dropdown-menu .user-footer,
.skin-blue-light .main-header .navbar .dropdown-menu .user-footer {
    background: var(--bg-tertiary) !important;
}

/* ============================================================
   САЙДБАР — Полное переопределение
   ============================================================ */

/* --- Контейнер сайдбара --- */
.main-sidebar,
.skin-blue-light .main-sidebar {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border) !important;
}

/* --- Секция сайдбара --- */
.main-sidebar .sidebar,
.skin-blue-light .main-sidebar .sidebar {
    background: var(--bg-secondary) !important;
}

/* --- Заголовок меню --- */
.sidebar-menu > li.header,
.skin-blue-light .sidebar-menu > li.header {
    color: var(--text-muted) !important;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    padding: 12px 16px 6px;
    background: transparent !important;
}

/* --- Элементы меню --- */
.sidebar-menu > li > a,
.skin-blue-light .sidebar-menu > li > a {
    color: var(--text-secondary) !important;
    border-radius: var(--radius);
    margin: 1px 8px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    font-weight: 450;
    background: transparent !important;
}

.sidebar-menu > li > a:hover,
.skin-blue-light .sidebar-menu > li > a:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
    border-left-color: transparent;
}

/* --- Активный пункт меню --- */
.sidebar-menu > li.active > a,
.skin-blue-light .sidebar-menu > li.active > a {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-left-color: var(--primary) !important;
    font-weight: 600;
}

.sidebar-menu > li.active > a:hover,
.skin-blue-light .sidebar-menu > li.active > a:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* --- Иконки в меню --- */
.sidebar-menu > li > a > i,
.skin-blue-light .sidebar-menu > li > a > i {
    color: var(--text-muted) !important;
    transition: color var(--transition);
}

.sidebar-menu > li.active > a > i,
.skin-blue-light .sidebar-menu > li.active > a > i {
    color: var(--primary) !important;
}

/* --- Treeview (вложенное меню) --- */
.sidebar-menu .treeview-menu,
.skin-blue-light .sidebar-menu .treeview-menu {
    background: rgba(0, 0, 0, 0.15) !important;
    margin: 2px 8px;
    border-radius: var(--radius);
    padding: 4px 0;
}

.sidebar-menu .treeview-menu > li > a,
.skin-blue-light .sidebar-menu .treeview-menu > li > a {
    color: var(--text-muted) !important;
    padding: 8px 16px 8px 32px;
    font-size: 13px;
    transition: all var(--transition);
}

.sidebar-menu .treeview-menu > li > a:hover,
.skin-blue-light .sidebar-menu .treeview-menu > li > a:hover {
    color: var(--text-primary) !important;
    background: var(--surface-hover) !important;
}

.sidebar-menu .treeview-menu > li.active > a,
.skin-blue-light .sidebar-menu .treeview-menu > li.active > a {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
}

/* --- Стрелка treeview --- */
.sidebar-menu > li > a > .fa-angle-left,
.skin-blue-light .sidebar-menu > li > a > .fa-angle-left {
    color: var(--text-muted) !important;
}

/* ============================================================
   КАРТОЧКИ И БОКСЫ
   ============================================================ */

.box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.box:hover {
    box-shadow: var(--shadow);
}

.box-header {
    border-bottom: 1px solid var(--border) !important;
    padding: 14px 20px;
}

.box-header .box-title {
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.box-body {
    padding: 20px;
}

.box-footer {
    border-top: 1px solid var(--border) !important;
    padding: 12px 20px;
    background: transparent !important;
}


/* ============================================================
   ИСПРАВЛЕНИЕ СКРУГЛЕНИЙ BOX
   ============================================================ */

/* Родительский box — скрываем вылезающие углы */
.box {
    overflow: hidden;
}

/* Скругляем верхние углы у box-header (если он первый внутри box) */
.box .box-header:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

/* Скругляем нижние углы у box-footer (если он последний внутри box) */
.box .box-footer:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Если box-body — единственный или последний элемент, скругляем низ */
.box .box-body:last-child {
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Если box-body — единственный или первый элемент (без header), скругляем верх */
.box .box-body:first-child {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}


/* --- Карточки симуляций --- */
.simulation-card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 20px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

.simulation-card:hover {
    border-color: var(--border-focus) !important;
    box-shadow: var(--shadow);
}

.simulation-card .card-date {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 450;
}

.simulation-card .card-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.simulation-card .card-meta {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.simulation-card .card-meta span {
    margin-right: 18px;
}

.simulation-card .card-actions {
    margin-top: 14px;
}

.simulation-card .card-actions .btn {
    margin-right: 8px;
}

/* --- Стат-карточки --- */
.stat-card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    text-align: center;
    padding: 20px 15px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-focus) !important;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 8px;
}

/* ============================================================
   КНОПКИ
   ============================================================ */

.btn {
    border-radius: var(--radius) !important;
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition);
    border: 1px solid transparent;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning) !important;
    border-color: var(--warning) !important;
    color: var(--text-inverse) !important;
}

.btn-default {
    background: var(--surface-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

.btn-default:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

.btn-lg {
    font-size: 15px;
    padding: 10px 24px;
    border-radius: var(--radius-lg) !important;
}

/* --- Кнопки в боксах (box-tools) --- */
.btn-box-tool {
    color: var(--text-muted) !important;
}

.btn-box-tool:hover {
    color: var(--text-primary) !important;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */

.form-control {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--text-primary) !important;
    font-size: 13px;
    transition: all var(--transition);
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
    outline: none;
    background: rgba(255, 255, 255, 0.06) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

select.form-control {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-primary) !important;
}

select.form-control option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

textarea.form-control {
    background: rgba(255, 255, 255, 0.04) !important;
}

/* --- Чекбоксы --- */
.checkbox label,
.checkbox-inline {
    color: var(--text-secondary);
    font-size: 13px;
}

/* --- Input group --- */
.input-group .input-group-btn .btn {
    border-radius: 0 var(--radius) var(--radius) 0 !important;
}

.input-group .form-control:first-child {
    border-radius: var(--radius) 0 0 var(--radius) !important;
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */

.table > thead > tr > th {
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
}

.table > tbody > tr > td {
    border-top: 1px solid var(--border-light) !important;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 13px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02) !important;
}

.table-hover > tbody > tr:hover {
    background: var(--surface-hover) !important;
}

/* ============================================================
   ПРОГРЕСС-БАРЫ
   ============================================================ */

.progress {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 10px;
    box-shadow: none;
    height: 6px;
    margin-bottom: 0;
}

.progress.active .progress-bar {
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    transition: width 0.3s ease;
}

.progress-bar-success {
    background: var(--success) !important;
}

.progress-bar-warning {
    background: var(--warning) !important;
}

.progress-bar-danger {
    background: var(--danger) !important;
}

.progress-bar-primary {
    background: var(--primary) !important;
}

/* ============================================================
   ЛЕЙБЛЫ И БЕЙДЖИ
   ============================================================ */

.label {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 11px;
    padding: 3px 8px;
}

.label-primary {
    background: var(--primary) !important;
}

.label-success {
    background: var(--success) !important;
}

.label-danger {
    background: var(--danger) !important;
}

.label-warning {
    background: var(--warning) !important;
    color: var(--text-inverse) !important;
}

.label-info {
    background: var(--info) !important;
}

.label-default {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

.badge {
    border-radius: 10px;
    font-weight: 500;
}

/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal-content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border) !important;
    padding: 16px 20px;
}

.modal-header .modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-header .close {
    color: var(--text-muted) !important;
    opacity: 0.6;
}

.modal-header .close:hover {
    color: var(--text-primary) !important;
    opacity: 1;
}

.modal-body {
    color: var(--text-secondary);
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: 14px 20px;
}

/* ============================================================
   АЛЕРТЫ
   ============================================================ */

.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 13px;
}

.alert-info {
    background: var(--info-light) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
}

.alert-success {
    background: var(--success-light) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #6ee7b7 !important;
}

.alert-warning {
    background: var(--warning-light) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #fcd34d !important;
}

.alert-danger {
    background: var(--danger-light) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

/* ============================================================
   ПАГИНАЦИЯ
   ============================================================ */

.pagination > li > a {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
}

.pagination > li > a:hover {
    background: var(--surface-hover) !important;
    color: var(--text-primary) !important;
}

.pagination > li.active > a {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.pagination > li.disabled > a {
    background: transparent !important;
    border-color: var(--border-light) !important;
    color: var(--text-muted) !important;
    opacity: 0.4;
}

/* ============================================================
   ХЛЕБНЫЕ КРОШКИ
   ============================================================ */

.content-header {
    padding: 16px 20px !important;
}

.content-header > h1 {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.breadcrumb {
    background: transparent !important;
    padding: 0;
    margin-top: 4px;
}

.breadcrumb > li > a {
    color: var(--text-muted) !important;
}

.breadcrumb > li.active {
    color: var(--text-secondary) !important;
}

.breadcrumb > li + li:before {
    color: var(--text-muted) !important;
}

/* ============================================================
   ЧАТ (СИМУЛЯЦИЯ)
   ============================================================ */

.direct-chat-text {
    border-radius: var(--radius-lg) !important;
    line-height: 1.55;
    font-size: 13px;
}

.direct-chat-msg.right .direct-chat-text {
    background: var(--primary) !important;
    color: #fff !important;
}

.direct-chat-msg .direct-chat-text {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-primary) !important;
}

.direct-chat-name {
    color: var(--text-muted) !important;
}

/* --- Список сотрудников --- */
#employee-list .list-group-item {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-left: 3px solid transparent !important;
    color: var(--text-primary);
    transition: all var(--transition);
    padding: 14px 16px;
}

#employee-list .list-group-item:hover {
    background: var(--surface-hover) !important;
}

#employee-list .list-group-item.active {
    background: var(--primary-light) !important;
    border-left-color: var(--primary) !important;
    color: var(--primary) !important;
}

#employee-list .list-group-item.active .fa-user-circle {
    color: var(--primary) !important;
}

/* ============================================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ============================================================
   ТАБЫ (ВКЛАДКИ)
   ============================================================ */

.nav-tabs {
    border-bottom: 1px solid var(--border) !important;
}

.nav-tabs > li > a {
    color: var(--text-muted) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border: none !important;
    transition: all var(--transition);
    font-weight: 450;
}

.nav-tabs > li > a:hover {
    color: var(--text-primary) !important;
    background: var(--surface-hover) !important;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--primary) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid var(--primary) !important;
}

/* ============================================================
   СЧЁТ-БЕЙДЖ (для баллов)
   ============================================================ */

.score-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.score-high {
    background: var(--success-light);
    color: #6ee7b7;
}

.score-medium {
    background: var(--warning-light);
    color: #fcd34d;
}

.score-low {
    background: var(--danger-light);
    color: #fca5a5;
}

/* ============================================================
   ФУТЕР
   ============================================================ */

.main-footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 12px;
}

.main-footer a {
    color: var(--text-secondary) !important;
}

/* ============================================================
   УТИЛИТЫ
   ============================================================ */

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

a {
    color: var(--primary);
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

hr {
    border-top: 1px solid var(--border);
}

/* --- Плашка демо-режима --- */
.alert-demo-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    text-align: center;
    padding: 10px;
}

/* ============================================================
   ИЗОБРАЖЕНИЕ В ЛОГО
   ============================================================ */

.main-header .logo img {
    display: none; /* Скрываем растровый логотип, используем текст */
}



/* ============================================================
   ПЕРЕОПРЕДЕЛЕНИЕ СТИЛЕЙ ИЗ style.css
   (должны быть после всех остальных правил)
   ============================================================ */

/* --- Принудительно переопределяем шрифты заголовков --- */
h1,
h2,
h3,
h4,
h5,
h6,
.content-header h1,
.box-header .box-title,
.content h1,
.content h2,
.content h3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: var(--text-primary) !important;
}

/* --- Заголовок h1 --- */
h1,
.content-header h1,
.content h1 {
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
}

/* --- Заголовок h2 --- */
h2,
.content h2 {
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

/* --- Заголовок h3 --- */
h3,
.content h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

/* --- Заголовки h4, h5, h6 --- */
h4 {
    font-size: 15px !important;
    font-weight: 600 !important;
}

h5 {
    font-size: 14px !important;
    font-weight: 600 !important;
}

h6 {
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* --- Цвета заголовков в боксах --- */
.box-header .box-title,
.box-header h3.box-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: var(--text-primary) !important;
}

/* --- Параграфы и списки --- */
p,
ul,
ol,
.content p,
.content ul,
.content ol,
.box-body p,
.box-body ul {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* --- Текст-muted сохраняем серым --- */
p.text-muted,
.text-muted {
    color: var(--text-muted) !important;
}



/* --- Переопределение для section.content --- */
section.content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* --- Кнопки bttn-default из style.css --- */
.bttn-default,
.bttn-white {
    background-color: var(--surface-hover) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}

.bttn-default:hover,
.bttn-white:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

/* --- Шаги мастера (stepwizard) --- */
.stepwizard-row:before {
    background-color: var(--border) !important;
}

.stepwizard-step p {
    color: var(--text-secondary) !important;
}

/* --- Прочие элементы --- */
small {
    color: var(--text-muted);
}

strong {
    color: var(--text-primary);
}

/* --- Переопределение цвета для .lead --- */
.lead {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: var(--text-secondary) !important;
}




/* Шаги в мастере */
.stepwizard-step p {
    margin-top: 10px;    
}

.stepwizard-row {
    display: table-row;
}

.stepwizard {
    display: table;     
    width: 100%;
    position: relative;
}

.stepwizard-step button[disabled] {
    opacity: 1 !important;
    filter: alpha(opacity=100) !important;
}

.stepwizard-row:before {
    top: 14px;
    bottom: 0;
    position: absolute;
    content: " ";
    width: 100%;
    height: 1px;
    background-color: #ccc;
    z-order: 0;
    
}

.stepwizard-step {    
    display: table-cell;
    text-align: center;
    position: relative;
}

.btn-circle {
  width: 30px;
  height: 30px;
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  line-height: 1.428571429;
  border-radius: 15px !important;
}
  


/* ============================================================
   АДАПТИВНОСТЬ (МОБИЛЬНЫЕ)
   ============================================================ */

@media (max-width: 767px) {
    .simulation-card {
        padding: 14px;
    }
    
    .simulation-card .card-title {
        font-size: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .content-header > h1 {
        font-size: 18px;
    }
    
    .main-sidebar {
        background: var(--bg-secondary) !important;
    }
}





/* ============================================================
   TOASTR — Стили в темах Modern AI
   ============================================================ */

/* --- Контейнер --- */
#toast-container > div {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 16px 16px 16px 50px !important;
    opacity: 0.95 !important;
    border: 1px solid var(--border) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  transition: all var(--transition) !important;
}

#toast-container > :hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
}

/* --- Заголовок тоста --- */
.toast-title {
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: -0.01em !important;
}

/* --- Сообщение тоста --- */
.toast-message {
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* --- Кнопка закрытия --- */
.toast-close-button {
    color: rgba(255, 255, 255, 0.6) !important;
    text-shadow: none !important;
    opacity: 0.7 !important;
    font-size: 16px !important;
    top: -2px !important;
    right: -2px !important;
}

.toast-close-button:hover,
.toast-close-button:focus {
    color: #fff !important;
    opacity: 1 !important;
}

/* --- Цвета фона --- */
.toast-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

.toast-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.toast-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fcd34d !important;
}

.toast-error {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

/* --- Заголовки тостов --- */
.toast-success .toast-title {
    color: #6ee7b7 !important;
}

.toast-info .toast-title {
    color: #93c5fd !important;
}

.toast-warning .toast-title {
    color: #fcd34d !important;
}

.toast-error .toast-title {
    color: #fca5a5 !important;
}

/* --- Убираем стандартные иконки (оставляем только кастомные) --- */
#toast-container > .toast-info {
    background-image: none !important;
}

#toast-container > .toast-error {
    background-image: none !important;
}

#toast-container > .toast-success {
    background-image: none !important;
}

#toast-container > .toast-warning {
    background-image: none !important;
}

/* --- Прогресс-бар --- */
.toast-progress {
    background-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
    height: 3px !important;
}

.toast-success .toast-progress {
    background-color: rgba(16, 185, 129, 0.5) !important;
}

.toast-info .toast-progress {
    background-color: rgba(59, 130, 246, 0.5) !important;
}

.toast-warning .toast-progress {
    background-color: rgba(245, 158, 11, 0.5) !important;
}

.toast-error .toast-progress {
    background-color: rgba(239, 68, 68, 0.5) !important;
}

/* --- Адаптивность --- */
@media all and (max-width: 240px) {
    #toast-container > div {
        padding: 10px 10px 10px 50px !important;
        width: 11em !important;
    }
}

@media all and (min-width: 241px) and (max-width: 480px) {
    #toast-container > div {
        padding: 12px 12px 12px 50px !important;
        width: 18em !important;
    }
}

@media all and (min-width: 481px) and (max-width: 768px) {
    #toast-container > div {
        padding: 15px 15px 15px 50px !important;
        width: 25em !important;
    }
}

/* ============================================================
   TOASTR — Плавные анимации
   ============================================================ */

/* --- Плавное появление --- */
#toast-container > div {
    animation: toastFadeInUp 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards !important;
}

/* --- Плавное исчезновение (добавляется класс при скрытии) --- */
#toast-container > .toast-fade-out {
    animation: toastFadeOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* --- Кейфреймы: появление снизу --- */
@keyframes toastFadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 0.95;
        transform: translateY(0) scale(1);
    }
}

/* --- Кейфреймы: исчезновение вправо --- */
@keyframes toastFadeOutRight {
    0% {
        opacity: 0.95;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(40px) scale(0.9);
    }
}

/* --- Отключаем стандартные jQuery-анимации toastr --- */
#toast-container > div {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}





    /* Карточки выбора сценария */
   .scenario-card {
		background: var(--surface, rgba(255,255,255,0.03));
		border: 1px solid var(--border, rgba(255,255,255,0.06));
		border-radius: var(--radius-lg, 12px);
		padding: 16px;
		cursor: pointer;
		transition: all 0.2s;
		height: 100%;
		outline: 2px solid transparent;
		outline-offset: -2px;
	}

	.scenario-card:hover {
		border-color: rgba(99,102,241,0.4);
		box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	}

	/* Выбранная карточка — outline вместо утолщённого border */
	.scenario-card.selected {
		border-color: #6366f1;
		outline: 2px solid #6366f1;
		box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
	}
    .scenario-card-header {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text-primary, #f1f5f9);
    }
    .scenario-card-meta {
        font-size: 12px;
        color: var(--text-muted, #64748b);
        margin-bottom: 8px;
    }
    .scenario-card-meta span {
        margin-right: 10px;
    }
    .scenario-card-desc {
        font-size: 12px;
        color: var(--text-muted, #64748b);
        line-height: 1.4;
    }