/* ============ P24 HEADER (общие стили) ============ */
.p24-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.p24-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.p24-global-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 10px;
    padding: 6px 12px;
    gap: 8px;
}

.p24-global-search i {
    color: #6c757d;
}

.p24-global-search input {
    border: 0;
    background: transparent;
    outline: 0;
    flex: 1;
    font-size: 14px;
}

.p24-search-shortcut {
    font-size: 11px;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fff;
}

/* ============ P24 SIDEBAR ============ */
.p24-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e9ecef;
    min-height: calc(100vh - 56px);
}

.p24-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 12px;
}

.p24-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    transition: all .15s ease;
}

.p24-sidebar .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

.p24-sidebar .nav-link.active {
    background: #e7f0ff;
    color: #2563eb;
    font-weight: 600;
}

.p24-sidebar-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 13px;
    margin-bottom: 8px;
}

/* ============ OFF-CANVAS ============ */
.p24-offcanvas {
    max-width: 280px;
}

.p24-offcanvas .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
}

.p24-offcanvas .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

/* ============ P24 HEADER ============ */
.p24-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.p24-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.p24-global-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 10px;
    padding: 6px 12px;
    gap: 8px;
}

.p24-global-search i { color: #6c757d; }

.p24-global-search input {
    border: 0;
    background: transparent;
    outline: 0;
    flex: 1;
    font-size: 14px;
}

.p24-search-shortcut {
    font-size: 11px;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fff;
}

/* ============ P24 SIDEBAR ============ */
.p24-sidebar {
    width: 100%;
    background: #fff;
    border-right: 1px solid #e9ecef;
    min-height: calc(100vh - 56px);
}

.p24-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 12px;
}

.p24-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    transition: all .15s ease;
}

.p24-sidebar .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

.p24-sidebar .nav-link.active {
    background: #e7f0ff;
    color: #2563eb;
    font-weight: 600;
}

.p24-sidebar-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 13px;
    margin-bottom: 8px;
}

/* ============ OFF-CANVAS ============ */
.p24-offcanvas { max-width: 280px; }

.p24-offcanvas .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
}

.p24-offcanvas .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

/* ============ P24 PRELOADER ============ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: opacity .35s ease, visibility .35s ease;
}

.preloader__image {
    width: 80px;
    height: 80px;
    color: #2563eb;
    animation: p24-spin 1.2s linear infinite;
}

.preloader.preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes p24-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
/* ============================================================
   P24 HEADER
   ============================================================ */
.p24-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.p24-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.p24-global-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f3f5;
    border-radius: 10px;
    padding: 6px 12px;
    gap: 8px;
}

.p24-global-search i { color: #6c757d; }

.p24-global-search input {
    border: 0;
    background: transparent;
    outline: 0;
    flex: 1;
    font-size: 14px;
}

.p24-search-shortcut {
    font-size: 11px;
    color: #6c7c8d;
    border: 1px solid #dee2e6;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fff;
}

/* ============================================================
   P24 LAYOUT (общий каркас: сайдбар + контент)
   ============================================================ */
.p24-layout {
    min-height: calc(100vh - 56px);
}

.p24-layout-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e9ecef;
    padding: 16px 12px;
}

.p24-layout-content {
    background: #f8f9fa;
    min-height: calc(100vh - 56px);
}

/* ============================================================
   P24 SIDEBAR
   ============================================================ */
.p24-sidebar {
    width: 100%;
}

.p24-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.p24-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    transition: all .15s ease;
}

.p24-sidebar .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

.p24-sidebar .nav-link.active {
    background: #e7f0ff;
    color: #2563eb;
    font-weight: 600;
}

.p24-sidebar-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 13px;
    margin-bottom: 8px;
}

/* ============================================================
   P24 OFF-CANVAS
   ============================================================ */
.p24-offcanvas { max-width: 280px; }

.p24-offcanvas .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
}

.p24-offcanvas .nav-link:hover {
    background: #f1f3f5;
    color: #2563eb;
}

/* ============================================================
   P24 PRELOADER
   ============================================================ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: opacity .35s ease, visibility .35s ease;
}

.preloader__image {
    width: 80px;
    height: 80px;
    color: #2563eb;
    animation: p24-spin 1.2s linear infinite;
}

.preloader.preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes p24-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .p24-layout-sidebar { display: none; }
    .p24-layout-content { min-height: auto; }
}
/* ============ HEADER WIDGETS ============ */
#header-widgets {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #495057;
    white-space: nowrap;
}

.header-widget {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
}

.header-widget:hover {
    opacity: 0.7;
}

.header-widget b {
    color: #2563eb;
}

/* На мобильных прячем валюты, чтобы не было переполнения */
@media (max-width: 991.98px) {
    #header-widgets {
        gap: 8px;
        font-size: 0.75rem;
    }
    .header-widget[title="Курсы валют"] {
        display: none !important;
    }
    #btn_accessible_version,
    #btn_fullscreen {
        display: none !important;
    }
}

/* ============================================================
   РЕЖИМ ДЛЯ СЛАБОВИДЯЩИХ (body-vision)
   ============================================================ */
body.body-vision {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 1.25rem !important; /* Увеличиваем базовый шрифт */
}

/* Убираем градиенты и фоны */
body.body-vision .p24-hero-new,
body.body-vision .p24-header,
body.body-vision .p24-layout-content,
body.body-vision .p24-group-card,
body.body-vision .p24-service-card-mini,
body.body-vision .p24-ai-card-hero {
    background: #ffffff !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 2px solid #000000 !important;
}

/* Делаем текст черным и контрастным */
body.body-vision h1,
body.body-vision h2,
body.body-vision h3,
body.body-vision h4,
body.body-vision h5,
body.body-vision h6,
body.body-vision p,
body.body-vision span,
body.body-vision a,
body.body-vision div {
    color: #000000 !important;
}

/* Ссылки делаем подчеркнутыми и синими */
body.body-vision a {
    text-decoration: underline !important;
    color: #0000cc !important;
    font-weight: bold !important;
}

/* Кнопки делаем крупнее и контрастнее */
body.body-vision button,
body.body-vision .btn {
    border: 2px solid #000 !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
}

/* Убираем прозрачность у иконок */
body.body-vision i.bi {
    color: #000 !important;
}

/* Скрываем декоративные элементы (если нужно) */
body.body-vision .p24-chip {
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}

/* ============================================================
   TTS ПАНЕЛЬ (ОЗВУЧКА)
   ============================================================ */
#tts-panel {
    display: none;
    background: #f8f9fa;
    border-bottom: 2px solid #0d6efd;
    padding: 12px 16px;
    position: sticky;
    top: 56px; /* Высота шапки */
    z-index: 1020;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#tts-panel.active {
    display: block;
}

.tts-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tts-controls button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tts-controls button:hover {
    background: #e9ecef;
}

.tts-controls button.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.tts-controls button.btn-danger:hover {
    background: #bb2d3b;
}

#tts_voice_select {
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid #dee2e6;
    background: #fff;
    max-width: 250px;
}

/* Подсветка читаемого текста (опционально) */
.tts-speaking {
    background: #fff3cd;
    transition: background 0.3s;
}