@font-face {
    font-family: 'alternategothic';
    src: url('../font/alternategothicno1.otf');
}

@font-face {
    font-family: 'DroidSans';
    src: url('../font/DroidSans.ttf');
}

@font-face {
    font-family: 'DroidSans-Bold';
    src: url('../font/DroidSans-Bold.ttf');
}

@font-face {
    font-family: 'Sangyo';
    src: url('../font/Sangyo-Regular.otf');
}

@font-face {
    font-family: 'ExtendaVariable';
    src: url('../font/0_ExtendaVariable-Regular.ttf');
}

:root {
    --navy-950: #061c35;
    --navy-900: #02315d;
    --navy-800: #073f76;
    --navy-700: #0a5d97;
    --blue-600: #1268d6;
    --gold-500: #c79b3b;
    --gold-600: #a77b24;
    --surface: #ffffff;
    --surface-soft: #f7fbff;
    --surface-blue: #f1f7fd;
    --border: #d7e3ef;
    --text: #102033;
    --muted: #5d6b7d;
    --success: #1f8f5f;
    --success-bg: #eaf8ef;
    --danger: #dc3545;
    --danger-bg: #fff0f2;
    --warning: #9a6b00;
    --warning-bg: rgba(255, 193, 7, 0.12);
    --shadow-soft: 0 14px 35px rgba(2, 49, 93, 0.08);
    --shadow-card: 0 18px 46px rgba(2, 49, 93, 0.12);
    --shadow-button: 0 12px 26px rgba(2, 49, 93, 0.22);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'DroidSans', Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(255,255,255,0.10), transparent 28%),
        linear-gradient(135deg, #02315d 0%, #053d70 55%, #074b82 100%);
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 44px 44px;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
    width: 100%;
    font-family: 'Sangyo', 'DroidSans-Bold', Arial, sans-serif;
    color: var(--navy-900);
    text-align: center;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: .02em;
}
a { color: inherit; }

/* ===== ОБЩИЕ КНОПКИ ===== */
.button_login,
.auth_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin: 8px auto 0;
    padding: 13px 24px;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: #ffffff;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 16px;
    letter-spacing: .02em;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: var(--shadow-button);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button_login:hover,
.auth_button:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(2, 49, 93, .28);
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
}

/* ===== АВТОРИЗАЦИЯ ===== */
.main { min-height: 100vh; }
.form_login,
.auth_container {
    width: min(430px, calc(100% - 32px));
    margin: 12vh auto 0;
    padding: 34px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(223,231,240,0.9);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
}
.form_login h1,
.auth_container h1 {
    margin-bottom: 24px;
    color: var(--navy-900) !important;
    text-shadow: none;
}
.img_logo_agiks {
    width: 100%;
    min-height: 190px;
    margin-bottom: 22px;
    background-image: url('../img/Znak.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.form_auth {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}
.form_auth input {
    width: 100%;
    margin: 0;
    padding: 15px 16px;
    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.form_auth input:focus {
    background: #ffffff;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(199,155,59,0.16);
}
.button_auth { width: 100%; text-align: center; }
.error_container_login {
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 14px;
    display: none;
    border-left: 4px solid var(--danger);
    background-color: #fff2f2;
    color: #832424;
    border-radius: var(--radius-md);
}
.error_container_login.show { display: block; }

/* ===== ЛИЧНЫЙ КАБИНЕТ ===== */
.account_container {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px;
}
.account_container h1 {
    max-width: 1180px;
    margin: 0 auto 24px;
    color: #ffffff;
    text-align: left;
    font-size: clamp(28px, 3.4vw, 44px);
    text-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
.account_info {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.account_menu_container {
    position: sticky;
    top: 22px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    padding: 16px;
    background: var(--navy-900);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.account_menu_container h2 {
    margin: 4px 0 16px;
    color: #ffffff;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 18px;
    text-align: left;
}
.account_menu_container h2::after {
    content: '';
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--gold-500);
}
.account_menu_container a {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 14px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.account_menu_container a:hover {
    background: rgba(199,155,59,.18);
    color: #ffffff;
    transform: translateX(2px);
}
.account_content { min-width: 0; padding: 0; background: transparent; }
.role-specific-content {
    width: 100%;
    margin: 0 0 20px;
    padding: 22px;
    background: rgba(255,255,255,.97);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.role-specific-content h2 {
    margin-bottom: 16px;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: clamp(22px, 2.5vw, 30px);
}
.role-specific-content p { color: var(--muted); line-height: 1.55; }
.role-specific-content a:not(.card-link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--navy-900);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}
.role-specific-content a:not(.card-link):hover { background: var(--navy-700); }

/* ===== КАРТОЧКИ ===== */
.course-card,
.class-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
}
.course-card:hover,
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.course-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--gold-500), var(--navy-700));
}
.course-card h3,
.class-card h3 {
    margin: 0 0 16px;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.25;
}
.course-card > p {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef5fb;
    color: var(--navy-800);
    font-size: 14px;
}
.payment_warning {
    margin-top: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--warning-bg);
    border: 1px solid rgba(255, 193, 7, 0.35);
    color: var(--warning);
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
}
.payment_warning.danger {
    background: var(--danger-bg);
    border-color: rgba(220,53,69,0.25);
    color: var(--danger);
}

/* ===== ТАБЫ СЕССИЙ ===== */
.session-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
}
.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 0;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tab-button:hover,
.tab-button.active { background: #ffffff; color: var(--navy-900); }
.tab-button.active { border-color: rgba(199,155,59,.42); box-shadow: 0 8px 20px rgba(6,28,53,.08); }
.session-content {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.class-item {
    margin-bottom: 12px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(6,28,53,0.06);
    color: var(--muted);
    line-height: 1.55;
}
.class-item:last-child { margin-bottom: 0; }
.class-item strong {
    display: block;
    margin-bottom: 8px;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 18px;
}
.class-item a,
.card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 12px 8px 0 0;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    background: var(--navy-900);
    color: #ffffff;
    text-decoration: none;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 14px;
    transition: background .2s ease, transform .2s ease;
}
.class-item a:hover,
.card-link:hover { background: var(--gold-600); transform: translateY(-1px); }

/* ===== СТРАНИЦА РАСПИСАНИЯ ===== */
.new_class_page {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 32px 20px 40px;
}
.new_class_page > h1 {
    color: #ffffff;
    text-align: left;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
    margin: 0 0 22px;
}
.top_actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.back_to_account { margin: 0; }
.back_to_account a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ffffff;
    text-decoration: none;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
    font-size: 14px;
    backdrop-filter: blur(12px);
    transition: background .2s ease, transform .2s ease;
}
.back_to_account a:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }
.page_actions {
    display: flex;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100%;
    margin: 0 0 22px;
}
.open_class_form {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    max-width: fit-content !important;
    min-width: unset !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 11px 20px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #1268d6 0%, #0757b8 100%) !important;
    color: #ffffff !important;
    font-family: 'DroidSans-Bold', Arial, sans-serif !important;
    font-size: 14px !important;
    letter-spacing: 0 !important;
    box-shadow: 0 10px 24px rgba(18,104,214,0.24);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease !important;
}
.open_class_form::before {
    content: '+';
    margin-right: 8px;
    font-size: 22px;
    line-height: 1;
    font-family: Arial, sans-serif;
    font-weight: 400;
}
.open_class_form:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #1d75e8 0%, #0a63ce 100%) !important;
    box-shadow: 0 14px 30px rgba(18,104,214,0.28);
}

