/* app/static/css/style.css */
:root {
    --primary-blue: #004ab8;
    --primary-cyan: #1999fb;
    --primary-green: #009d27;
    --primary-gold: #c79800;
    --primary-teal: #007f70;
    --primary-orange: #cc4400;
    --accent-red: #fa3e3e;
    --white: #ffffff;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-700);
    margin: 0;
    background: var(--white);
}

.container-wide {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-top .header-logo {
    max-height: 60px;
    max-width: 200px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.header-text-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--primary-teal);
    line-height: 1.2;
}

.header-text-section h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--gray-600);
    font-weight: 500;
}

.page-nav {
    background: var(--white);
    padding: 0.5rem 0;
}

.nav-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
}

.nav-row {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    width: 100%;
}

.nav-row-user {
    border-top: 1px solid var(--gray-200);
    padding-top: 0.3rem;
}

.nav-row-admin {
    border-top: 1px solid var(--gray-200);
    padding-top: 0.3rem;
}

.nav-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Цвета кнопок меню */
.nav-1 {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
}

.nav-1:hover {
    background: var(--primary-gold);
}

.nav-2 {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
}

.nav-2:hover {
    background: var(--primary-blue);
}

.nav-3 {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
}

.nav-3:hover {
    background: var(--accent-red);
}

.nav-4 {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.nav-4:hover {
    background: var(--primary-blue);
}

.nav-5 {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.nav-5:hover {
    background: var(--primary-teal);
}

.nav-6 {
    background: var(--gray-600);
    border-color: var(--gray-600);
}

.nav-6:hover {
    background: var(--gray-700);
}

.nav-home {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
}

.nav-home:hover {
    background: var(--primary-gold);
}

.nav-logout {
    background: var(--gray-900);
    border-color: var(--gray-900);
}

.nav-logout:hover {
    background: var(--accent-red);
}

.hero-section {
    padding: 1rem 0;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--gray-600);
}

.api-login-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(0, 127, 112, 0.1);
}

.btn-primary {
    background: var(--primary-teal);
    color: var(--white);
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-orange);
}

.btn-secure {
    background: var(--primary-gold);
    color: var(--white);
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secure:hover {
    background: var(--accent-red);
}

.card-entity {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.card-entity:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}

.card-projects {
    background: #e6f0ff !important;
}

.card-tasks {
    background: #fff3e6 !important;
}

.card-requirements {
    background: #fff8e6 !important;
}

.card-risks {
    background: #e6f9ff !important;
}

.footer-container {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--gray-600);
    background: var(--white) !important;
    border-top: 1px solid var(--gray-200);
}

