/* Светлая тема админки: «шапки» страниц и карточки в духе кнопки «Настройки» (slate) */
body.page-admin-panel:not(.admin-theme-dark) {
    --jy-admin-slate: #1e293b;
    --jy-admin-slate-mid: #334155;
    --jy-admin-slate-border: rgba(30, 41, 59, 0.14);
    --jy-admin-canvas: #e2e8f0;
    --jy-admin-canvas-top: #f1f5f9;
    --jy-admin-surface: #ffffff;
    --jy-admin-accent: #2563eb;
    --jy-admin-accent-2: #3b82f6;
}

/* Фон рабочей области и шапка — как на скрине мессенджера (светлый «CRM») */
body.page-admin-panel:not(.admin-theme-dark) .main-content {
    background: linear-gradient(180deg, var(--jy-admin-canvas-top) 0%, var(--jy-admin-canvas) 45%, #dce3ec 100%);
    color: #0f172a;
}

body.page-admin-panel:not(.admin-theme-dark) .header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(30, 41, 59, 0.1);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(10px);
}

body.page-admin-panel:not(.admin-theme-dark) .header .btn-auth:not(#adminPushBtn):not(.admin-theme-toggle) {
    border-color: rgba(37, 99, 235, 0.42);
    color: var(--jy-admin-accent);
    background: rgba(255, 255, 255, 0.98);
}

body.page-admin-panel:not(.admin-theme-dark) .header .btn-auth:not(#adminPushBtn):not(.admin-theme-toggle):hover {
    background: linear-gradient(135deg, var(--jy-admin-accent-2), var(--jy-admin-accent));
    border-color: #1d4ed8;
    color: #fff;
}

body.page-admin-panel:not(.admin-theme-dark) .header .btn-auth.admin-theme-toggle {
    border-color: rgba(51, 65, 85, 0.35);
    color: var(--jy-admin-slate-mid);
    background: rgba(248, 250, 252, 0.95);
}

body.page-admin-panel:not(.admin-theme-dark) .header .btn-auth.admin-theme-toggle:hover {
    background: #e2e8f0;
    color: var(--jy-admin-slate);
    border-color: rgba(51, 65, 85, 0.45);
}

/* Web Push в шапке: индиго-фон из inline — текст и рамка читаемые */
body.page-admin-panel .header #adminPushBtn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

body.page-admin-panel .header #adminPushBtn:hover {
    color: #fff;
    background: #4338ca;
    border-color: rgba(255, 255, 255, 0.55);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-main-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 28px;
    background: var(--jy-admin-surface);
    border-radius: 14px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-welcome {
    color: #475569;
}