/* ===== ФОРМЫ ===== */
.new_class_form {
    width: min(980px, 100%);
    margin: 0 0 30px;
    padding: clamp(20px, 3vw, 34px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 22px;
    align-items: stretch;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(2,49,93,0.12);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.new_class_form.hidden_form { display: none; }
.new_class_form.hidden_form.show_form { display: grid !important; }
.form_header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.form_header h2 {
    margin: 0;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 26px;
}
.close_form_button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(2,49,93,0.08);
    color: var(--navy-900);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.close_form_button:hover { background: var(--navy-900); color: #ffffff; transform: translateY(-1px); }
.form_group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.form_group.full_width { grid-column: 1 / -1; }
.form_group label {
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.35;
}
.new_class_form input,
.new_class_form select,
.new_class_form textarea,
.edit_class_form input,
.edit_class_form select,
.edit_class_form textarea {
    width: 100%;
    margin: 0;
    padding: 15px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.new_class_form textarea,
.edit_class_form textarea { min-height: 120px; resize: vertical; }
.new_class_form input:focus,
.new_class_form select:focus,
.new_class_form textarea:focus,
.edit_class_form input:focus,
.edit_class_form select:focus,
.edit_class_form textarea:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(18,104,214,0.12);
    transform: translateY(-1px);
}
.new_class_form .auth_button {
    grid-column: 1 / -1;
    width: fit-content;
    max-width: 260px;
    margin: 8px 0 0;
    padding: 14px 26px;
    border-radius: var(--radius-md);
    font-size: 16px;
}

/* ===== ТАБЛИЦА РАСПИСАНИЯ ===== */
.schedule-section {
    width: 100%;
    margin: 34px 0 0;
    padding: clamp(22px, 3vw, 32px);
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(2,49,93,0.10);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow-x: auto;
}
.schedule-section h2 {
    margin: 0 0 20px;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: clamp(26px, 3vw, 36px);
}
.schedule-section table {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 18px;
}
.schedule-section th {
    padding: 18px 14px;
    background: var(--navy-900);
    color: #ffffff;
    text-align: left;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.15;
}
.schedule-section th:first-child { border-top-left-radius: 18px; }
.schedule-section th:last-child { border-top-right-radius: 18px; }
.schedule-section td {
    padding: 16px 14px;
    border-bottom: 1px solid #e7eef6;
    background: #ffffff;
    color: var(--text);
    vertical-align: top;
    font-size: 14px;
}
.schedule-section tr:hover td { background: #f6faff; }
.class_datetime,
.teacher_card,
.link-class,
.link-recording {
    border: 1px solid #dce7f2;
    background: #f1f6fb;
}
.class_datetime {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.teacher_card {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 170px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
}
.teacher_card strong {
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
}
.teacher_card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
}
.class_link_block { display: block; margin-bottom: 8px; }
.class_link_block:last-child { margin-bottom: 0; }
.link-class,
.link-recording {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--navy-900);
    text-decoration: none;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.link-class:hover,
.link-recording:hover { background: var(--navy-900); color: #ffffff; transform: translateY(-1px); }
.status-badge,
.status-проведено,
.status-планируется,
.status-отменено,
.status-в_процессе {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
}
.status-проведено { background: var(--success-bg); color: var(--success); }
.status-планируется,
.status-в_процессе { background: #eef5fb; color: var(--navy-900); }
.status-отменено { background: var(--danger-bg); color: var(--danger); }

/* ===== ДЕЙСТВИЯ В ТАБЛИЦЕ ===== */
.table_action_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 46px;
    margin: 0 8px 8px 0;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.table_action_button:hover { transform: translateY(-2px); }
.table_action_button.edit {
    background: #ffffff;
    border-color: rgba(18,104,214,0.35);
    color: var(--blue-600);
}
.table_action_button.edit:hover {
    background: var(--blue-600);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(18,104,214,0.18);
}
.table_action_button.delete {
    background: #ffffff;
    border-color: rgba(220,53,69,0.35);
    color: var(--danger);
}
.table_action_button.delete:hover {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(220,53,69,0.18);
}

/* ===== ФОРМА РЕДАКТИРОВАНИЯ ===== */
.edit_row td {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
.edit_class_form {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 18px 14px 26px;
    padding: 30px 24px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(2,49,93,0.12);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(2,49,93,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.edit_class_form::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--blue-600), var(--navy-900));
}
.edit_form_title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--navy-900);
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 24px;
}
.edit_form_title::before {
    content: '✎';
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(18,104,214,0.08);
    color: var(--blue-600);
    font-size: 20px;
}
.edit_class_form .form_group.full_width { grid-column: 1 / -1; }
.edit_form_actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 8px;
}
.edit_save_button,
.edit_cancel_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 22px;
    border-radius: 16px;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.edit_save_button {
    min-width: 250px;
    border: none;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
    color: #ffffff;
    box-shadow: var(--shadow-button);
}
.edit_save_button:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(2,49,93,0.28); }
.edit_cancel_button {
    min-width: 140px;
    border: 1px solid rgba(2,49,93,0.14);
    background: #ffffff;
    color: var(--navy-900);
}
.edit_cancel_button:hover { background: rgba(2,49,93,0.05); transform: translateY(-1px); }

/* ===== АДМИН ===== */
.admin_link {
    display: block;
    margin: 12px 0;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(2,49,93,0.08);
    color: var(--navy-900);
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.admin_link:hover { background: var(--navy-900); color: #ffffff; transform: translateY(-2px); }
.admin_schedule_table { margin-top: 24px; overflow-x: auto; }
.admin_schedule_table table {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 18px;
    overflow: hidden;
}
.admin_schedule_table th {
    padding: 14px;
    background: var(--navy-900);
    color: #ffffff;
    text-align: left;
    font-size: 14px;
}
.admin_schedule_table td {
    padding: 14px;
    border-bottom: 1px solid #e7eef6;
    background: #ffffff;
    color: var(--text);
    vertical-align: top;
    font-size: 14px;
}
.admin_schedule_table tr:hover td { background: #f6faff; }
.admin_schedule_table a {
    display: inline-flex;
    margin: 0 6px 6px 0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(2,49,93,0.08);
    color: var(--navy-900);
    text-decoration: none;
    font-weight: 700;
}
.admin_schedule_table a:hover { background: var(--navy-900); color: #ffffff; }

/* ===== АДАПТИВ ===== */
@media (max-width: 1024px) {
    .account_container { padding: 22px; }
    .account_info { grid-template-columns: 1fr; }
    .account_menu_container {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .account_menu_container h2 { width: 100%; margin-bottom: 4px; }
    .account_menu_container a { flex: 1 1 170px; justify-content: center; margin-bottom: 0; }
}
@media (max-width: 992px) {
    .new_class_form,
    .edit_class_form { grid-template-columns: 1fr; }
    .edit_form_actions { flex-direction: column; }
    .edit_save_button,
    .edit_cancel_button { width: 100%; }
}
@media (max-width: 768px) {
    .form_login,
    .auth_container {
        margin-top: 7vh;
        padding: 26px 20px;
        border-radius: 22px;
    }
    .img_logo_agiks { min-height: 155px; }
    .button_login,
    .auth_button { font-size: 15px; }
    .account_container h1,
    .new_class_page > h1 { text-align: center; }
}
@media (max-width: 576px) {
    .account_container,
    .new_class_page { padding: 18px 12px 28px; }
    .account_menu_container,
    .role-specific-content,
    .course-card,
    .class-card,
    .session-content,
    .new_class_form,
    .schedule-section,
    .edit_class_form { border-radius: 18px; }
    .role-specific-content,
    .course-card,
    .class-card { padding: 16px; }
    .session-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
    }
    .tab-button { flex: 0 0 auto; white-space: nowrap; }
    .class-item a,
    .card-link,
    .role-specific-content a:not(.card-link) {
        width: 100%;
        margin-right: 0;
    }
    .open_class_form,
    .back_to_account a {
        width: 100% !important;
        max-width: 100% !important;
    }
    .page_actions,
    .top_actions { width: 100%; }
}

/* ===== Цветные статусы ===== */

.status_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 10px 14px;

    border-radius: 12px;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;
}

/* Проведено */

.status_badge.completed {
    background: rgba(31, 143, 95, 0.14);
    color: #1f8f5f;

    border: 1px solid rgba(31, 143, 95, 0.20);
}

/* Планируется */

.status_badge.planned {
    background: rgba(255, 193, 7, 0.16);
    color: #9a6b00;

    border: 1px solid rgba(255, 193, 7, 0.24);
}

/* Отменено */

.status_badge.cancelled {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;

    border: 1px solid rgba(220, 53, 69, 0.22);
}
/* В процессе */

.status_badge.progress {
    background: rgba(18, 104, 214, 0.12);
    color: #1268d6;

    border: 1px solid rgba(18, 104, 214, 0.20);
}

/* ===== Поиск слушателя ===== */

.student_search_group {
    position: relative;
}

.student_dropdown {
    display: none;

    position: absolute;

    left: 0;
    right: 0;
    top: calc(100% + 8px);

    max-height: 320px;
    overflow-y: auto;

    padding: 8px;

    background: #ffffff;

    border: 1px solid #d7e3ef;
    border-radius: 18px;

    box-shadow: 0 20px 48px rgba(2,49,93,0.18);

    z-index: 500;
}

.student_dropdown.show {
    display: block;
}

.student_option {
    display: block;

    width: 100%;

    padding: 14px 16px;

    border: none;
    border-radius: 14px;

    background: transparent;

    color: #102033;

    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 14px;

    text-align: left;

    cursor: pointer;

    transition: 0.2s ease;
}

.student_option:hover {
    background: #f1f7fd;
    color: #02315d;
}

.versions_list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.version_item {
    padding: 16px 18px;
    border-radius: 16px;
    background: #f1f7fd;
    border: 1px solid #d7e3ef;
}

.version_top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.version_date {
    color: #5d6b7d;
    font-size: 14px;
}

.version_number {
    color: #02315d;
    font-size: 16px;
}

.version_item p {
    margin: 0;
}

.version_description_list {
    margin: 10px 0 0;
    padding-left: 22px;

    color: #5d6b7d;

    line-height: 1.7;
    font-size: 15px;
}

.version_description_list li {
    margin-bottom: 6px;
}

.version_description_list li::marker {
    color: #02315d;
    font-weight: 700;
}

.button_login {
    text-decoration: none;
}

.main {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;
}

.form_login {
    margin: 0 auto;
}

.button_login {
    text-decoration: none;
}

/* ===== Верхняя панель ===== */

.top_panel {
    position: fixed;

    top: 22px;
    right: 22px;

    z-index: 1000;
}

.account_icon {
    width: 54px;
    height: 54px;

    border-radius: 50%;

    background: rgba(255,255,255,0.96);

    border: 1px solid rgba(255,255,255,0.14);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 14px 35px rgba(0,0,0,0.22);

    backdrop-filter: blur(12px);

    transition: 0.2s ease;

    text-decoration: none;
}

.account_icon:hover {
    transform: translateY(-2px);

    box-shadow: 0 18px 42px rgba(0,0,0,0.28);

    background: #ffffff;
}

.account_icon svg {
    width: 26px;
    height: 26px;

    fill: #02315d;
}

.users_filters {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 14px;
    margin-bottom: 20px;
}

.users_filters input,
.users_filters select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    background: #ffffff;
    color: #102033;
    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 15px;
}

@media (max-width: 768px) {
    .users_filters {
        grid-template-columns: 1fr;
    }
}

.messages_layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
}

.messages_users,
.messages_chat {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(2,49,93,0.10);
    border-radius: 26px;
    box-shadow: 0 18px 46px rgba(2,49,93,0.12);
    padding: 22px;
}

.messages_users h2 {
    color: #02315d;
    margin-bottom: 16px;
}

.messages_users a {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 12px 14px;
    margin-bottom: 10px;

    border-radius: 14px;

    background: #f1f7fd;
    color: #02315d;

    text-decoration: none;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.messages_users a small {
    color: #5d6b7d;
    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 12px;
}

.messages_users a.active,
.messages_users a:hover {
    background: #02315d;
    color: #ffffff;
}

.messages_users a.active small,
.messages_users a:hover small {
    color: rgba(255,255,255,0.75);
}

.messages_list {
    display: flex;
    flex-direction: column;
    gap: 14px;

    min-height: 360px;
    max-height: 520px;
    overflow-y: auto;

    padding: 14px;

    background: #f7fbff;
    border-radius: 20px;
    border: 1px solid #d7e3ef;
}

.message_item {
    max-width: 70%;
    padding: 14px 16px;
    border-radius: 18px;
}

.my_message {
    align-self: flex-end;
    background: #02315d;
    color: #ffffff;
}

.other_message {
    align-self: flex-start;
    background: #ffffff;
    color: #102033;
    border: 1px solid #d7e3ef;
}

.message_author {
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 13px;
    margin-bottom: 6px;
}

.message_text {
    line-height: 1.5;
}

.message_date {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.message_form {
    margin-top: 16px;

    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
}

.message_form textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;

    padding: 14px 16px;

    border: 1px solid #d7e3ef;
    border-radius: 16px;

    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 15px;
}

.message_form .auth_button {
    width: 100%;
    margin: 0;
}

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

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

    .message_item {
        max-width: 100%;
    }
}

.message_filters {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.message_filters input,
.message_filters select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7e3ef;
    border-radius: 12px;
    background: #ffffff;
    font-family: 'DroidSans', Arial, sans-serif;
}

.select_all_box {
    margin-bottom: 12px;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.messages_user_list {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow-y: auto;
}

.message_user_item {
    display: flex;
    gap: 10px;
    align-items: flex-start;

    padding: 12px;
    border-radius: 14px;

    background: #f1f7fd;
    color: #02315d;

    cursor: pointer;
}

.message_user_item:hover {
    background: #e6f1fb;
}

.message_user_item input {
    margin-top: 4px;
}

.message_user_item span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message_user_item small {
    color: #5d6b7d;
    font-size: 12px;
}

/* ===== Сообщения / диалоги ===== */

.messages_tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.messages_tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.14);
    color: #ffffff;
    text-decoration: none;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    transition: 0.2s ease;
}

.messages_tabs a:hover,
.messages_tabs a.active {
    background: #ffffff;
    color: #02315d;
}

.messages_layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.messages_users,
.messages_chat {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(2,49,93,0.10);
    border-radius: 26px;
    box-shadow: 0 18px 46px rgba(2,49,93,0.12);
    padding: 22px;
}

.messages_users h2,
.messages_chat h2 {
    margin-bottom: 12px;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.messages_chat_header {
    margin-bottom: 14px;
}

.messages_chat_header p {
    margin: 0;
    color: #5d6b7d;
}

.message_filters {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.message_filters input,
.message_filters select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d7e3ef;
    border-radius: 12px;
    background: #ffffff;
    font-family: 'DroidSans', Arial, sans-serif;
    color: #102033;
}

.select_all_box {
    margin-bottom: 12px;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.messages_user_list {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 4px;
}

.message_user_item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 14px;
    background: #f1f7fd;
    color: #02315d;
    transition: 0.2s ease;
}

.message_user_item:hover,
.message_user_item.active,
.group_chat_item:hover,
.group_chat_item.active {
    background: #02315d;
    color: #ffffff;
}

.message_user_item input {
    margin-top: 4px;
}

.message_user_item a,
.group_chat_item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.message_user_item small,
.group_chat_item small {
    color: #5d6b7d;
    font-size: 12px;
    line-height: 1.25;
}

.message_user_item:hover small,
.message_user_item.active small,
.group_chat_item:hover small,
.group_chat_item.active small {
    color: rgba(255,255,255,0.75);
}

.group_chat_item {
    padding: 10px 12px;
    border-radius: 14px;
    background: #f1f7fd;
    color: #02315d;
    transition: 0.2s ease;
}

.group_chat_item strong {
    display: block;

    font-size: 14px;
    line-height: 1.25;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.group_chat_item small {
    font-size: 11px !important;
    line-height: 1.25;
}

.messages_list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 430px;
    max-height: 560px;
    overflow-y: auto;
    padding: 16px;
    background: #f7fbff;
    border-radius: 20px;
    border: 1px solid #d7e3ef;
}

.message_item {
    max-width: 74%;
    padding: 14px 16px;
    border-radius: 18px;
}

.my_message {
    align-self: flex-end;
    background: #02315d;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.other_message {
    align-self: flex-start;
    background: #ffffff;
    color: #102033;
    border: 1px solid #d7e3ef;
    border-bottom-left-radius: 6px;
}

.message_author {
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 13px;
    margin-bottom: 6px;
}

.message_text {
    line-height: 1.5;
    word-break: break-word;
}

.message_date {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.message_form {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 14px;
}

.message_form textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    padding: 14px 16px;
    border: 1px solid #d7e3ef;
    border-radius: 16px;
    font-family: 'DroidSans', Arial, sans-serif;
    font-size: 15px;
    color: #102033;
    outline: none;
}

.message_form textarea:focus {
    border-color: #1268d6;
    box-shadow: 0 0 0 4px rgba(18,104,214,0.12);
}

.message_form .auth_button {
    width: 100%;
    margin: 0;
}

@media (max-width: 1000px) {
    .messages_layout {
        grid-template-columns: 1fr;
    }

    .messages_user_list {
        max-height: 360px;
    }
}

@media (max-width: 700px) {
    .message_form {
        grid-template-columns: 1fr;
    }

    .message_item {
        max-width: 100%;
    }
}

.menu_message_link {
    position: relative;
    justify-content: space-between;
    gap: 10px;
}

.menu_unread_badge {
    min-width: 24px;
    height: 24px;

    padding: 0 7px;

    border-radius: 999px;

    background: #dc3545;
    color: #ffffff;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== INLINE ФОРМА ДОБАВЛЕНИЯ СЛУШАТЕЛЯ ===== */

.page_actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin: 0 0 22px;
}

.new_class_form.hidden_form {
    display: none;
}

.new_class_form.hidden_form.show_form {
    display: grid !important;
}


/* ===== КАРТОЧКИ ВЕРСИЙ ===== */

.versions_list {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.version_item {
    position: relative;
    padding: 24px 26px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f7fd 100%);
    border: 1px solid rgba(18, 104, 214, 0.10);
    box-shadow: 0 10px 30px rgba(2, 49, 93, 0.06);
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.version_item:hover {
    transform: translateY(-3px);
    border-color: rgba(18, 104, 214, 0.22);
    box-shadow: 0 18px 42px rgba(2, 49, 93, 0.12);
}

.version_item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #1268d6 0%, #02315d 100%);
}

.version_top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.version_date {
    color: #5d6b7d;
    font-size: 14px;
}

.version_number {
    color: #02315d;
    font-size: 22px;
    line-height: 1;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.version_description_preview {
    position: relative;
}

.version_description_list {
    margin: 10px 0 0;
    padding-left: 22px;
    color: #5d6b7d;
    line-height: 1.7;
    font-size: 15px;
}

.version_description_list li {
    margin-bottom: 6px;
}

.version_description_list li::marker {
    color: #1268d6;
    font-weight: 700;
}

.version_full_text {
    margin-top: 0;
}

.version_bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 18px;
}

.version_toggle_link {
    display: inline-flex !important;
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    color: #1268d6 !important;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
    line-height: 1;

    text-decoration: none !important;
    cursor: pointer;

    transition: color .2s ease, opacity .2s ease, transform .2s ease;
}

.version_toggle_link:hover {
    background: transparent !important;
    color: #02315d !important;
    opacity: .9;
    transform: translateX(2px);
}

/* ===== МОБИЛЬНЫЙ ЧАТ КАК МЕССЕНДЖЕР ===== */

.mobile_chat_back {
    display: none;
}

@media (max-width: 700px) {

    .messages_layout {
        display: block !important;
    }

    .messages_sidebar,
    .messages_chat {
        border-radius: 20px;
        padding: 16px;
    }

    .messages_chat {
        display: none;
    }

    .messages_layout.chat_open .messages_sidebar {
        display: none;
    }

    .messages_layout.chat_open .messages_chat {
        display: block;
    }

    .messages_layout.chat_open .mobile_chat_back {
        display: inline-flex;
    }

    .mobile_chat_back {
        align-items: center;
        gap: 6px;

        margin-bottom: 14px;
        padding: 10px 14px;

        border: none;
        border-radius: 12px;

        background: #f1f7fd;
        color: #02315d;

        font-family: 'DroidSans-Bold', Arial, sans-serif;
        font-size: 14px;

        cursor: pointer;
    }

    .chat_messages {
        height: calc(100vh - 330px);
        min-height: 300px;
        max-height: none;
    }

    .message_item {
        max-width: 86%;
    }

    .message_me {
        margin-left: auto;
    }

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

    .message_form textarea {
        min-height: 76px;
    }

    .message_form .auth_button {
        min-height: 48px;
    }
}

.version_toggle_button {
    margin-top: 12px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #0b5cab;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: 0.2s;
}

.version_toggle_button:hover {
    background: #0f6ed1;
}

.version_description_wrapper {
    margin-top: 14px;
}

.version_description_preview {
    position: relative;
}

.version_toggle_link {
    margin-top: 8px;
    margin-left: auto;
    display: block;

    background: none;
    border: none;

    color: #0b5cab;
    font-size: 13px;

    cursor: pointer;

    padding: 0;

    text-align: right;
}

.version_toggle_link:hover {
    text-decoration: underline;
}

.version_full_text {
    margin-top: 8px;
}

.stream_status_item,
.admin_payment_item {
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stream_status_item span,
.admin_payment_item span {
    min-height: 32px;
    display: flex;
    align-items: flex-start;
}

.stream_status_item strong,
.admin_payment_item strong {
    margin-top: auto;
}

.role_subinfo {
    display: block;

    margin-top: 10px;

    color: #5d6b7d;

    font-size: 13px;
    line-height: 1.4;

    font-style: normal;
}

.message_status {
    margin-top: 6px;
    font-size: 12px;
    opacity: .75;
    text-align: right;
}

/* ===== РАСПИСАНИЕ СЛУШАТЕЛЯ В ЛИЧНОМ КАБИНЕТЕ ===== */
.student-schedule-section {
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.student-schedule-section table {
    min-width: 920px;
}

.student-schedule-section .class_datetime,
.student-schedule-section .teacher_card {
    display: inline-flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    background: rgba(2, 49, 93, 0.08) !important;
    color: #02315d !important;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.student-schedule-section .teacher_card strong { color: #02315d !important; }
.student-schedule-section .teacher_card span { color: #5d6b7d !important; font-size: 13px !important; }
.student-schedule-section .class_link_block { display: block !important; margin-bottom: 10px !important; }

.student-schedule-section .class_link_block .link-class,
.student-schedule-section .class_link_block .link-recording {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    background: rgba(2, 49, 93, 0.08) !important;
    color: #02315d !important;
    text-decoration: none !important;
    font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.student-schedule-section .class_link_block .link-class:hover,
.student-schedule-section .class_link_block .link-recording:hover {
    background: #02315d !important;
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .student-schedule-section {
        margin-top: 14px !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .student-schedule-section table,
    .student-schedule-section thead,
    .student-schedule-section tbody,
    .student-schedule-section tr,
    .student-schedule-section th,
    .student-schedule-section td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .student-schedule-section table {
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .student-schedule-section thead { display: none !important; }

    .student-schedule-section tr {
        margin-bottom: 14px !important;
        padding: 14px !important;
        border: 1px solid #d7e3ef !important;
        border-radius: 18px !important;
        background: #ffffff !important;
        box-shadow: 0 8px 22px rgba(6,28,53,0.06) !important;
    }

    .student-schedule-section td {
        position: relative !important;
        padding: 11px 0 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e7eef6 !important;
        background: transparent !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    .student-schedule-section td:last-child {
        border-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .student-schedule-section td::before {
        content: attr(data-label) !important;
        display: block !important;
        margin-bottom: 7px !important;
        color: #5d6b7d !important;
        font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
        letter-spacing: .03em !important;
    }

    .student-schedule-section .class_datetime,
    .student-schedule-section .teacher_card,
    .student-schedule-section .status_badge,
    .student-schedule-section .link-class,
    .student-schedule-section .link-recording {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .student-schedule-section .teacher_card { align-items: center !important; }
    .student-schedule-section .class_link_block { width: 100% !important; margin-bottom: 8px !important; }
}

.online_dot,
.offline_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.online_dot {
    background: #1f8f5f;
}

.offline_dot {
    background: #9aa6b2;
}

.mark_attendance_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 10px 16px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(135deg, #1268d6, #02315d);
    color: #ffffff;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;

    cursor: pointer;

    box-shadow: 0 8px 18px rgba(18,104,214,0.22);

    transition: .2s ease;
}

.mark_attendance_button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #1d75e8, #073f76);
}

.online_dot,
.offline_dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.online_dot {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34,197,94,0.7);
}

.offline_dot {
    background: #9ca3af;
}

.chat_info_btn,
.readers_btn {
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    background: #eef3f8;
    color: #02315d;
    font-weight: 700;
    cursor: pointer;
}

.readers_btn {
    margin-top: 6px;
    font-size: 12px;
}

.chat_modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2,49,93,.45);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat_modal.active {
    display: flex;
}

.chat_modal_box {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    padding: 24px;
}

.chat_modal_close {
    float: right;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.chat_member_item {
    padding: 10px 0;
    border-bottom: 1px solid #e5edf5;
}
/* =========================================================
   АДАПТИВНЫЕ ДОРАБОТКИ 2026
   Вставлено в конец файла, чтобы переопределить старые правила.
   ========================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
.auth_button,
.button_login,
.table_action_button,
.mark_attendance_button,
.chat_info_btn,
.readers_btn,
.open_class_form,
.edit_save_button,
.edit_cancel_button {
    touch-action: manipulation;
}

.account_container,
.new_class_page,
.role-specific-content,
.course-card,
.class-card,
.messages_users,
.messages_chat,
.schedule-section,
.admin_schedule_table,
.student-schedule-section,
.new_class_form,
.edit_class_form {
    max-width: 100%;
}

.account_content,
.messages_chat,
.messages_users,
.schedule-section,
.admin_schedule_table {
    min-width: 0;
}

/* ===== Кабинет: современная сетка на ПК ===== */
@media (min-width: 1200px) {
    .account_info {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 26px;
    }

    .account_menu_container {
        padding: 18px;
    }

    .role-specific-content {
        padding: 26px;
    }
}

/* ===== Планшеты ===== */
@media (max-width: 1100px) {
    .account_container,
    .new_class_page {
        padding: 22px 16px 34px;
    }

    .account_info,
    .messages_layout {
        grid-template-columns: 1fr !important;
    }

    .account_menu_container {
        position: static !important;
        max-height: none !important;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .account_menu_container h2 {
        grid-column: 1 / -1;
    }

    .account_menu_container a {
        margin: 0;
        justify-content: center;
        text-align: center;
    }

    .messages_user_list {
        max-height: 380px;
    }
}

/* ===== Таблицы: аккуратная прокрутка на планшетах ===== */
@media (min-width: 769px) {
    .schedule-section,
    .admin_schedule_table,
    .student-schedule-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .schedule-section table,
    .admin_schedule_table table,
    .student-schedule-section table {
        width: 100%;
    }
}

/* ===== Телефон: общие отступы и карточки ===== */
@media (max-width: 768px) {
    body {
        background-attachment: fixed;
    }

    h1 {
        font-size: clamp(25px, 8vw, 34px) !important;
        line-height: 1.12 !important;
    }

    h2 {
        font-size: clamp(21px, 6vw, 28px) !important;
        line-height: 1.18 !important;
    }

    .account_container,
    .new_class_page {
        width: 100%;
        padding: 16px 10px 26px !important;
    }

    .account_container h1,
    .new_class_page > h1 {
        margin-bottom: 16px !important;
        text-align: center !important;
    }

    .role-specific-content,
    .course-card,
    .class-card,
    .messages_users,
    .messages_chat,
    .schedule-section,
    .new_class_form,
    .edit_class_form,
    .version_item {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .account_menu_container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .account_menu_container a {
        width: 100%;
        min-height: 44px;
        padding: 11px 12px;
        font-size: 14px;
    }

    .top_panel {
        top: 12px !important;
        right: 12px !important;
    }

    .account_icon {
        width: 46px !important;
        height: 46px !important;
    }

    .account_icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .top_actions,
    .page_actions,
    .edit_form_actions,
    .version_top,
    .version_bottom {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .back_to_account a,
    .open_class_form,
    .auth_button,
    .button_login,
    .edit_save_button,
    .edit_cancel_button,
    .mark_attendance_button {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 48px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .new_class_form,
    .edit_class_form {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .form_header {
        gap: 10px;
    }

    .form_header h2,
    .edit_form_title {
        font-size: 21px !important;
    }

    .close_form_button {
        flex: 0 0 42px;
    }

    .new_class_form input,
    .new_class_form select,
    .new_class_form textarea,
    .edit_class_form input,
    .edit_class_form select,
    .edit_class_form textarea,
    .form_auth input,
    .users_filters input,
    .users_filters select,
    .message_filters input,
    .message_filters select,
    .message_form textarea {
        font-size: 16px !important;
    }
}

/* ===== Расписание на телефоне: таблица превращается в карточки ===== */
@media (max-width: 768px) {
    .schedule-section,
    .admin_schedule_table,
    .student-schedule-section {
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .schedule-section h2,
    .student-schedule-section h2 {
        padding: 0 4px;
        color: #ffffff !important;
        text-shadow: 0 3px 14px rgba(0,0,0,.28);
    }

    .role-specific-content .student-schedule-section h2,
    .role-specific-content .schedule-section h2 {
        color: var(--navy-900) !important;
        text-shadow: none !important;
    }

    .schedule-section table,
    .schedule-section thead,
    .schedule-section tbody,
    .schedule-section tr,
    .schedule-section th,
    .schedule-section td,
    .admin_schedule_table table,
    .admin_schedule_table thead,
    .admin_schedule_table tbody,
    .admin_schedule_table tr,
    .admin_schedule_table th,
    .admin_schedule_table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .schedule-section thead,
    .admin_schedule_table thead {
        display: none !important;
    }

    .schedule-section tr,
    .admin_schedule_table tr {
        margin-bottom: 14px !important;
        padding: 14px !important;
        border: 1px solid #d7e3ef !important;
        border-radius: 18px !important;
        background: #ffffff !important;
        box-shadow: 0 10px 26px rgba(6,28,53,0.10) !important;
        overflow: hidden;
    }

    .schedule-section td,
    .admin_schedule_table td {
        position: relative !important;
        padding: 11px 0 12px !important;
        border: 0 !important;
        border-bottom: 1px solid #e7eef6 !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    .schedule-section td:last-child,
    .admin_schedule_table td:last-child {
        border-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .schedule-section td::before,
    .admin_schedule_table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 7px;
        color: #5d6b7d;
        font-family: 'DroidSans-Bold', 'DroidSans', Arial, sans-serif;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .class_datetime,
    .teacher_card,
    .status_badge,
    .status-badge,
    .status-проведено,
    .status-планируется,
    .status-отменено,
    .status-в_процессе,
    .link-class,
    .link-recording,
    .table_action_button,
    .admin_schedule_table a {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        margin-right: 0 !important;
    }

    .teacher_card {
        align-items: center !important;
    }

    .class_link_block {
        width: 100% !important;
    }
}

/* ===== Чаты: ПК/планшет/телефон ===== */
.messages_layout {
    width: 100%;
}

.messages_sidebar,
.messages_users {
    min-width: 0;
}

.group_chat_item,
.message_user_item,
.messages_users a {
    min-width: 0;
}

.group_chat_item span,
.message_user_item span,
.messages_users a span,
.message_text {
    overflow-wrap: anywhere;
}

@media (min-width: 1001px) {
    .messages_layout {
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) !important;
    }
}

@media (max-width: 700px) {
    .messages_tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .messages_tabs a {
        min-height: 42px;
        padding: 10px 8px;
        text-align: center;
        font-size: 13px;
    }

    .messages_users,
    .messages_sidebar,
    .messages_chat {
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .messages_user_list {
        max-height: none !important;
        padding-right: 0 !important;
    }

    .messages_list,
    .chat_messages {
        min-height: 310px !important;
        height: calc(100vh - 310px) !important;
        max-height: none !important;
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .message_item {
        max-width: 88% !important;
        padding: 12px 14px !important;
        border-radius: 16px !important;
    }

    .my_message,
    .message_me {
        margin-left: auto !important;
    }

    .message_form {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-top: 12px !important;
    }

    .message_form textarea {
        min-height: 68px !important;
        max-height: 150px;
    }

    .chat_info_btn,
    .readers_btn {
        width: 100%;
        min-height: 40px;
        margin-top: 8px;
    }
}

/* ===== Модальные окна чата ===== */
@media (max-width: 576px) {
    .chat_modal {
        padding: 10px !important;
        align-items: flex-end !important;
    }

    .chat_modal_box {
        max-width: 100% !important;
        max-height: 88vh !important;
        border-radius: 22px 22px 0 0 !important;
        padding: 18px !important;
    }
}

/* ===== Версии и списки ===== */
@media (max-width: 576px) {
    .version_item {
        padding: 18px !important;
    }

    .version_number {
        font-size: 20px !important;
    }

    .version_description_list {
        padding-left: 18px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .stream_status_item,
    .admin_payment_item {
        min-height: auto !important;
        gap: 8px;
    }
}

/* ===== Авторизация ===== */
@media (max-width: 576px) {
    .main {
        align-items: flex-start !important;
        padding: 22px 10px !important;
    }

    .form_login,
    .auth_container {
        width: 100% !important;
        margin: 0 auto !important;
        padding: 22px 16px !important;
        border-radius: 20px !important;
    }

    .img_logo_agiks {
        min-height: 130px !important;
        margin-bottom: 16px !important;
    }
}

/* ===== Очень маленькие телефоны ===== */
@media (max-width: 380px) {
    .account_container,
    .new_class_page {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .role-specific-content,
    .course-card,
    .class-card,
    .messages_users,
    .messages_chat,
    .schedule-section tr,
    .admin_schedule_table tr,
    .new_class_form,
    .edit_class_form {
        padding: 12px !important;
    }

    .messages_tabs {
        grid-template-columns: 1fr !important;
    }

    .message_item {
        max-width: 94% !important;
    }
}

.account_online_status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font-size: 14px;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
}

.account_online_dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.account_online_dot.online {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34,197,94,0.8);
}

.account_online_dot.offline {
    background: #9ca3af;
}

.account_online_status {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 18px;
    padding: 9px 14px;

    border-radius: 999px;

    background: #eaf8ef;
    border: 1px solid rgba(31, 143, 95, 0.22);

    color: #1f8f5f;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;

    width: fit-content;
}

.account_online_dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.account_online_dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.14);
}

.account_online_dot.offline {
    background: #9ca3af;
}

@media (max-width: 768px) {
    .account_online_status {
        width: 100%;
        justify-content: center;
    }
}

.platform_online_block {
    display: inline-flex;
    align-items: center;
    gap: 14px;

    margin: 0 0 22px;

    padding: 16px 20px;

    border-radius: 18px;

    background: linear-gradient(
        135deg,
        rgba(18,104,214,0.10),
        rgba(2,49,93,0.06)
    );

    border: 1px solid rgba(18,104,214,0.12);

    box-shadow: 0 10px 26px rgba(2,49,93,0.06);
}

.platform_online_icon {
    width: 14px;
    height: 14px;

    border-radius: 50%;

    background: #22c55e;

    box-shadow:
        0 0 0 6px rgba(34,197,94,0.12),
        0 0 18px rgba(34,197,94,0.45);

    animation: adminOnlinePulse 2s infinite;
}

.platform_online_text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform_online_text span {
    color: #5d6b7d;
    font-size: 13px;
}

.platform_online_text strong {
    color: #02315d;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
}

@keyframes adminOnlinePulse {

    0% {
        transform: scale(.9);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@media (max-width: 768px) {

    .platform_online_block {
        width: 100%;
        justify-content: center;
    }

    .platform_online_text {
        align-items: center;
    }
}

.platform_online_block {
    border: none;
    cursor: pointer;
}

.online_users_modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 20px;
    background: rgba(2,49,93,0.55);
    align-items: center;
    justify-content: center;
}

.online_users_modal.active {
    display: flex;
}

.online_users_modal_box {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

.online_users_modal_box h3 {
    margin: 0 0 18px;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 24px;
}

.online_users_modal_close {
    float: right;
    border: none;
    background: transparent;
    color: #02315d;
    font-size: 22px;
    cursor: pointer;
}

.online_users_list {
    display: grid;
    gap: 10px;
}

.online_user_item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 16px;
    border-radius: 16px;

    background: #f1f7fd;
    color: #02315d;

    text-decoration: none;

    transition: .2s ease;
}

.online_user_item:hover {
    background: #02315d;
    color: #ffffff;
    transform: translateY(-1px);
}

.online_user_item span:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.online_user_item strong {
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 14px;
}

.online_user_item small {
    color: #5d6b7d;
    font-size: 12px;
}

.online_user_item:hover small {
    color: rgba(255,255,255,0.75);
}

.online_user_dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.14);
    flex-shrink: 0;
}

/* ===== СУПЕР-КОМПАКТНЫЙ ЧАТ В ЭКРАН ===== */

.new_class_page {
    max-width: 1320px !important;
    padding: 18px 16px 16px !important;
}

.new_class_page > h1 {
    font-size: 34px !important;
    margin-bottom: 10px !important;
}

.back_to_account {
    margin-bottom: 6px !important;
}

.back_to_account a {
    min-height: 38px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
}

.messages_tabs {
    margin-bottom: 10px !important;
    gap: 8px !important;
}

.messages_tab {
    min-height: 38px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
}

.messages_layout {
    grid-template-columns: 260px minmax(0, 1fr) !important;
    gap: 14px !important;
}

.messages_sidebar,
.messages_chat {
    padding: 14px !important;
    border-radius: 20px !important;
}

.messages_sidebar h2,
.chat_header h2 {
    font-size: 18px !important;
    margin-bottom: 8px !important;
}

.chat_header {
    margin-bottom: 8px !important;
}

.chat_header p {
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.chat_info_btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
}

.chat_user {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
    border-radius: 14px !important;
}

.chat_user strong {
    font-size: 13px !important;
    line-height: 1.2 !important;
}

.chat_user small {
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin-top: 3px !important;
}

.chat_messages {
    height: calc(100vh - 285px) !important;
    min-height: 300px !important;
    max-height: none !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    border-radius: 16px !important;
}

.message_item {
    max-width: 78% !important;
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.message_author {
    font-size: 11px !important;
    margin-bottom: 5px !important;
}

.message_text {
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.message_time,
.message_status,
.message_action_link,
.readers_btn {
    font-size: 10px !important;
}

.message_form {
    gap: 8px !important;
}

.typing_status {
    min-height: 14px !important;
    margin-bottom: 6px !important;
    font-size: 11px !important;
}

.message_form textarea {
    min-height: 46px !important;
    max-height: 64px !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
}

.message_form .auth_button {
    min-height: 38px !important;
    width: 160px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
}

.reply_preview {
    padding: 8px 10px !important;
    border-radius: 12px !important;
}

.reply_preview strong,
.reply_preview span {
    font-size: 11px !important;
}

@media (max-width: 900px) {
    .messages_layout {
        grid-template-columns: 1fr !important;
    }

    .chat_messages {
        height: calc(100vh - 315px) !important;
        min-height: 280px !important;
    }

    .message_item {
        max-width: 100% !important;
    }

    .message_form .auth_button {
        width: 100% !important;
    }
}

/* ===== ФИО В ЛС В ОДНУ СТРОКУ ===== */

.chat_user strong {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;

    width: 100% !important;

    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;

    font-size: 13px !important;
    line-height: 1.2 !important;
}

.chat_user strong span {
    flex-shrink: 0 !important;
}

.chat_user {
    overflow: hidden !important;
}


/* =========================================
   AGIKS MESSENGER UI V2 — COMPACT MODERN
   Добавлено для улучшения внешнего вида сообщений
========================================= */

.messages_layout {
    display: grid !important;
    grid-template-columns: 320px minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
}

.messages_sidebar,
.messages_chat {
    background: rgba(255,255,255,0.96) !important;
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 28px !important;
    box-shadow:
        0 20px 60px rgba(2,49,93,0.14),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: 18px !important;
}

.messages_sidebar h2 {
    margin-bottom: 14px !important;
    font-size: 28px !important;
    color: #02315d !important;
}

.messages_search {
    margin-bottom: 14px !important;
}

.messages_search input {
    width: 100%;
    height: 48px;
    padding: 0 16px !important;
    border-radius: 16px !important;
    border: 1px solid #d8e3ef !important;
    background: #f7fbff !important;
    font-size: 14px !important;
    transition: .2s ease;
}

.messages_search input:focus {
    border-color: #1268d6 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(18,104,214,0.12);
}

.chat_user {
    position: relative;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    padding: 14px 15px !important;
    margin-bottom: 10px !important;
    border-radius: 18px !important;
    background: #f2f7fc !important;
    border: 1px solid transparent;
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease !important;
}

.chat_user:hover {
    transform: translateY(-2px);
    border-color: rgba(18,104,214,0.18);
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(2,49,93,0.08);
}

.chat_user.active {
    background: linear-gradient(135deg, #02315d 0%, #0a4d87 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 18px 36px rgba(2,49,93,0.22);
}

.chat_user strong {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px !important;
    line-height: 1.25 !important;
}

.chat_user small {
    font-size: 11px !important;
    line-height: 1.35 !important;
    color: #5d6b7d !important;
}

.chat_user.active small {
    color: rgba(255,255,255,0.74) !important;
}

.online_dot,
.offline_dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
}

.online_dot {
    background: #31d158;
    box-shadow: 0 0 10px rgba(49,209,88,0.9);
}

.offline_dot {
    background: #b9c1cb;
}

.chat_header h2 {
    font-size: 22px !important;
    line-height: 1.2 !important;
    margin-bottom: 6px !important;
}

.chat_header p {
    font-size: 13px !important;
}

.chat_messages {
    height: calc(100vh - 335px) !important;
    min-height: 380px !important;
    max-height: unset !important;
    padding: 16px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%) !important;
    border-radius: 22px !important;
    border: 1px solid #d7e3ef !important;
    scrollbar-width: thin;
}

.message_item {
    position: relative;
    max-width: 72% !important;
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    box-shadow: 0 10px 24px rgba(2,49,93,0.06);
}

.message_me {
    background: linear-gradient(135deg, #02315d 0%, #0b4f88 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

.message_author {
    font-size: 12px !important;
    margin-bottom: 7px !important;
}

.message_text {
    font-size: 13px !important;
    line-height: 1.5 !important;
}

.message_time {
    margin-top: 8px !important;
    font-size: 11px !important;
    opacity: .72;
}

.message_reply_quote {
    border-radius: 14px !important;
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
}

.message_form {
    gap: 10px !important;
}

.message_form textarea {
    min-height: 58px !important;
    max-height: 120px !important;
    border-radius: 18px !important;
    padding: 14px 16px !important;
    font-size: 14px !important;
    background: #f8fbff !important;
    transition: .2s ease;
}

.message_form textarea:focus {
    background: #ffffff !important;
    border-color: #1268d6 !important;
    box-shadow: 0 0 0 4px rgba(18,104,214,0.10);
}

.message_form .auth_button {
    width: 190px !important;
    min-height: 46px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
}

.unread_badge {
    min-width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
}

@media (max-width: 900px) {
    .messages_layout {
        grid-template-columns: 1fr !important;
    }

    .message_item {
        max-width: 100% !important;
    }

    .chat_messages {
        height: calc(100vh - 320px) !important;
    }

    .message_form .auth_button {
        width: 100% !important;
    }
}


/* ===== ВЛОЖЕНИЯ В ЧАТЕ: КАРТИНКИ И ФАЙЛЫ ===== */

.message_attachments {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.chat_image_link {
    display: block;
    width: fit-content;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.18);
    text-decoration: none;
}

.chat_image {
    display: block;
    max-width: min(360px, 100%);
    max-height: 320px;
    object-fit: cover;
    border-radius: 16px;
}

.chat_file_card {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: inherit;
    text-decoration: none;
    transition: .2s ease;
}

.message_item:not(.message_me) .chat_file_card {
    background: #f1f7fd;
    border-color: #d7e3ef;
    color: #02315d;
}

.chat_file_card:hover {
    transform: translateY(-1px);
    opacity: .92;
}

.chat_file_icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(18,104,214,0.14);
    flex-shrink: 0;
}

.chat_file_info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat_file_info strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.25;
}

.chat_file_info small {
    opacity: .75;
    font-size: 11px;
}

.chat_upload_box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 14px;
    background: #eef3f8;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: .2s ease;
}

.chat_upload_box:hover {
    background: #dce7f3;
    transform: translateY(-1px);
}

.chat_upload_box input {
    display: none;
}

.selected_files {
    display: grid;
    gap: 6px;
}

.selected_file_item {
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 10px;
    background: #f1f7fd;
    color: #5d6b7d;
    font-size: 12px;
}

@media (max-width: 700px) {
    .chat_image {
        max-width: 100%;
        max-height: 260px;
    }

    .chat_file_card,
    .chat_upload_box {
        width: 100%;
    }
}

.chat_upload_box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px dashed #9bb4cc;
    border-radius: 14px;
    background: #f1f7fd;
    color: #02315d;
    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.chat_upload_box input {
    display: none;
}

.chat_upload_box:hover {
    background: #e6f1fb;
}

.selected_files {
    display: grid;
    gap: 6px;
}

.selected_file_item {
    padding: 8px 10px;
    border-radius: 10px;
    background: #eef3f8;
    color: #02315d;
    font-size: 12px;
}

/* ===== КНОПКА ОТМЕТИТЬ В ТАБЛИЦЕ ===== */

.mark_attendance_button {
    width: 100%;
    min-width: 120px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(135deg, #1268d6, #02315d);
    color: #ffffff;

    font-family: 'DroidSans-Bold', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;

    cursor: pointer;

    box-shadow: 0 8px 18px rgba(18,104,214,0.22);

    transition: .2s ease;

    white-space: nowrap;
}

.mark_attendance_button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #1d75e8, #073f76);
}

/* колонка действий */
.attendance_actions {
    min-width: 140px;
}