.modal-content {
    border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
    .nav-row {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .nav-label {
        padding: 0.3rem 0;
    }

    .api-login-form {
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* Все кнопки */
.btn,
.btn-primary,
.btn-secure,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-info {
    color: var(--white) !important;
}

.btn:hover,
.btn-primary:hover,
.btn-secure:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover {
    color: var(--white) !important;
}

/* Для кнопок навигации */
.nav-link {
    color: var(--white) !important;
}

.nav-link:hover {
    color: var(--white) !important;
}

/* Для кнопок в модалке */
.modal .btn {
    color: var(--white) !important;
}

.modal .btn:hover {
    color: var(--white) !important;
}

.modal .btn-secondary {
    background: var(--gray-600);
    border-color: var(--gray-600);
}

.modal .btn-secondary:hover {
    background: var(--gray-900);
    border-color: var(--gray-900);
}

/* Кнопки действий в таблицах */
.btn-action {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    min-width: 36px;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-edit {
    background: var(--primary-teal);
    color: var(--white);
    border: 1px solid var(--primary-teal);
}

.btn-edit:hover {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: var(--white);
}

.btn-create {
    background: var(--primary-teal);
    color: var(--white);
    border: 1px solid var(--primary-teal);
}

.btn-create:hover {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: var(--white);
}

.btn-delete {
    background: var(--accent-red);
    color: var(--white);
    border: 1px solid var(--accent-red);
}

.btn-delete:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
}

.btn-detail {
    background: var(--primary-blue);
    color: var(--white);
    border: 1px solid var(--primary-blue);
}

.btn-detail:hover {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    color: var(--white);
}

/* Стили для вкладок */
.api-key-text {
    background: var(--gray-700);
    color: white;
}

.api-key-text:hover {
    background: var(--primary-cyan);
    cursor: pointer;
}

.btn-action {
    padding: 4px 8px;
    font-size: 16px;
    border: none;
    background: var(--primary-cyan);
    transition: transform 0.2s;
}

.btn-action:hover {
    transform: scale(1.2);
}

.btn-edit {
    background: var(--primary-gold);
}

.btn-edit:hover {
    background: var(--primary-cyan);
}

.btn-delete {
    background: var(--accent-red);
}

.btn-delete:hover {
    background: var(--primary-blue);
}

.btn-key {
    background: var(--gray-900);
}

.btn-key:hover {
    background: var(--accent-red);
}

.btn-email {
    background: var(--primary-teal);
}

.btn-email:hover {
    background: var(--primary-green);
}

.card .row.mb-2:last-child {
    margin-bottom: 0 !important;
}

.card-body {
    padding-bottom: 0.5rem !important;
}

.card .row.mb-2 {
    border-bottom: none !important;
    padding-bottom: 0.25rem;
}

/* Стили для вкладок */
.nav-tabs .nav-link {
    color: white;
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
}

.nav-tabs .nav-link:hover {
    color: white;
    background-color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    cursor: pointer;
}

.nav-tabs .nav-link.active {
    color: white;
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
}

.nav-tabs .nav-link.active:hover {
    color: white;
    background-color: var(--primary-green);
}

.nav-tabs .nav-item {
    margin-right: 10px;
}

/* ===== Диаграмма Гантта ===== */
.gantt-container {
    overflow-x: auto;
    padding: 10px 0;
}

.gantt-header,
.gantt-row {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    min-height: 32px;
}

.gantt-header {
    margin-bottom: 6px;
    font-size: 11px;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
}

.gantt-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 12px;
    padding-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-label .badge {
    font-size: 9px;
    padding: 2px 6px;
}

.gantt-timeline {
    position: relative;
    flex: 1;
    height: 18px;
}

.gantt-date {
    position: absolute;
    font-size: 9px;
    transform: translateX(-50%);
    color: #6c757d;
    top: 0;
}

.gantt-bar-wrapper {
    position: relative;
    flex: 1;
    height: 28px;
    background: #f5f7fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.gantt-bar {
    position: absolute;
    height: 20px;
    border-radius: 3px;
    top: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 10px;
}

.gantt-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gantt-bar-label {
    font-size: 10px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Цвета для статусов */
.gantt-bar-status-completed {
    background: #28a745 !important;
}

.gantt-bar-status-in_progress {
    background: #ffc107 !important;
}

.gantt-bar-status-planned {
    background: #6c757d !important;
}

/* Сетка на фоне */
.gantt-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e9ecef;
}

/* Подпись под диаграммой */
.gantt-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    flex-wrap: wrap;
}

.gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-legend-color {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}


.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    color: #ffffff !important;
}

.timeline-badge {
    position: absolute;
    left: -40px;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-weight: bold;
    z-index: 1;
    font-size: 13px;
}

.timeline-badge.bg-success {
    background: #28a745 !important;
}

.timeline-badge.bg-secondary {
    background: #6c757d !important;
}

.timeline-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-left: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeline-content:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

/* Заголовок "Изменения" - желтый фон */
.changes-header {
    background: var(--primary-gold) !important;
    color: #212529 !important;
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
    font-size: 13px;
}

.changes-table {
    margin-top: 6px;
}

.changes-table tr {
    border-bottom: 1px dashed #f0f0f0;
}

.changes-table tr:last-child {
    border-bottom: none;
}

.changes-table td {
    padding: 3px 8px;
    vertical-align: middle;
    font-size: 13px;
}

.changes-table .field-name {
    font-weight: 600;
    width: 120px;
    color: #495057;
}

.changes-table .old-value {
    color: #dc3545;
    text-decoration: line-through;
}

.changes-table .arrow {
    text-align: center;
    width: 30px;
    color: #6c757d;
}

.changes-table .new-value {
    color: #28a745;
}

/* Для маленьких экранов */
@media (max-width: 768px) {
    .changes-table td {
        font-size: 12px;
        padding: 2px 4px;
    }

    .changes-table .field-name {
        width: 80px;
    }
}

/* ============================================
   СТИЛИ ДЛЯ СПИСКОВ СУЩНОСТЕЙ
   ============================================ */

/* Карточка с фильтрами */
.filter-card {
    background: var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    border: none;
}

.filter-card .form-label {
    color: var(--primary-teal);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-card .form-select,
.filter-card .form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
}

.filter-card .form-select:focus,
.filter-card .form-control:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(0, 127, 112, 0.1);
}