body.page-admin-panel:not(.admin-theme-dark) .analytics-content-card,
body.page-admin-panel:not(.admin-theme-dark) .income-content-card {
    background: var(--jy-admin-surface);
    border-radius: 12px;
    border: 1px solid rgba(30, 41, 59, 0.1);
    box-shadow: 0 6px 26px rgba(15, 23, 42, 0.07);
    padding: 22px 24px;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-surface-panel {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 55%, #ffffff 100%);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-panel-title {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 700;
    color: var(--jy-admin-slate-mid);
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-panel-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background: #fff;
    color: #0f172a;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-input:focus {
    border-color: var(--jy-admin-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-btn {
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, filter 0.2s;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-btn--primary {
    background: linear-gradient(135deg, var(--jy-admin-accent-2), var(--jy-admin-accent));
    color: #fff;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-btn--primary:hover {
    filter: brightness(1.05);
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-btn--muted {
    background: #e2e8f0;
    color: var(--jy-admin-slate-mid);
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-btn--muted:hover {
    background: #cbd5e1;
}

body.page-admin-panel:not(.admin-theme-dark) .jy-admin-panel-results {
    margin-top: 15px;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-menu-item:hover {
    background: rgba(239, 246, 255, 0.85);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-menu-item.active {
    background: linear-gradient(135deg, var(--jy-admin-accent-2), var(--jy-admin-accent));
    border-bottom-color: transparent;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-menu-item.active > .admin-menu-spoiler-header {
    background: linear-gradient(135deg, var(--jy-admin-accent-2), var(--jy-admin-accent));
    border-bottom-color: transparent;
}

body.page-admin-panel:not(.admin-theme-dark) .user-item {
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-left: 4px solid var(--jy-admin-accent);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

body.page-admin-panel:not(.admin-theme-dark) .user-item:hover {
    background: rgba(239, 246, 255, 0.95);
}

body.page-admin-panel:not(.admin-theme-dark) .info-item {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(30, 41, 59, 0.08);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-page table {
    background: var(--jy-admin-surface);
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-page table th {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #f8fafc;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.35);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-page table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-page table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-messenger-media-table th {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #f8fafc;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-messenger-media-table td {
    color: #1e293b;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-messenger-media-intro {
    color: #334155;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-messenger-media-table-wrap {
    border-color: rgba(30, 41, 59, 0.12);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-container > .admin-page > h1,
body.page-admin-panel:not(.admin-theme-dark) .admin-container > .admin-main-page > h1,
body.page-admin-panel:not(.admin-theme-dark) .admin-container > .mk-page > h1 {
    background: linear-gradient(135deg, var(--jy-admin-slate-mid) 0%, var(--jy-admin-slate) 100%);
    color: #f8fafc;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(15, 23, 42, 0.35);
}

body.page-admin-panel:not(.admin-theme-dark) .admin-container > .admin-page > h2,
body.page-admin-panel:not(.admin-theme-dark) .admin-container > .mk-page > h2 {
    color: var(--jy-admin-slate);
    border-left: 4px solid var(--jy-admin-slate-mid);
    padding-left: 12px;
}

body.page-admin-panel:not(.admin-theme-dark) .mk-page .mk-card {
    border-color: rgba(30, 41, 59, 0.12);
    box-shadow: 0 4px 22px rgba(15, 23, 42, 0.08);
}

body.page-admin-panel:not(.admin-theme-dark) .mk-page .mk-card__title {
    color: #1e293b;
}

.admin-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#literaturePage .admin-container {
    max-width: 100%;
    width: 100%;
    padding: 10px;
}

.admin-container h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-info-card,
body.page-admin-panel:not(.admin-theme-dark) .users-list-card,
body.page-admin-panel:not(.admin-theme-dark) .payments-list-card {
    border: 1px solid var(--jy-admin-slate-border, rgba(30, 41, 59, 0.12));
    box-shadow: 0 4px 22px rgba(15, 23, 42, 0.08);
}

.admin-info-card,
.users-list-card,
.payments-list-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-info-card h2,
.users-list-card h2,
.payments-list-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 10px;
}

body.page-admin-panel:not(.admin-theme-dark) .admin-info-card h2,
body.page-admin-panel:not(.admin-theme-dark) .users-list-card h2,
body.page-admin-panel:not(.admin-theme-dark) .payments-list-card h2 {
    color: #1e293b;
    border-bottom-color: #64748b;
}

#adminInfo {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    color: #333;
    font-weight: 600;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.user-item:hover {
    background: #e3f2fd;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-email {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.lesson-access-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-access-admin-course {
    background: #fff;
    border: 1px solid #dbe8f3;
    border-radius: 8px;
    padding: 10px;
}

.lesson-access-admin-course-title {
    color: #1f4f75;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

.lesson-access-admin-course-lessons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lesson-access-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed #eef2f7;
    padding-bottom: 6px;
}

.lesson-access-admin-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lesson-access-admin-label {
    color: #2c3e50;
    font-size: 13px;
    line-height: 1.35;
}

.lesson-access-toggle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lesson-access-toggle.is-open {
    background: #2eaf4a;
    box-shadow: 0 0 0 2px rgba(46, 175, 74, 0.15);
}

.lesson-access-toggle.is-closed {
    background: #d43f3a;
    box-shadow: 0 0 0 2px rgba(212, 63, 58, 0.15);
}

.lesson-access-toggle:disabled {
    opacity: 0.6;
    cursor: wait;
}

.user-reg-date {
    color: #999;
    font-size: 12px;
}

.no-users,
.no-payments {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.payments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a90e2;
    transition: background 0.2s;
}

.payment-item:hover {
    background: #e9ecef;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.payment-user {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.payment-status {
    font-weight: 500;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.payment-info div {
    line-height: 1.5;
}

.payment-screenshot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.payment-screenshot a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.payment-screenshot a:hover {
    text-decoration: underline;
}

.payment-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.btn-approve,
.btn-reject {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-approve {
    background: #4caf50;
    color: white;
}

.btn-approve:hover {
    background: #45a049;
}

.btn-reject {
    background: #f44336;
    color: white;
}

.btn-reject:hover {
    background: #da190b;
}

/* Главная страница админки */
.admin-main-page {
    text-align: center;
    padding: 60px 20px;
}

.admin-welcome {
    margin-top: 30px;
    font-size: 18px;
    color: #666;
}

/* Страницы админки */
.admin-page {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Пункты меню админки в сайдбаре */
.admin-menu-item {
    padding: 6px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.3;
}

.admin-menu-item:hover {
    background: #f8f9fa;
}

.admin-menu-item.active {
    background: #4a90e2;
    color: white;
}

.admin-menu-item.active .admin-menu-link {
    color: white;
    font-weight: 600;
}

.admin-menu-link {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Админка: верхняя группа (лиды) + список разделов + настройки — одна прокрутка на весь сайдбар */
body.page-admin-panel .sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

body.page-admin-panel .admin-sidebar-nav {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
}

body.page-admin-panel .sidebar-header {
    flex-shrink: 0;
}

body.page-admin-panel .admin-menu-pin-list {
    flex-shrink: 0;
    margin: 0 0 0 0;
    padding: 10px 10px 12px;
    list-style: none;
    border-bottom: 2px solid #dbeafe;
    background: linear-gradient(180deg, #f0f7ff 0%, #e8f2fc 100%);
}

body.page-admin-panel .admin-sidebar-menu-list {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Средний блок сайдбара: названия страниц — отдельная типографика (не как у 4 закреплённых карточек) */
body.page-admin-panel:not(.admin-theme-dark) #courseList.admin-sidebar-menu-list > .admin-menu-item > .admin-menu-link,
body.page-admin-panel:not(.admin-theme-dark)
    #courseList.admin-sidebar-menu-list
    .admin-menu-spoiler-header
    .admin-menu-link {
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.04em;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
}

body.page-admin-panel:not(.admin-theme-dark) #courseList.admin-sidebar-menu-list .admin-menu-sub-link {
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    font-size: 12.5px;
    letter-spacing: 0.025em;
    -webkit-font-smoothing: antialiased;
}

body.page-admin-panel:not(.admin-theme-dark) #courseList.admin-sidebar-menu-list > .admin-menu-item.active > .admin-menu-link,
body.page-admin-panel:not(.admin-theme-dark)
    #courseList.admin-sidebar-menu-list
    > .admin-menu-item.active
    > .admin-menu-spoiler-header
    .admin-menu-link {
    font-weight: 700;
    letter-spacing: 0.035em;
}

body.page-admin-panel .admin-menu-settings-list {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 0 14px;
    list-style: none;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
}

body.page-admin-panel .admin-menu-item--priority {
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    margin: 0 0 6px 0;
    padding: 0;
    background: #fff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.07);
    border-bottom: none;
}

body.page-admin-panel .admin-menu-item--priority:last-child {
    margin-bottom: 0;
}

body.page-admin-panel .admin-menu-item--priority:hover {
    background: #f8fbff;
    border-color: #93c5fd;
}

body.page-admin-panel .admin-menu-item--priority.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

body.page-admin-panel .admin-menu-link--priority {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px !important;
    font-weight: 600;
    color: #1e3a8a;
    border-radius: 9px;
}

body.page-admin-panel .admin-menu-item--priority.active .admin-menu-link--priority,
body.page-admin-panel .admin-menu-item--priority.active .admin-menu-pin-num,
body.page-admin-panel .admin-menu-item--priority.active .admin-menu-pin-text {
    color: #fff;
}

body.page-admin-panel .admin-menu-pin-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

body.page-admin-panel .admin-menu-item--priority.active .admin-menu-pin-num {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

body.page-admin-panel .admin-menu-pin-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.page-admin-panel .admin-menu-item--settings {
    border-bottom: none;
    margin: 4px 8px 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.page-admin-panel .admin-menu-item--settings:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.page-admin-panel .admin-menu-item--settings.active {
    background: #334155;
    border-color: #1e293b;
}

body.page-admin-panel .admin-menu-link--settings {
    display: flex;
    align-items: center;
    padding: 10px 12px !important;
    font-weight: 600;
    color: #334155;
}

body.page-admin-panel .admin-menu-item--settings.active .admin-menu-link--settings {
    color: #f8fafc;
}

body.page-admin-panel .admin-menu-gear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    flex-shrink: 0;
}

body.page-admin-panel .admin-menu-gear::before {
    content: '\2699\fe0f';
    font-size: 18px;
    line-height: 1;
}

body.page-admin-panel .admin-menu-settings-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-menu-spoiler-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-left: none;
}

.admin-menu-spoiler-header:hover {
    background: #f8f9fa;
}

.admin-menu-item.active > .admin-menu-spoiler-header {
    background: #4a90e2;
    color: white;
}

.admin-menu-item.active > .admin-menu-spoiler-header .admin-menu-link {
    color: white;
    font-weight: 600;
}

.admin-menu-spoiler-arrow {
    transition: transform 0.3s;
    font-size: 12px;
    color: #667eea;
    margin-left: 10px;
}

.admin-menu-item.active > .admin-menu-spoiler-header .admin-menu-spoiler-arrow {
    color: white;
    transform: rotate(90deg);
}

.admin-menu-spoiler-content {
    list-style: none;
    padding: 0;
    margin: 0;
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
}

.admin-menu-item.active .admin-menu-spoiler-content {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-menu-spoiler-content li {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    box-sizing: border-box;
}

.admin-menu-sub-link {
    color: #333;
    text-decoration: none;
    font-size: 12px;
    display: block;
    padding: 6px 15px 6px 30px;
    border-radius: 0;
    transition: background 0.2s, color 0.2s;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    border-left: none;
}

.admin-menu-sub-link:hover {
    background: #e8f0fe;
    color: #4a90e2;
}

/* Когда родитель активен, подразделы должны быть белыми на синем */
.admin-menu-item.active .admin-menu-sub-link {
    color: white;
    background: #4a90e2;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.admin-menu-item.active .admin-menu-sub-link:hover {
    background: #5ba0f2;
    color: white;
}

/* Модальное окно управления доступом */
.access-control-courses {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.course-access-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.course-access-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a90e2;
}

.course-access-title {
    font-size: 18px;
    font-weight: 600;
    color: #4a90e2;
    margin: 0;
}

.toggle-all-btn {
    padding: 6px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-all-btn:hover {
    background: #e0e0e0;
    border-color: #4a90e2;
    color: #4a90e2;
}

.modal-content-access {
    padding: 0 !important;
}

.modal-header-sticky {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 0;
    margin: 0;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal-header-top {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.modal-header-sticky h2 {
    margin: 0;
    font-size: 20px;
    flex: 1;
}

.modal-actions-sticky {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-toggle-all-courses {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-all-courses:hover {
    background: #e0e0e0;
    border-color: #4a90e2;
    color: #4a90e2;
}

#accessControlContentWrapper {
    padding: 20px 30px 30px 30px;
}

#accessControlContent {
    padding-bottom: 20px;
    position: relative;
    z-index: 1;
}

.modal-content-access .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 101;
    background: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-content-access .close:hover {
    color: #333;
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .modal-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .modal-header-sticky h2 {
        font-size: 18px;
    }
    
    .modal-actions-sticky {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .btn-toggle-all-courses {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }
    
    #accessControlContentWrapper {
        padding: 15px 20px 20px 20px;
    }
}

.lessons-access-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-access-item {
    padding: 8px 0;
}

.lesson-access-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.lesson-access-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.lesson-access-checkbox:hover {
    color: #4a90e2;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Страница управления доступом участника */
.user-access-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.user-access-header-sticky {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    padding: 0;
    margin: 0;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.user-access-header-top {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.user-access-header-sticky h1 {
    margin: 0;
    font-size: 24px;
    flex: 1;
}

.user-access-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.user-access-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px 30px 30px;
}

@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    .admin-info-card,
    .users-list-card,
    .payments-list-card {
        padding: 20px;
    }
    
    .payment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .access-control-courses {
        gap: 15px;
    }
    
    .course-access-section {
        padding: 12px;
    }
    
    .user-access-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .user-access-header-sticky h1 {
        font-size: 20px;
    }
    
    .user-access-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .btn-toggle-all-courses {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .user-access-content {
        padding: 15px 20px 20px 20px;
    }
}

/* Админка: уведомления о входящих в мессенджере */
.admin-messenger-unread-badge {
    display: inline-block;
    min-width: 20px;
    padding: 2px 7px;
    margin-left: 6px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: middle;
}

body.page-admin-panel .admin-menu-item--priority.admin-menu-item--has-unread {
    box-shadow:
        0 0 0 2px rgba(229, 57, 53, 0.5),
        0 4px 14px rgba(37, 99, 235, 0.28);
    animation: jy-admin-pin-unread-glow 2.2s ease-in-out infinite;
}

body.page-admin-panel .admin-menu-item--priority.admin-menu-item--has-unread.active {
    box-shadow:
        0 0 0 2px rgba(254, 243, 199, 0.85),
        0 4px 18px rgba(37, 99, 235, 0.45);
}

@keyframes jy-admin-pin-unread-glow {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.06);
    }
}

.admin-messenger-unread-notice {
    margin: 0 20px 12px;
    padding: 0;
}

.admin-messenger-unread-notice__btn {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: block;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3390ec, #2870c7);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 14px rgba(51, 144, 236, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.admin-messenger-unread-notice__btn:active {
    filter: brightness(1.05);
}

.admin-users-loading {
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid #d5e3d9;
    border-radius: 8px;
    background: #f5fbf7;
    color: #2f6a47;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 768px) {
    .admin-messenger-unread-notice {
        margin: 0 10px 10px;
    }
}

/* Админ-панель: как у ЛК — гамбургер скрыт, сворачивание стрелкой «←/→» в шапке сайдбара (main.js) */
body.page-admin-panel #navToggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 768px) {
    body.page-admin-panel #sidebarPinToggle,
    body.page-admin-panel #sidebarUnhideFab {
        display: none !important;
    }
}

body.page-admin-panel #sidebar .sidebar-nav {
    padding-top: 12px !important;
}

@media (max-width: 768px) {
    body.page-admin-panel #sidebar {
        position: relative;
        left: 0 !important;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        padding-top: 56px;
        box-sizing: border-box;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
        z-index: 1;
    }

    body.page-admin-panel .main-content {
        padding-top: 88px;
    }
}

/* Медиа из чатов (админка) */
.admin-messenger-media-intro {
    max-width: 820px;
    color: #444;
    line-height: 1.55;
    margin-bottom: 16px;
}
.admin-messenger-media-intro code {
    font-size: 13px;
    background: #f4f4f5;
    padding: 2px 6px;
    border-radius: 4px;
}
.admin-messenger-media-note {
    font-size: 14px;
    color: #555;
}
.admin-messenger-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.admin-messenger-media-retention-btn {
    background: #c0392b !important;
    color: #fff !important;
    border: none;
}
.admin-messenger-media-status {
    margin: 8px 0 14px;
    font-size: 14px;
    color: #333;
}
.admin-messenger-media-totals {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}
.admin-messenger-media-purge-btn {
    background: #7f1d1d !important;
    color: #fff !important;
    border: none;
}
.admin-messenger-media-chat-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}
.admin-messenger-media-chat-link:hover {
    color: #1d4ed8;
}
.admin-messenger-media-table-wrap {
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
}
.admin-messenger-media-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-messenger-media-table th,
.admin-messenger-media-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}
.admin-messenger-media-table th {
    background: #f7f9fc;
    font-weight: 600;
    color: #333;
}
.admin-messenger-media-table tr:last-child td {
    border-bottom: none;
}
.admin-messenger-media-del {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #e74c3c;
    background: #fff;
    color: #c0392b;
    cursor: pointer;
}
.admin-messenger-media-del:hover {
    background: #fdecea;
}
.admin-messenger-media-more-wrap {
    margin-top: 14px;
}

/* Менеджерские подсказки (Leeloo-style): чаты + CRM */
.admin-manager-leeloo-banner {
    padding: 10px 14px;
    background: #f0f7ff;
    border-bottom: 1px solid #cce0ff;
    flex-shrink: 0;
    max-height: 42vh;
    overflow: auto;
}
body.admin-theme-dark .admin-manager-leeloo-banner {
    background: #152028;
    border-bottom-color: #2d4a66;
}
.admin-manager-leeloo-banner__summary,
.admin-manager-crm-hub__summary {
    cursor: pointer;
    font-weight: 600;
    color: #1a4a8a;
    list-style: none;
}
body.admin-theme-dark .admin-manager-leeloo-banner__summary,
body.admin-theme-dark .admin-manager-crm-hub__summary {
    color: #8ec5ff;
}
.admin-manager-leeloo-banner__details summary::-webkit-details-marker,
.admin-manager-crm-hub__details summary::-webkit-details-marker {
    display: none;
}
.admin-manager-leeloo-banner__body,
.admin-manager-crm-hub__body {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: #333;
}
body.admin-theme-dark .admin-manager-leeloo-banner__body,
body.admin-theme-dark .admin-manager-crm-hub__body {
    color: #d8e4f0;
}
.admin-manager-leeloo-banner__body ul {
    margin: 8px 0 0;
    padding-left: 1.2em;
}
.admin-manager-crm-hub {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
body.admin-theme-dark .admin-manager-crm-hub {
    background: #151c24;
    border-color: #2d3a4a;
}
.admin-manager-crm-hub__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.admin-manager-crm-hub__label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
body.admin-theme-dark .admin-manager-crm-hub__label {
    color: #cbd5e1;
}
.admin-manager-crm-hub__select {
    min-width: 200px;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
}
body.admin-theme-dark .admin-manager-crm-hub__select {
    background: #0f1419;
    border-color: #475569;
    color: #e2e8f0;
}
