
/* Базовый размер шрифта масштабируется с шириной экрана.
   На 1920px → ~17px, на 2560px → ~20px, минимум 15px */
html { font-size: clamp(15px, 1.1vw, 22px); }

:root {
    --primary: #1E90FF;
    --primary-dark: #1c7cd6;
    --bg-body: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.98);
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Верхняя панель */
.interactive-panel {
    background: #ffffff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

.nav-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
}

/* Основной макет */
.main-layout {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
}


.faculties-sidebar {
    flex: 0 0 clamp(200px, 18vw, 340px);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: clamp(14px, 1.5vw, 28px);
    box-shadow: var(--shadow);
    border: 1px solid #ffffff;
    overflow-y: auto;
}

.sidebar-title {
    font-size: clamp(1rem, 1.3vw, 1.8rem);
    font-weight: 700;
    margin-bottom: clamp(10px, 1.2vh, 22px);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.faculty-side-btn {
    width: 100%;
    padding: clamp(8px, 0.9vh, 16px) clamp(10px, 1vw, 18px);
    margin-bottom: 5px;
    border-radius: 10px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 16px);
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
    font-weight: 500;
    font-size: clamp(0.82rem, 1vw, 1.35rem);
}

.faculty-side-btn:hover {
    background: #f8fafc;
    padding-left: 20px;
}

.faculty-side-btn .side-icon {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}


.info-central {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 2.5vw, 50px);
    box-shadow: var(--shadow);
    border: 1px solid #ffffff;
    overflow-y: auto;
}


#universalSearch {
    width: 100%;
    padding: 14px 24px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    font-size: 16px;
    transition: 0.3s;
    margin-bottom: 30px;
    background: #f8fafc;
}

#universalSearch:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 144, 255, 0.1);
}


.search-item {
    background: #fff;
    border: 1px solid #eef2f6;
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 15px;
    transition: 0.3s;
}

.search-item:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border-color: var(--primary);
}


.search-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 8px;
}


.footer-note {
    margin-top: 50px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}