/* Таблица */
.table-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-sm);
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    background: var(--primary-teal) !important;
    color: white !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border: none;
}

.table-card .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-200);
}

.table-card .table tbody tr:hover {
    background: var(--gray-200);
    transition: background 0.2s ease;
}

.table-card .table tbody tr:last-child td {
    border-bottom: none;
}

/* Кнопки действий в таблицах */
.btn-group-sm .btn-action {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    border: none;
    color: white !important;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-group-sm .btn-action:hover {
    transform: scale(1.05);
    opacity: 0.85;
    color: white !important;
}

.btn-detail {
    background: var(--primary-blue) !important;
}

.btn-detail:hover {
    background: var(--primary-cyan) !important;
}

.btn-edit {
    background: var(--primary-gold) !important;
}

.btn-edit:hover {
    background: var(--primary-orange) !important;
}

.btn-delete {
    background: var(--accent-red) !important;
}

.btn-delete:hover {
    background: #cc0000 !important;
}

/* Пустое состояние */
.empty-state {
    padding: 3rem 1rem;
    color: var(--gray-600);
}

.empty-state .bi {
    font-size: 3rem;
    color: var(--gray-200);
}

/* Заголовок страницы */
.entity-page-header {
    background: var(--primary-teal);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.entity-page-header h2 {
    color: white !important;
    font-weight: 700;
}

.entity-page-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.entity-page-header .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.entity-page-header .btn-primary {
    background: white;
    color: var(--primary-teal) !important;
    border: none;
}

.entity-page-header .btn-primary:hover {
    background: var(--primary-gold);
    color: white !important;
}

/* Badge статусов */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-status.bg-secondary {
    background: var(--gray-600) !important;
}

/* Стили для модальных окон */
.modal .btn-primary {
    background: var(--primary-teal);
    border: none;
}

.modal .btn-primary:hover {
    background: var(--primary-gold);
}

.modal .btn-secondary {
    background: var(--gray-600);
    border: none;
}

.modal .btn-secondary:hover {
    background: var(--gray-900);
}

/* Адаптивность */
@media (max-width: 768px) {
    .entity-page-header {
        padding: 1rem;
    }

    .entity-page-header h2 {
        font-size: 1.25rem;
    }

    .filter-card .row>div {
        margin-bottom: 0.5rem;
    }

    .table-card .table thead th,
    .table-card .table tbody td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   ДИАГРАММА ГАНТА 
   ============================================ */

.gantt-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.gantt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gantt-card-header i {
    color: var(--primary-teal);
    margin-right: 0.5rem;
}

.gantt-card-header>div:first-child {
    font-weight: 600;
    color: #1a1a2e;
}

.gantt-badge {
    background: var(--primary-teal);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-weight: 500;
}

.gantt-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.7rem;
    color: #6c757d;
}

.gantt-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.gantt-card-body {
    padding: 0.5rem 0;
}

.gantt-scroll {
    overflow-x: auto;
    padding: 0 1.25rem 0.5rem 1.25rem;
}

.gantt-chart {
    min-width: 700px;
}

/* Таймлайн */
.gantt-timeline-row {
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0.2rem;
    min-height: 30px;
}

.gantt-label-spacer {
    width: 220px;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gantt-timeline-header {
    flex: 1;
    position: relative;
    height: 24px;
}

.gantt-month-label {
    position: absolute;
    font-size: 0.6rem;
    color: #6c757d;
    transform: translateX(-50%);
    font-weight: 500;
    top: 0;
}

.gantt-grid-line {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 1px;
    background: #e9ecef;
    opacity: 0.5;
}

/* Строки */
.gantt-row {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f3f5;
    min-height: 44px;
}

.gantt-row:last-child {
    border-bottom: none;
}

.gantt-row-child {
    background: #f8fafc;
}

.gantt-label {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a2e;
    padding-right: 1rem;
}

.gantt-indent {
    color: #adb5bd;
    font-size: 0.7rem;
    margin-right: 2px;
}

.gantt-date-label {
    font-size: 0.6rem;
    font-weight: 400;
    color: #6c757d;
    margin-left: auto;
}

/* Полосы */
.gantt-bar-wrapper {
    flex: 1;
    position: relative;
    height: 28px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.gantt-bar {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 4px;
    min-width: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.gantt-bar:hover {
    transform: scaleY(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.gantt-bar-label {
    font-size: 0.6rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gantt-bar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.7rem;
    color: #adb5bd;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gantt-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gantt-legend {
        font-size: 0.65rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .gantt-label,
    .gantt-label-spacer {
        width: 140px;
        font-size: 0.75rem;
    }

    .gantt-chart {
        min-width: 500px;
    }
}

#field-content {
    width: 100%;
    min-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 500ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}


/* ============================================
   СПРАВКА О СИСТЕМЕ — Babok-School Style
   ============================================ */

.bs-help {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.bs-hero {
    background: #f8fafc;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    margin-bottom: 2.5rem;
}

.bs-hero-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: var(--primary-teal);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.bs-hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    margin: 0 0 0.75rem 0;
}

.bs-hero-text {
    font-size: 1.05rem;
    color: #4a5568;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 0 1.5rem 0;
}

.bs-hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.bs-stat {
    display: flex;
    flex-direction: column;
}

.bs-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-teal);
    line-height: 1;
}

.bs-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.bs-stat-divider {
    width: 1px;
    height: 32px;
    background: #dee2e6;
}

.bs-section {
    padding: 2rem 0;
}

.bs-section-alt {
    background: #f8fafc;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    margin: 0 -0.5rem;
}

.bs-section-head {
    text-align: center;
    margin-bottom: 2rem;
}

.bs-section-tag {
    display: inline-block;
    padding: 0.2rem 0.9rem;
    background: rgba(0, 127, 112, 0.1);
    color: var(--primary-teal);
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.bs-section-head h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 0.5rem 0;
}

.bs-section-head p {
    font-size: 0.95rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

.bs-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bs-flow-item {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f3;
    transition: all 0.2s ease;
}

.bs-flow-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.bs-flow-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
}

.bs-flow-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.25rem 0;
}

.bs-flow-item p {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.bs-flow-arrow {
    font-size: 1.2rem;
    color: #adb5bd;
    margin-top: 1rem;
}

.bs-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.bs-feature {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid #eef0f3;
    transition: all 0.2s ease;
}

.bs-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.bs-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.bs-feature h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.3rem 0;
}

.bs-feature>p {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.bs-feature ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #eef0f3;
    padding-top: 0.75rem;
}

.bs-feature ul li {
    font-size: 0.8rem;
    color: #4a5568;
    padding: 0.2rem 0 0.2rem 1.3rem;
    position: relative;
    line-height: 1.4;
}

.bs-feature ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: 700;
}

.bs-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.bs-docs-col h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-teal);
}

