html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

/* Основные цвета и кнопки */
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ====================== СКРУГЛЁННЫЙ ДИЗАЙН ====================== */

.card {
    border-radius: 28px !important; /* Увеличил скругление карточек */
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

    .card:hover {
        transform: translateY(-6px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
    }

.btn {
    border-radius: 50px !important; /* Кнопки остаются сильно скруглёнными (овальными) */
    padding: 10px 26px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.input-group .form-control {
    border-radius: 50px 0 0 50px !important;
    border-right: none;
}

.input-group .btn {
    border-radius: 0 50px 50px 0 !important;
}

/* Навигация в сайдбаре */
.nav-link {
    border-radius: 50px !important;
    margin-bottom: 6px;
    padding: 12px 22px !important;
    transition: all 0.2s;
}

    .nav-link:hover, .nav-link.active {
        background: rgba(255,255,255,0.15) !important;
    }

/* Sidebar */
.page {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #9eb6ff 0%, #60a5fa 38%, #3b82f6 62%, #4c1d95 100%) !important;
    color: white;
    width: 260px;
    flex: 0 0 260px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    z-index: 100;
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    transition: width 0.22s ease, flex-basis 0.22s ease, transform 0.22s ease;
}

.sidebar-header {
    background: transparent;
    border-bottom: none;
    padding: 0.9rem 0.85rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 88px;
    flex-shrink: 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: #fff;
}

.brand-wordmark {
    display: block;
    height: 58px;
    width: 188px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 10px;
}

.sidebar-header .brand-text {
    display: none !important;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,.22);
    }

.toggle-bars {
    width: 14px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 -5px 0 #fff, 0 5px 0 #fff;
}

.nav-ico {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-footer {
    position: static;
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,.2);
}

.sidebar-toggle-mobile {
    display: none;
    padding: 6px 12px !important;
    border-radius: 12px !important;
}

.sidebar-backdrop {
    display: none;
}

/* Свёрнутое меню */
.page.sidebar-collapsed .sidebar {
    width: 76px;
    flex-basis: 76px;
}

.page.sidebar-collapsed .brand-wordmark,
.page.sidebar-collapsed .brand-text {
    display: none;
}

.page.sidebar-collapsed .brand-mark {
    display: block;
}

.page.sidebar-collapsed .nav-label {
    display: none;
}

.page.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    justify-content: center;
}

.page.sidebar-collapsed .nav-link {
    justify-content: center;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.page.sidebar-collapsed main {
    margin-left: 0 !important;
}

/* Главный контент */
.page main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0 !important;
    min-height: 100vh;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb;
}

.content {
    background: #f8fafc;
    min-height: calc(100vh - 70px);
    padding-top: 1.5rem;
}

/* Блоки на главной */
.ad-block {
    border-radius: 28px !important;
}

.shadow-sm {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
}

/* Дополнительные улучшения */
.form-control {
    border-radius: 16px;
}

.list-group-item {
    border-radius: 16px;
    margin-bottom: 8px;
}

/* Hover для карточек дисциплин */
.card:hover {
    transform: translateY(-8px);
}

.content {
    padding-left: 0 !important;
}

@media (max-width: 991.98px) {
    .page {
        display: block;
    }

    .sidebar-toggle-mobile {
        display: inline-flex !important;
    }

    .sidebar,
    .page.sidebar-collapsed .sidebar,
    .page.sidebar-open .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        max-width: 80vw !important;
        flex: none !important;
        margin: 0 !important;
        z-index: 3000 !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow-y: auto;
    }

    .page.sidebar-collapsed .sidebar {
        transform: translateX(-105%) !important;
        box-shadow: none !important;
        pointer-events: none;
    }

    .page.sidebar-open .sidebar {
        transform: translateX(0) !important;
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.25) !important;
        pointer-events: auto;
    }

    /* Hide the prerendered drawer before Blazor can determine the viewport. */
    .page.sidebar-initializing .sidebar {
        transform: translateX(-105%) !important;
        visibility: hidden !important;
        box-shadow: none !important;
        pointer-events: none;
        transition: none !important;
    }

    .page.sidebar-collapsed .brand-text,
    .page.sidebar-collapsed .nav-label {
        display: inline;
    }

    .page.sidebar-collapsed .sidebar-header {
        flex-direction: row;
    }

    .page main,
    .page.sidebar-collapsed main {
        margin-left: 0 !important;
        width: 100%;
        max-width: 100%;
    }

    .top-bar {
        flex-wrap: wrap;
        align-items: center;
        gap: 8px !important;
        padding: 10px 12px !important;
    }

        .top-bar .sidebar-toggle-mobile {
            flex: 0 0 auto;
        }

        .top-bar .ms-auto {
            margin-left: auto !important;
            flex: 0 0 auto;
        }

            .top-bar .ms-auto .btn {
                padding: 8px 14px !important;
            }

        .top-bar .search-box,
        .top-bar > .position-relative {
            flex: 1 1 100%;
            max-width: 100% !important;
            width: 100%;
            order: 5;
        }

        .top-bar .input-group {
            flex-wrap: nowrap;
            width: 100%;
        }

            .top-bar .input-group .form-control {
                min-width: 0;
                flex: 1 1 auto;
            }

            .top-bar .input-group .btn {
                flex: 0 0 auto;
                padding: 8px 16px !important;
                white-space: nowrap;
            }

    .content {
        padding: 1rem 12px !important;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        z-index: 2500;
    }
}

/* Дополнительное сильное скругление для карточек в категориях */
.categories-card {
    border-radius: 32px !important;
}