@media (max-width: 1024px) {
    .main-layout { flex-direction: column; }
    .faculties-sidebar { flex: none; width: 100%; position: static; }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


.side-icon {
    width: clamp(32px, 3vw, 54px) !important;
    height: clamp(32px, 3vw, 54px) !important;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-icon img {
    width: clamp(24px, 2.2vw, 40px) !important;
    height: clamp(24px, 2.2vw, 40px) !important;
    object-fit: contain;
}


.faculty-detail-icon {
    width: 120px !important; 
    height: 120px !important;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faculty-detail-icon img {
    max-width: 100px !important;
    max-height: 100px !important;
    object-fit: contain;
}


.faculty-side-btn {
    display: flex !important;
    align-items: center !important;
    overflow: hidden; 
    gap: 15px;
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-content {
    animation: fadeInSlide 0.4s ease-out forwards;
}
.spec-card {
    background: white;
    border-left: 5px solid #1E90FF;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
}
.spec-card:hover { transform: scale(1.02); }
.spec-code { background: #eef2f8; padding: 4px 10px; border-radius: 6px; font-weight: bold; font-size: 0.8rem; }
.spec-badge { float: right; color: #1E90FF; font-weight: 600; }
.exam-tag { color: #555; font-style: italic; }


/* ── Направления подготовки ───────────────────────────────────────────────── */

.dirs-layout {
    display: flex;
    gap: 24px;
    height: 100%;
}

.dirs-sidebar {
    flex: 0 0 clamp(280px, 28vw, 500px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.dirs-level-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.dirs-lvl-tab {
    width: 100%;
    padding: clamp(8px, 0.9vh, 16px) clamp(10px, 1vw, 18px);
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: clamp(0.82rem, 1vw, 1.25rem);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
}
.dirs-lvl-tab:hover { border-color: var(--primary); color: var(--primary); }
.dirs-lvl-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.dirs-search-input {
    width: 100%;
    padding: clamp(8px, 0.9vh, 16px) clamp(10px, 1vw, 18px);
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: clamp(0.82rem, 1vw, 1.25rem);
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}
.dirs-search-input:focus { border-color: var(--primary); background: #fff; }

.dirs-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
    min-height: 0; /* нужно чтобы flex-child скроллился */
}

.dirs-list-item {
    padding: clamp(8px, 0.8vh, 16px) clamp(10px, 1vw, 18px);
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    background: #f8fafc;
}
.dirs-list-item:hover { border-color: var(--primary); background: #eef6ff; }
.dirs-list-item.selected { border-color: var(--primary); background: #dbeafe; }

.dirs-item-code {
    display: block;
    font-size: clamp(0.7rem, 0.8vw, 1rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}
.dirs-item-name {
    display: block;
    font-size: clamp(0.8rem, 0.9vw, 1.15rem);
    color: var(--text-main);
    line-height: 1.4;
}

.dirs-detail {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}
.dirs-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #cbd5e1;
    text-align: center;
}

/* Карточка направления */
.dir-header {
    margin-bottom: 20px;
}
.dir-code-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-right: 8px;
    letter-spacing: 0.5px;
}
.dir-level-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}
.dir-name {
    margin-top: 10px;
    font-size: clamp(1rem, 1.5vw, 2rem);
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
}

.dir-slots-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.dir-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.dir-slots-row .dir-block { flex: 1; margin-bottom: 0; }

.dir-block-budget { border-top: 3px solid #22c55e; }
.dir-block-paid   { border-top: 3px solid #f59e0b; }

.dir-block-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.dir-block-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 12px 0 8px;
    font-weight: 600;
}

.slots-table { width: 100%; border-collapse: collapse; }
.slots-label { font-size: clamp(0.8rem, 0.9vw, 1.2rem); color: var(--text-muted); padding: clamp(4px,0.5vh,8px) 0; }
.slots-val   { font-size: clamp(0.85rem, 1vw, 1.3rem); font-weight: 700; color: #1e293b; text-align: right; }

.exams-bak, .exams-mag { display: flex; flex-direction: column; gap: 8px; }

.exam-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.92rem;
    color: #1e293b;
}
.exam-row-muted { color: var(--text-muted); font-size: 0.88rem; }
.exam-lbl {
    flex: 0 0 110px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.exam-lbl-required { background: #fee2e2; color: #dc2626; }
.exam-lbl-profile  { background: #fef3c7; color: #d97706; }

.electives-list { display: flex; flex-direction: column; gap: 6px; }
.elective-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.9rem;
    color: #334155;
}
.elective-num {
    flex: 0 0 22px;
    height: 22px;
    width: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

@media (max-width: 768px) {
    .dirs-layout { flex-direction: column; }
    .dirs-sidebar { flex: none; }
    .dirs-list { max-height: 220px; }
    .dir-slots-row { flex-direction: column; }
}

/* ── Сроки приёмов документов ─────────────────────────────────────────────── */

.sched-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sched-tab {
    padding: 10px 24px;
    border-radius: 30px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sched-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sched-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.25);
}

.sched-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.sched-accordion:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.sched-acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    user-select: none;
    transition: background 0.2s;
}

.sched-acc-header:hover { background: #eef2f6; }

.sched-accordion.open .sched-acc-header {
    background: #eef6ff;
    color: var(--primary);
    border-bottom: 1px solid #dbeafe;
}

.acc-arrow {
    font-size: 0.75rem;
    transition: transform 0.25s;
    color: var(--text-muted);
}

.sched-accordion.open .acc-arrow { transform: rotate(180deg); }

.sched-acc-body {
    display: none;
    padding: 0;
}

.sched-accordion.open .sched-acc-body { display: block; }

.sched-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.sched-table thead th {
    background: #f1f5f9;
    padding: 10px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sched-table tbody tr {
    border-top: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.sched-table tbody tr:hover { background: #f8fafc; }

.sched-td-event {
    padding: 13px 20px;
    color: var(--text-main);
    line-height: 1.5;
}

.sched-td-date {
    padding: 13px 20px;
    color: var(--primary);
    font-weight: 600;
    white-space: pre-line;
    min-width: 240px;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────────── */

@media print {

    body * {
        visibility: hidden;
    }

    .print-container,
    .print-container * {
        visibility: visible;
    }

    .print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    body {
        background: white;
    }
}