* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

nav {
    background: linear-gradient(120deg, #10203f 0%, #1a2a4a 45%, #27406e 100%);
    color: white;
    padding: 0.9rem 1.4rem;
    box-shadow: 0 8px 22px rgba(16, 32, 63, 0.25);
    position: sticky;
    top: 0;
    z-index: 30;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo a {
    color: white;
    font-size: 1.35rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 0.2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-main-links {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    margin-left: 0;
    text-decoration: none;
    transition: all 0.2s;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.22);
}

.nav-links a.active {
    background: #ffffff;
    color: #1a2a4a;
    font-weight: 600;
}

.nav-links .logout-link {
    border-color: rgba(255,255,255,0.35);
    background: rgba(233, 72, 92, 0.15);
    border: 1px solid rgba(233, 72, 92, 0.45);
    color: #ffe8eb;
    font-weight: 600;
}

.nav-links .logout-link:hover {
    background: rgba(233, 72, 92, 0.32);
    border-color: rgba(255, 158, 170, 0.7);
    color: #ffffff;
}

/* Кнопка «гамбургер» — только мобилка/планшет (см. @media ниже) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    flex-shrink: 0;
    z-index: 120;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-menu-open .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.nav-menu-open .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

body.nav-menu-open .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 108;
    background: rgba(10, 20, 40, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.nav-backdrop:not([hidden]) {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    body.layout-wide .container {
        max-width: none;
        margin: 1.5rem auto 2rem;
        padding: 0 1.5rem;
    }
    .nav-container--wide {
        max-width: none;
        padding: 0 1.5rem;
    }
}

.container--auth {
    max-width: 480px;
    margin: 2rem auto;
}

footer {
    background: #1a2a4a;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 3rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.buttons {
    margin-top: 1.5rem;
}

/* --- Кнопки: базовый компонент (внутренние страницы) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.3;
    width: auto;
    margin: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

a.btn {
    box-sizing: border-box;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(26, 42, 74, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #5a6fd6 100%);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #4e63c4 100%);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: #1f4fc7;
    border: 2px solid #1f4fc7;
}

.btn-outline:hover {
    background: #eef3ff;
    color: #1a3fa8;
}

.btn-ghost {
    background: #f5f7fa;
    color: #4a5568;
    border: 1px solid #d0d7de;
}

.btn-ghost:hover {
    background: #eef1f5;
    color: #1a2a4a;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-danger {
    background: #c62828;
    color: #fff;
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

.btn-danger:hover {
    background: #b71c1c;
    color: #fff;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    align-items: center;
}

.modal-actions .btn,
.modal-actions .btn-ghost {
    flex: 1;
    min-width: 120px;
}

/* Кнопки на градиентном hero (главная) */
.hero .btn {
    margin: 0 0.5rem;
}

.hero .btn-primary {
    background: #fff;
    color: #667eea;
}

.hero .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid #fff;
}

.hero .btn-primary:hover {
    background: #f8f9ff;
    color: #5a6fd6;
}

.hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: #1a2a4a;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    background: #f8f9fb;
}

.auth-form button[type="submit"].btn,
.auth-form button[type="submit"]:not(.btn) {
    width: 100%;
}

button:not(.btn):not(.map-filter):not(.map-locate-btn):not(.map-route-btn):not(.map-list-row):not(.modal-close):not(.nav-toggle):not(.group-picker-tag button) {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #5a6fd6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

button:not(.btn):not(.map-filter):not(.map-locate-btn):not(.map-route-btn):not(.map-list-row):not(.modal-close):not(.nav-toggle):not(.group-picker-tag button):hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #4e63c4 100%);
}

.admin-panel-page form button[type="submit"] {
    margin-top: 0.25rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.admin-panel,
.admin-panel-page {
    max-width: none;
    width: 100%;
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.nav-main-links a.nav-tab-active {
    font-weight: 700;
    text-decoration: underline;
}

.admin-students-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8faff;
    border-radius: 10px;
    border: 1px solid #dfe8f8;
}

.admin-pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

.flash-warning {
    background: #fff8e1;
    border: 1px solid #ffcc80;
    color: #5d4037;
}

.teacher-dashboard-page .teacher-dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e4ebf8;
}

.teacher-dashboard-page .teacher-slots-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 2rem;
    align-items: start;
}

.teacher-dashboard-page .teacher-slots-sidebar {
    background: #f8faff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #dfe8f8;
    max-height: 75vh;
    overflow-y: auto;
}