.bs-doc-item {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #e8eaed;
    font-size: 0.85rem;
    color: #4a5568;
}

.bs-doc-item:last-child {
    border-bottom: none;
}

.bs-doc-item strong {
    color: #1a1a2e;
}

.bs-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.bs-tag-html {
    background: var(--primary-teal);
}

.bs-tag-pdf {
    background: #dc3545;
}

.bs-tag-word {
    background: var(--primary-blue);
}

.bs-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.bs-role {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    border-top: 4px solid;
    transition: all 0.2s ease;
}

.bs-role:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.bs-role-admin {
    border-top-color: #dc3545;
}

.bs-role-teacher {
    border-top-color: var(--primary-teal);
}

.bs-role-student {
    border-top-color: var(--primary-blue);
}

.bs-role-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.bs-role h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.3rem 0;
}

.bs-role>p {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.bs-role ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #eef0f3;
    padding-top: 0.5rem;
}

.bs-role ul li {
    font-size: 0.8rem;
    color: #4a5568;
    padding: 0.2rem 0 0.2rem 1.3rem;
    position: relative;
    line-height: 1.4;
}

.bs-role ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-green);
    font-weight: 700;
}

.bs-steps {
    max-width: 700px;
    margin: 0 auto;
}

.bs-step {
    display: flex;
    gap: 1rem;
    padding: 0.8rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid #eef0f3;
    transition: all 0.2s ease;
}

