/* ==========================================================
   БАЗА
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f2f5; }

/* ==========================================================
   ШАПКА
   ========================================================== */
.header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 10px;
}
.header-left { display: flex; align-items: center; gap: 15px; }
.logo-container { display: flex; align-items: center; gap: 12px; }
.logo-img { width: 50px; height: 50px; object-fit: contain; display: block; flex-shrink: 0; }
.header-text { display: flex; flex-direction: column; line-height: 1.2; }
.header-title { font-size: 20px; font-weight: 700; color: #333; }
.header-subtitle { font-size: 14px; color: #666; font-style: italic; }
.user-info { display: flex; align-items: center; gap: 20px; }
.user-name { font-weight: 600; color: #333; }

/* ==========================================================
   КНОПКИ
   ========================================================== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-success { background: #4CAF50; color: white; }
.btn-danger { background: #f44336; color: white; }
.btn-danger:hover { background: #d32f2f; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.btn-ghost { background: #f0f4ff; color: #2196F3; border: 1px solid #bbdefb; }
.btn-ghost:hover { background: #e3f2fd; border-color: #2196F3; }

/* ==========================================================
   КОНТЕЙНЕР И КАРТОЧКИ
   ========================================================== */
.container { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card p { color: #555; margin: 5px 0; }
.card .value { font-weight: 600; color: #333; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.stat-item { text-align: center; padding: 15px; background: #f8f9fa; border-radius: 10px; }
.stat-item .number { font-size: 32px; font-weight: 700; color: #333; }
.stat-item .label { font-size: 14px; color: #666; margin-top: 5px; }

/* ==========================================================
   УВЕДОМЛЕНИЯ
   ========================================================== */
.notification-card {
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 5px solid;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.notification-card.info { background: #e3f2fd; border-left-color: #2196F3; }
.notification-card.warning { background: #fff8e1; border-left-color: #FF9800; }
.notification-card.danger { background: #ffebee; border-left-color: #f44336; }
.notification-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.notification-content { flex: 1; }
.notification-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; color: #333; }
.notification-card.info .notification-title { color: #1565C0; }
.notification-card.warning .notification-title { color: #e65100; }
.notification-card.danger .notification-title { color: #c62828; }
.notification-message { font-size: 14px; line-height: 1.5; color: #555; }
.notification-actions { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn-buy-subscription {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}
.btn-buy-subscription:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4); }
.btn-buy-subscription:active { transform: translateY(0); }

/* ==========================================================
   БЛИЖАЙШИЕ ЗАНЯТИЯ
   ========================================================== */
.lessons-list { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.lesson-card {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
    background: white;
}
.lesson-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
.lesson-date {
    min-width: 180px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    font-weight: 600;
    gap: 4px;
}
.lesson-date.today { background: linear-gradient(135deg, #4CAF50, #388E3C); }
.lesson-date.tomorrow { background: linear-gradient(135deg, #2196F3, #1565C0); }
.lesson-date.future { background: linear-gradient(135deg, #9E9E9E, #616161); }
.lesson-date .date-label { font-size: 16px; font-weight: 700; }
.lesson-date .date-full { font-size: 12px; opacity: 0.9; font-weight: 400; }
.lesson-date .date-time {
    font-size: 15px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-weight: 600;
}
.lesson-date .time-left {
    font-size: 12px;
    margin-top: 4px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    align-self: flex-start;
    font-weight: 500;
}
.lesson-info { flex: 1; padding: 15px 20px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.lesson-info .direction { font-size: 16px; font-weight: 600; color: #333; }
.lesson-info .detail { font-size: 14px; color: #666; display: flex; align-items: center; gap: 8px; }
.lesson-info .detail .icon { font-size: 14px; width: 18px; text-align: center; }
.lessons-empty { text-align: center; padding: 30px 20px; color: #999; }
.lessons-empty .icon { font-size: 40px; display: block; margin-bottom: 10px; }

/* ==========================================================
   ЛОЯЛЬНОСТЬ
   ========================================================== */
.loyalty-status { padding: 20px; border-radius: 10px; margin-bottom: 15px; }
.loyalty-status.achieved { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border: 2px solid #4CAF50; }
.loyalty-status.progress { background: linear-gradient(135deg, #e3f2fd, #bbdefb); border: 2px solid #2196F3; }
.loyalty-status.broken { background: linear-gradient(135deg, #f5f5f5, #eeeeee); border: 2px solid #9E9E9E; }
.loyalty-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.loyalty-header .icon { font-size: 32px; line-height: 1; }
.loyalty-header .title { font-size: 18px; font-weight: 700; }
.loyalty-status.achieved .loyalty-header .title { color: #2e7d32; }
.loyalty-status.progress .loyalty-header .title { color: #1565C0; }
.loyalty-status.broken .loyalty-header .title { color: #616161; }
.loyalty-text { font-size: 14px; line-height: 1.5; color: #555; margin-bottom: 15px; }
.loyalty-text strong { color: #333; }
.loyalty-progress-container { margin: 15px 0; }
.loyalty-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}
.loyalty-progress-bar {
    width: 100%;
    height: 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.loyalty-progress-bar .fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.8s ease-out;
    background-size: 20px 20px;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.15) 75%,
        transparent 75%,
        transparent
    );
    animation: progressStripe 1s linear infinite;
}
@keyframes progressStripe {
    from { background-position: 0 0; }
    to { background-position: 20px 0; }
}
.loyalty-status.achieved .loyalty-progress-bar .fill { background-color: #4CAF50; }
.loyalty-status.progress .loyalty-progress-bar .fill { background-color: #2196F3; }
.loyalty-status.broken .loyalty-progress-bar .fill { background-color: #9E9E9E; }
.loyalty-hint {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    padding: 12px 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    margin-top: 15px;
}

.loyalty-current-week {
    margin-top: 14px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(0,0,0,0.05);
}
.loyalty-current-week .cw-icon { font-size: 20px; line-height: 1; }
.loyalty-current-week .cw-text { color: #555; }
.loyalty-current-week .cw-text strong { color: #333; }
.loyalty-current-week.is-valid { background: #e8f5e9; border-color: #a5d6a7; }
.loyalty-current-week.is-valid .cw-text strong { color: #2e7d32; }

.loyalty-bonuses {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #d5dae8;
}
.loyalty-bonuses-title {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.loyalty-bonuses-list { display: flex; flex-direction: column; gap: 8px; }

.bonus-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e6e9f5;
    box-shadow: 0 1px 3px rgba(102,126,234,0.06);
    transition: box-shadow 0.15s, transform 0.15s;
}
.bonus-row:hover {
    box-shadow: 0 4px 12px rgba(102,126,234,0.12);
    transform: translateY(-1px);
}
.bonus-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: white;
}
.bonus-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bonus-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
.bonus-period {
    font-size: 13px;
    color: #666;
}
.bonus-period .sep { margin: 0 4px; color: #b0b8d0; }
.bonus-stats {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.bonus-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #eef1ff;
    color: #5a6ce0;
    font-size: 12px;
    font-weight: 600;
}
.bonus-stat.gift {
    background: #e8f5e9;
    color: #2e7d32;
}

.loyalty-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}
.loyalty-info .info-title { font-weight: 600; color: #555; margin-bottom: 6px; }
.loyalty-info ul { margin: 0; padding-left: 20px; }
.loyalty-info li { margin-bottom: 4px; }

/* ==========================================================
   АБОНЕМЕНТЫ
   ========================================================== */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.subscription-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}
.subscription-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.subscription-card .direction {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}
.subscription-card .direction .badge {
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 8px;
}
.sub-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    font-size: 14px;
    color: #555;
}
.sub-info .label { color: #999; }
.sub-info .value { font-weight: 500; color: #333; }
.sub-progress { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee; }
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}
.progress-bar .fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.progress-bar .fill-green { background: #4CAF50; }
.progress-bar .fill-orange { background: #FF9800; }
.next-payment { margin-top: 12px; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.next-payment.orange { background: #fff3e0; color: #e65100; }
.next-payment.green { background: #e8f5e9; color: #2e7d32; }
.sub-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eee; }
.btn-view-lessons {
    width: 100%;
    padding: 10px;
    background: #f0f4ff;
    color: #2196F3;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-view-lessons:hover { background: #e3f2fd; border-color: #2196F3; }

/* ==========================================================
   МОДАЛКИ
   ========================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-content.wide { max-width: 1100px; }
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}
.modal-header h3 { color: #333; font-size: 18px; margin: 0; }
.modal-subtitle { color: #666; font-size: 14px; margin-top: 4px; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}
.modal-close:hover { background: #f5f5f5; color: #333; }
.modal-body { padding: 20px 25px; overflow-y: auto; flex: 1; }

/* ==========================================================
   ТАБЛИЦА УРОКОВ
   ========================================================== */
.lessons-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lessons-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.lessons-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.lessons-table tr:hover td { background: #f8f9fa; }
.lessons-table .num-col { width: 40px; color: #999; text-align: center; }

/* ==========================================================
   СТУДЕНТЫ
   ========================================================== */
.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.student-item:last-child { border-bottom: none; }
.student-name { font-weight: 500; }
.student-email { color: #666; font-size: 14px; margin-left: 10px; }
.btn-switch {
    background: #FF9800;
    color: white;
    padding: 5px 12px;
    font-size: 12px;
    margin-right: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-switch:hover { background: #F57C00; }
.add-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.add-form input {
    flex: 1;
    min-width: 150px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}
.add-form input:focus { border-color: #667eea; outline: none; }
.message { margin-top: 12px; padding: 10px 14px; border-radius: 6px; display: none; }
.message.success { background: #e8f5e9; color: #2e7d32; display: block; }
.message.error { background: #ffebee; color: #c62828; display: block; }
.empty-state { color: #999; text-align: center; padding: 30px 0; }

/* ==========================================================
   БЕЙДЖИ
   ========================================================== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}
.badge-student { background: #e8f5e9; color: #2e7d32; }
.badge-sub { background: #e8f5e9; color: #2e7d32; }

/* ==========================================================
   ЗАГРУЗКА И ПРОЧЕЕ
   ========================================================== */
.loading { text-align: center; padding: 40px; color: #666; }
.payment-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}
.remaining-lessons { font-weight: 700; }
.remaining-lessons.positive { color: #2196F3; }
.remaining-lessons.zero { color: #f44336; }
.remaining-payment { font-weight: 700; }
.remaining-payment.positive { color: #e65100; }
.remaining-payment.zero { color: #2e7d32; }

/* ==========================================================
   ДИАГНОСТИКА — БАЗА
   ========================================================== */
.diag-empty { text-align: center; padding: 30px 20px; color: #999; }
.diag-empty .icon { font-size: 40px; display: block; margin-bottom: 10px; }

.diag-direction {
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    background: #fcfcff;
    transition: all 0.3s;
}
.diag-direction:hover { box-shadow: 0 4px 16px rgba(102, 126, 234, 0.08); }

.diag-direction-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.diag-direction-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}
.diag-direction-title .count {
    font-size: 12px;
    font-weight: 600;
    background: #eef1ff;
    color: #5a6ce0;
    padding: 2px 10px;
    border-radius: 12px;
}

.diag-direction-body {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 24px;
    align-items: flex-start;
}
.diag-radar-mini {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 300px;
    position: relative;
}
.diag-radar-mini canvas { width: 100%; height: 100%; display: block; }

.diag-direction-info { display: flex; flex-direction: column; gap: 12px; }
.diag-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.diag-summary-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
}
.diag-summary-item .label { font-size: 12px; color: #888; margin-bottom: 4px; }
.diag-summary-item .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.diag-summary-item .delta { font-size: 13px; font-weight: 600; }
.diag-summary-item .delta.up { color: #2e7d32; }
.diag-summary-item .delta.down { color: #c62828; }
.diag-summary-item .delta.same { color: #777; }
.diag-summary-item .delta.first { color: #888; font-weight: 500; }

.diag-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #555; }
.diag-legend-item { display: flex; align-items: center; gap: 6px; }
.diag-legend-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.diag-legend-swatch.prev { background: #90A4AE; }
.diag-legend-swatch.last { background: #667eea; }

.diag-open-btn {
    align-self: flex-start;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
.diag-open-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); }
.diag-open-btn:active { transform: translateY(0); }

.diag-params { margin-top: 20px; padding-top: 18px; border-top: 1px dashed #e8e8ef; }
.diag-params-title {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.diag-params-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 20px;
}
.diag-param-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    background: #fafbff;
    border: 1px solid #eef0fa;
    transition: background 0.15s;
}
.diag-param-row:hover { background: #f2f4ff; }
.diag-param-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eef1ff;
    color: #5a6ce0;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.diag-param-label { flex: 1; color: #444; line-height: 1.3; }
.diag-param-score { font-weight: 700; color: #4a5cd0; font-size: 14px; flex-shrink: 0; }
.diag-param-delta { font-size: 12px; font-weight: 700; flex-shrink: 0; margin-left: 4px; }
.diag-param-delta.up { color: #2e7d32; }
.diag-param-delta.down { color: #c62828; }
.diag-param-delta.same { color: #999; }

/* ==========================================================
   ДИАГНОСТИКА — МОДАЛКА
   ========================================================== */
.diag-modal .modal-content { max-width: 1100px; }

.diag-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.diag-control { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; }
.diag-control label { font-size: 12px; font-weight: 600; color: #666; }
.diag-control select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}
.diag-control select:focus { border-color: #667eea; outline: none; }

.diag-big-radar {
    width: 100%;
    max-width: 620px;
    margin: 0 auto 30px;
    aspect-ratio: 1 / 1;
    position: relative;
}
.diag-big-radar canvas { width: 100%; height: 100%; display: block; }

.diag-compare-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 30px; }
.diag-compare-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}
.diag-compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.diag-compare-table .col-num { width: 44px; text-align: center; color: #999; }
.diag-compare-table .col-score { text-align: center; font-weight: 700; width: 90px; }
.diag-compare-table .col-score.last { color: #4a5cd0; }
.diag-compare-table .col-delta { text-align: center; font-weight: 700; width: 90px; }
.diag-compare-table .col-delta.up { color: #2e7d32; }
.diag-compare-table .col-delta.down { color: #c62828; }
.diag-compare-table .col-delta.same { color: #999; }
.diag-compare-table .group-row td {
    background: #fbfbff;
    color: #5a6ce0;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.diag-compare-table tbody tr[data-param-idx] { transition: background 0.15s; cursor: default; }
.diag-compare-table tbody tr[data-param-idx]:hover td { background: #f5f6ff; }

.param-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eef1ff;
    color: #5a6ce0;
    font-size: 11px;
    font-weight: 700;
}
.param-num-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #eef1ff;
    color: #5a6ce0;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
}

.diag-sparklines-title { font-size: 15px; font-weight: 700; color: #333; margin-bottom: 14px; }
.diag-sparklines {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}
.diag-sparkline {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.diag-sparkline-label { font-size: 12px; color: #555; line-height: 1.3; min-height: 32px; }
.diag-sparkline-canvas { width: 100%; height: 44px; display: block; }
.diag-sparkline-meta { display: flex; justify-content: space-between; font-size: 11px; color: #888; }
.diag-sparkline-meta .last-val { color: #4a5cd0; font-weight: 700; }

/* ==========================================================
   ИКОНКА "?" И POPOVER ПОДСКАЗКИ
   ========================================================== */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid #b7bff0;
    border-radius: 50%;
    background: #f4f6ff;
    color: #5a6ce0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
    font-family: inherit;
}
.info-btn:hover {
    background: #e6ebff;
    border-color: #667eea;
    transform: scale(1.08);
}
.info-btn:active { transform: scale(0.96); }
.info-btn:focus { outline: 2px solid rgba(102,126,234,0.4); outline-offset: 1px; }

.info-btn-sm {
    width: 14px;
    height: 14px;
    font-size: 9px;
    margin-left: 4px;
}

.info-popover {
    position: fixed;
    z-index: 2000;
    max-width: 320px;
    background: #2b3149;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(20,25,45,0.35);
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.info-popover.active {
    display: block;
    opacity: 1;
}
.info-popover-body { position: relative; z-index: 2; }

.info-popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2b3149;
    transform: rotate(45deg);
    top: -6px;
    left: 50%;
    margin-left: -6px;
}
.info-popover.above .info-popover-arrow {
    top: auto;
    bottom: -6px;
}

/* ==========================================================
   АДАПТИВ
   ========================================================== */
@media (max-width: 760px) {
    .diag-direction-body { grid-template-columns: 1fr; gap: 18px; }
    .diag-radar-mini { max-width: 260px; margin: 0 auto; }
    .diag-big-radar { max-width: 100%; }
    .diag-controls { flex-direction: column; }
    .diag-control { flex: 1 1 auto; }
}

@media (max-width: 600px) {
    .lesson-card { flex-direction: column; }
    .lesson-date {
        min-width: auto;
        padding: 12px 15px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
    }
    .lesson-date .date-label { font-size: 16px; }
    .lesson-date .date-full { font-size: 12px; order: 1; width: 100%; }
    .lesson-date .date-time { margin-top: 0; padding-top: 0; border-top: none; font-size: 14px; }
    .lesson-date .time-left { margin-top: 0; margin-left: auto; }
    .sub-info { grid-template-columns: 1fr; }
    .modal-content { max-height: 95vh; }
    .modal-header, .modal-body { padding: 15px; }
    .lessons-table { font-size: 13px; }
    .lessons-table th, .lessons-table td { padding: 8px 6px; }
    .lessons-table .hide-mobile { display: none; }

    .notification-card { padding: 15px; gap: 10px; }
    .notification-icon { font-size: 24px; }
    .notification-title { font-size: 15px; }
    .notification-message { font-size: 13px; }
    .btn-buy-subscription { width: 100%; padding: 12px; }

    .loyalty-status { padding: 15px; }
    .loyalty-header .icon { font-size: 26px; }
    .loyalty-header .title { font-size: 16px; }
    .loyalty-text { font-size: 13px; }
    .loyalty-hint { font-size: 13px; }
    .loyalty-progress-bar { height: 12px; }

    .bonus-row { flex-wrap: wrap; }
    .bonus-main { flex: 1 1 100%; order: 2; }
    .bonus-icon { order: 1; }
    .bonus-stats { order: 3; flex: 1 1 100%; justify-content: flex-start; }

    .diag-direction { padding: 14px; }
    .diag-direction-title { font-size: 16px; }
    .diag-summary-item { padding: 10px 12px; }
    .diag-summary-item .value { font-size: 18px; }
    .diag-compare-table th, .diag-compare-table td { padding: 8px 6px; font-size: 13px; }
    .diag-compare-table .col-score, .diag-compare-table .col-delta { width: 60px; }
    .diag-params-list { grid-template-columns: 1fr; }

    .info-popover { max-width: calc(100vw - 24px); }
}