.teacher-dashboard-page .slot-card {
    background: #fff;
    box-shadow: 0 2px 8px rgba(26, 42, 74, 0.06);
}

.teacher-dashboard-page .teacher-bookings-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #dfe8f8;
    box-shadow: 0 4px 16px rgba(26, 42, 74, 0.06);
}

.teacher-dashboard-page .teacher-slots-sidebar .sidebar-actions {
    margin-bottom: 1rem;
}

.teacher-dashboard-page .empty-state .btn {
    margin-top: 1rem;
}

.appointment-teachers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.teacher-card {
    background: #fff;
    border: 1px solid #dfe8f8;
    border-radius: 12px;
    padding: 1.35rem;
    box-shadow: 0 4px 16px rgba(26, 42, 74, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.teacher-card h3 {
    color: #1a2a4a;
    margin: 0;
    font-size: 1.1rem;
}

.teacher-card p {
    margin: 0;
    color: #5a6c85;
    font-size: 0.92rem;
}

.teacher-card .card-action {
    margin-top: auto;
    padding-top: 0.75rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.status-badge.pending { background: #fff3e0; color: #e65100; }
.status-badge.confirmed { background: #e8f5e9; color: #2e7d32; }
.status-badge.rejected { background: #ffebee; color: #c62828; }

body.layout-wide .schedule-container {
    width: 100%;
    max-width: none;
}

.admin-log {
    margin-top: 1rem;
    text-align: left;
}

.admin-note {
    margin: 0.9rem 0 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 10px;
    background: #f3f7ff;
    border: 1px solid #d8e4fb;
    text-align: left;
}

.admin-note h3 {
    margin-bottom: 0.45rem;
    font-size: 1rem;
    color: #1a2a4a;
}

.admin-note p {
    margin: 0.25rem 0;
    line-height: 1.45;
}

.admin-log pre {
    background: #0f172a;
    color: #d9e5ff;
    padding: 0.9rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 0.85rem;
    max-height: 260px;
    overflow: auto;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

a.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

a.card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

a.card-link .card-arrow {
    display: inline-block;
    margin-top: 0.75rem;
    color: #2B587A;
    font-weight: 600;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.schedule-table {
    overflow-x: auto;
}

table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #1a2a4a;
    color: white;
}

tr:hover {
    background: #f5f5f5;
}

.student-card {
    max-width: 600px;
    margin: 0 auto;
}

.card-container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.qr-code img {
    margin-top: 1rem;
    max-width: 200px;
}

.flash {
    background: #4caf50;
    color: white;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert {
    background: #ffc107;
    color: #333;
    padding: 1rem;
    border-radius: 5px;
    text-align: center;
}

.news-items {
    display: grid;
    gap: 1.25rem;
    margin-top: 1rem;
}

.news-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(26, 42, 74, 0.08);
    overflow: hidden;
    display: grid;
    grid-template-columns: 220px 1fr;
}

.news-image {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    background: #e9ecef;
}

.news-content {
    padding: 1rem 1.25rem;
}

.news-content h3 {
    margin-bottom: 0.5rem;
    color: #1a2a4a;
    line-height: 1.35;
}

.news-content p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.news-content a {
    color: #1f4fc7;
    font-weight: 600;
    text-decoration: none;
}

.news-content a:hover {
    text-decoration: underline;
}
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

select:hover {
    border-color: #667eea;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}
.hint {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Дополнительные стили для расписания */
.schedule-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(26, 42, 74, 0.1);
}

.schedule-header {
    background: linear-gradient(135deg, #1a2a4a 0%, #2c3e66 100%);
    color: white;
    padding: 20px;
}

.schedule-header h2 {
    margin: 0 0 5px 0;
}

.schedule-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.schedule-filters {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.schedule-filter {
    color: #e8eeff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    transition: all 0.2s;
}

.schedule-filter:hover {
    background: rgba(255, 255, 255, 0.15);
}

.schedule-filter.active {
    background: #ffffff;
    color: #1a2a4a;
    border-color: #ffffff;
    font-weight: 600;
}

.day-card {
    margin: 20px;
    background: #f8faff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e3eaf7;
}

.day-title {
    background: #e9ecef;
    padding: 12px 20px;
    font-weight: bold;
    color: #1a2a4a;
    border-left: 4px solid #2c3e66;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.lesson-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s;
    gap: 12px;
}

.lesson-item:hover {
    background: #fff;
}

.lesson-time {
    width: 130px;
    font-weight: 600;
    color: #2c3e66;
}

.lesson-number {
    width: 34px;
    background: #2c3e66;
    color: white;
    border-radius: 20px;
    text-align: center;
    padding: 2px 8px;
    font-size: 12px;
    margin-top: 1px;
}

.lesson-info {
    flex: 1;
}

.lesson-subject {
    font-weight: 600;
    margin-bottom: 4px;
}

.lesson-details {
    font-size: 13px;
    color: #6c757d;
}

.lesson-details span {
    margin-right: 15px;
    display: inline-block;
    margin-bottom: 4px;
}

.lesson-type {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    background: #e8edf7;
    color: #1a2a4a;
}

.type-lecture {
    background: #e3f2fd;
    color: #1565c0;
}

.type-practice {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-lab {
    background: #fff3e0;
    color: #ef6c00;
}

.empty-schedule {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.work-banner {
    background: linear-gradient(135deg, #fff8e1 0%, #ffefc3 100%);
    border: 1px solid #f5d37a;
    border-radius: 12px;
    padding: 1.2rem 1.3rem;
    box-shadow: 0 8px 20px rgba(201, 152, 27, 0.15);
}

.work-banner h2 {
    color: #7a5200;
    margin-bottom: 0.45rem;
}

.work-banner p {
    color: #6b4b0b;
    line-height: 1.5;
}

.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    color: #1a2a4a;
    margin-bottom: 0.35rem;
}

.map-section {
    margin-top: 1rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4ebf8;
    box-shadow: 0 8px 20px rgba(26, 42, 74, 0.08);
    padding: 1rem;
}

.map-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 1rem;
}

.map-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4ebf8;
    box-shadow: 0 8px 20px rgba(26, 42, 74, 0.08);
    padding: 0.9rem;
    position: sticky;
    top: 90px;
    height: fit-content;
}

.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.map-filters {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.map-filter, .map-locate-btn {
    border: 1px solid #ced9f1;
    background: #f5f8ff;
    color: #1a2a4a;
    border-radius: 999px;
    padding: 0.36rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.map-filter.active {
    background: #1f4fc7;
    border-color: #1f4fc7;
    color: #fff;
}

.map-locate-btn {
    background: #e8f7ff;
    border-color: #a9dfff;
}

#vyatsuMap {
    height: 440px;
    border-radius: 10px;
    overflow: hidden;
}

.map-list-panel {
    min-width: 0;
}

.second-header {
    margin-top: 1rem;
}

.compact-grid {
    grid-template-columns: 1fr;
}

.location-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.7rem;
    padding: 0.55rem;
}

.location-photo {
    width: 100%;
    height: 100%;
    min-height: 94px;
    max-height: 110px;
    object-fit: cover;
    border-radius: 8px;
    background: #e9ecef;
}

.location-body h3 {
    margin-bottom: 0.3rem;
}

.distance-text {
    margin-top: 0.35rem;
    font-weight: 600;
}

.map-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.map-section-header h2 {
    color: #1a2a4a;
}

.map-section-header a {
    text-decoration: none;
    color: #1f4fc7;
    font-weight: 600;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.8rem;
}

.location-card {
    background: #f8faff;
    border: 1px solid #dfe8f8;
    border-radius: 10px;
    padding: 0.8rem;
}

.location-card h3 {
    color: #1a2a4a;
    margin-bottom: 0.4rem;
    font-size: 1.02rem;
}

.location-card p {
    margin: 0.2rem 0;
    line-height: 1.4;
}

.map-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 420px;
    overflow-y: auto;
}

.map-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #dfe8f8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
}

.map-list-row:hover,
.map-list-row.active {
    border-color: #1f4fc7;
    background: #eef3ff;
}

.map-list-row-title {
    font-weight: 600;
    color: #1a2a4a;
}

.map-detail-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #dfe8f8;
    border-radius: 10px;
    background: #f8faff;
    display: none;
}

.map-detail-panel.visible {
    display: block;
}

.map-detail-panel img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.map-detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.map-route-btn {
    background: linear-gradient(135deg, #667eea 0%, #5a6fd6 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
}

.map-route-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #4e63c4 100%);
}

.map-open-external {
    display: inline-flex;
    margin-top: 0.5rem;
}

.map-key-warning {
    padding: 1rem;
    background: #fff8e1;
    border: 1px solid #ffcc80;
    border-radius: 10px;
    margin-bottom: 1rem;
    color: #5d4037;
}

@media (max-width: 900px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-panel {
        position: static;
    }

    .news-item {
        grid-template-columns: 1fr;
    }

    .news-image {
        max-height: 240px;
    }

    .student-card-layout {
        grid-template-columns: 1fr;
    }
}

/* FAQ Accordion */
.faq-search {
    margin-bottom: 1.5rem;
}

.faq-search input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e4ebf8;
    border-radius: 12px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

.faq-search input:focus {
    outline: none;
    border-color: #1f4fc7;
    box-shadow: 0 0 0 3px rgba(31, 79, 199, 0.1);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.faq-item {
    background: #fff;
    border: 1px solid #e4ebf8;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.faq-item:hover {
    box-shadow: 0 4px 16px rgba(26, 42, 74, 0.08);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #1a2a4a;
    text-align: left;
    border-radius: 0;
}

.faq-question:hover {
    background: #f8faff;
}

.faq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1f4fc7;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-icon {
    background: #e9485c;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-question[aria-expanded="true"] + .faq-answer {
    max-height: 500px;
    padding: 0 1.2rem 1.2rem;
}

.faq-answer p {
    color: #4a5568;
    line-height: 1.65;
    margin: 0;
}

/* 3D Student Card */
.student-card-layout {
    display: grid;
    grid-template-columns: 320px 1fr 220px;
    gap: 1.5rem;
    align-items: start;
}

.card-3d-scene {
    perspective: 1200px;
}

.card-3d-front {
    background: linear-gradient(145deg, #10203f 0%, #1a2a4a 50%, #27406e 100%);
    border-radius: 16px;
    padding: 0;
    color: #fff;
    box-shadow:
        0 20px 50px rgba(16, 32, 63, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transform: rotateY(-3deg) rotateX(2deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}

.card-3d-front:hover {
    transform: rotateY(0deg) rotateX(0deg);
    box-shadow:
        0 24px 60px rgba(16, 32, 63, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.card-3d-header {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-3d-body {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.card-3d-photo {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.card-3d-photo-placeholder {
    width: 90px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.card-3d-info {
    font-size: 0.82rem;
    line-height: 1.55;
}

.card-3d-info p {
    margin: 0.15rem 0;
}

.card-3d-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem !important;
}

.card-3d-footer {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-align: center;
    letter-spacing: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.card-form-panel h2,
.card-qr-panel h2 {
    color: #1a2a4a;
    margin-bottom: 1rem;
}

.card-qr-panel {
    text-align: center;
}

.card-qr-panel .qr-code img {
    max-width: 160px;
    margin-top: 0.5rem;
}

.card-qr-panel .qr-code p {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

@media (max-width: 700px) {
    .lesson-item {
        flex-direction: column;
    }

    .lesson-time {
        width: auto;
    }

    .day-card {
        margin: 12px;
    }

    .location-item {
        grid-template-columns: 1fr;
    }

    .location-photo {
        max-height: 190px;
    }
}

/* ========== Мобильная вёрстка: меню-«шторка» и крупные зоны нажатия ========== */
@media (max-width: 768px) {
    .site-nav {
        padding: 0.65rem 0.85rem;
        z-index: 110;
    }

    .nav-container {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .logo a {
        font-size: 1.15rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: min(90vw, 300px);
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 4.25rem) 1rem 2rem;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        flex-wrap: nowrap;
        background: linear-gradient(180deg, #152a52 0%, #10203f 100%);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
        transform: translateX(100%);
        transition: transform 0.28s ease;
        z-index: 112;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.nav-menu-open .nav-links {
        transform: translateX(0);
    }

    body.nav-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .nav-main-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.35rem;
        flex-wrap: nowrap;
    }

    .nav-main-links a {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        border-radius: 10px;
        margin-left: 0 !important;
        text-align: left;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-actions {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        width: 100%;
    }

    .nav-actions .logout-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        width: 100%;
        text-align: center;
    }

    .container {
        margin: 1rem auto;
        padding: 0 0.85rem;
    }

    .hero {
        padding: 1.75rem 1rem;
    }

    .hero h1 {
        font-size: 1.55rem;
        line-height: 1.25;
    }

    .buttons .btn {
        display: block;
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .admin-panel {
        max-width: none;
    }

    .auth-form {
        padding: 1.35rem 1rem;
    }

    #vyatsuMap {
        height: min(55vh, 380px);
    }

    .schedule-header {
        padding: 16px;
    }

    .schedule-filters {
        gap: 8px;
    }

    footer {
        padding: 0.85rem;
        font-size: 0.85rem;
        line-height: 1.45;
    }

    .card-icon {
        font-size: 2.25rem;
    }
}