.bs-step:hover {
    border-color: var(--primary-teal);
    box-shadow: 0 2px 12px rgba(0, 127, 112, 0.06);
}

.bs-step-num {
    width: 32px;
    height: 32px;
    background: var(--primary-teal);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bs-step h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.1rem 0;
}

.bs-step p {
    font-size: 0.82rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

.bs-chip {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #fff;
    font-weight: 600;
}

/* Flow Grid - многорядовая цепочка */
.bs-flow-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bs-flow-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eef0f3;
    padding: 1.25rem;
    transition: all 0.25s ease;
}

.bs-flow-row:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.bs-flow-label {
    flex-shrink: 0;
    width: 110px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.75rem 0.5rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bs-flow-label i {
    font-size: 1.5rem;
}

.bs-flow-label span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bs-flow-track {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0;
}

.bs-flow-track::-webkit-scrollbar {
    height: 4px;
}

.bs-flow-track::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.bs-flow-track .bs-flow-item {
    flex: 0 0 auto;
    min-width: 170px;
    max-width: 200px;
}

.bs-flow-track .bs-flow-arrow {
    margin-top: 1.25rem;
    flex-shrink: 0;
}

/* Сетка из 4 карточек */
.bs-features-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Layout "С чего начать" + mindmap ===== */
.bs-start-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.bs-start-layout .bs-steps {
    flex: 1 1 55%;
    max-width: none;
}

/* Карточка с mindmap */
.bs-mindmap-card {
    flex: 0 0 42%;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
}

.bs-mindmap-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #eef0f3;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 1rem;
}

.bs-mindmap-header i {
    color: var(--primary-teal, #007f70);
    font-size: 1.25rem;
}


.bs-mindmap-body {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
}

/* ===== HTML+CSS Mindmap ===== */
.bs-mindmap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Корневой узел — плоский */
.bs-mindmap-root {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary-teal, #007f70);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 127, 112, 0.2);
}

.bs-mindmap-root i {
    font-size: 1.1rem;
}

/* Дерево */
.bs-tree {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

/* Ветка 1-го уровня */
.bs-tree-branch {
    border: 1px solid #eef0f3;
    border-radius: 10px;
    border-left: 4px solid;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.bs-tree-branch:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bs-tree-branch[open] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Цвета веток (плоские) */
.bs-branch-teal {
    border-left-color: var(--primary-teal, #007f70);
}

.bs-branch-blue {
    border-left-color: var(--primary-blue, #004ab8);
}

.bs-branch-orange {
    border-left-color: var(--primary-orange, #cc4400);
}

.bs-branch-green {
    border-left-color: var(--primary-green, #009d27);
}

.bs-branch-cyan {
    border-left-color: var(--primary-cyan, #1999fb);
}

.bs-branch-gold {
    border-left-color: var(--primary-gold, #c79800);
}

/* Заголовок ветки (summary) */
.bs-tree-branch>summary {
    list-style: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a2e;
    user-select: none;
    transition: background 0.15s ease;
}

.bs-tree-branch>summary::-webkit-details-marker {
    display: none;
}

.bs-tree-branch>summary:hover {
    background: #f8fafc;
}

.bs-tree-branch>summary::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    margin-left: auto;
    font-size: 0.8rem;
    color: #adb5bd;
    transition: transform 0.2s ease;
}

.bs-tree-branch[open]>summary::after {
    transform: rotate(180deg);
}

/* Иконка ветки */
.bs-tree-branch>summary>i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.bs-branch-teal>summary>i {
    color: var(--primary-teal, #007f70);
}

.bs-branch-blue>summary>i {
    color: var(--primary-blue, #004ab8);
}

.bs-branch-orange>summary>i {
    color: var(--primary-orange, #cc4400);
}

.bs-branch-green>summary>i {
    color: var(--primary-green, #009d27);
}

.bs-branch-cyan>summary>i {
    color: var(--primary-cyan, #1999fb);
}

.bs-branch-gold>summary>i {
    color: var(--primary-gold, #c79800);
}

/* Контент ветки */
.bs-tree-content {
    padding: 0.25rem 0.5rem 0.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-top: 1px dashed #eef0f3;
    animation: bsTreeFade 0.2s ease;
}

@keyframes bsTreeFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Лист 2-го уровня */
.bs-tree-leaf {
    border-radius: 6px;
    transition: background 0.15s ease;
}

.bs-tree-leaf>summary {
    list-style: none;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #1a1a2e;
    font-weight: 500;
    user-select: none;
}

.bs-tree-leaf>summary::-webkit-details-marker {
    display: none;
}

.bs-tree-leaf>summary::before {
    content: "›";
    color: #adb5bd;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.bs-tree-leaf[open]>summary::before {
    transform: rotate(90deg);
}

.bs-tree-leaf:hover {
    background: #f8fafc;
}

.bs-tree-leaf[open] {
    background: #f8fafc;
}

.bs-tree-leaf>p {
    margin: 0 0 0.35rem 1.4rem;
    padding: 0 0.6rem 0 0;
    font-size: 0.78rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Адаптивность */
@media (max-width: 992px) {
    .bs-start-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .bs-mindmap-card {
        flex: 1 1 auto;
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .bs-tree-content {
        padding-left: 1.5rem;
    }
}

/* Адаптивность */
@media (max-width: 1200px) {
    .bs-mindmap-branches {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .bs-start-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .bs-mindmap-card {
        flex: 1 1 auto;
        width: 100%;
        position: static;
    }

    .bs-mindmap-branches {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .bs-mindmap-branches {
        grid-template-columns: repeat(2, 1fr);
    }

    .bs-mindmap-root-circle {
        width: 90px;
        height: 90px;
    }

    .bs-mindmap-root-circle i {
        font-size: 1.4rem;
    }

    .bs-mindmap-root-circle span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .bs-mindmap-branches {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .bs-features-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1023px) and (min-width: 600px) {
    .bs-features-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптивность для flow-grid */
@media (max-width: 992px) {
    .bs-flow-track .bs-flow-item {
        min-width: 130px;
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .bs-flow-row {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .bs-flow-label {
        width: 100%;
        flex-direction: row;
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }

    .bs-flow-label i {
        font-size: 1.25rem;
    }

    .bs-flow-label span {
        font-size: 0.85rem;
        text-transform: none;
        letter-spacing: 0;
    }

    .bs-flow-track {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .bs-flow-track .bs-flow-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }

    .bs-flow-track .bs-flow-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .bs-hero {
        padding: 2rem 1.25rem;
    }

    .bs-hero-title {
        font-size: 1.6rem;
    }

    .bs-hero-text {
        font-size: 0.9rem;
    }

    .bs-hero-stats {
        gap: 1rem;
    }

    .bs-stat-num {
        font-size: 1.5rem;
    }

    .bs-stat-divider {
        display: none;
    }

    .bs-flow-arrow {
        display: none;
    }

    .bs-flow-item {
        min-width: 100px;
    }

    .bs-section-head h2 {
        font-size: 1.4rem;
    }

    .bs-features,
    .bs-docs-grid,
    .bs-roles-grid {
        grid-template-columns: 1fr;
    }

    .bs-step {
        padding: 0.6rem 1rem;
    }
}