/* ==================== RESET & ROOT ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root[data-theme="dark"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

:root[data-theme="light"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

/* ==================== BASE ==================== */
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== HEADER ==================== */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    position: relative;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 12px;
    overflow-x: auto;
}

.tab {
    flex: 1;
    min-width: 150px;
    padding: 14px 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ==================== SECTIONS ==================== */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================== FILTERS ==================== */
.filter-section {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: end;
}

.input-group {
    flex: 1;
    min-width: 250px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
    font-weight: 500;
}

select,
input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1em;
    transition: all 0.3s ease;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ==================== BUTTONS ==================== */
button.btn {
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

button.btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

button.btn:active {
    transform: translateY(0);
}

button.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.favorite-btn {
    background: transparent;
    border: 2px solid var(--warning);
    color: var(--warning);
    padding: 8px 16px;
}

.favorite-btn.active {
    background: var(--warning);
    color: white;
}

/* ==================== LOADING / EMPTY ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ==================== SCHEDULE GRID ==================== */
.schedule-grid {
    display: grid;
    gap: 20px;
}

.day-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.day-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1.1em;
    color: white;
}

.lessons {
    padding: 16px;
}

.lesson {
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.lesson:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.lesson:last-child {
    margin-bottom: 0;
}

.lesson-time {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.lesson-name {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.lesson-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: var(--text-muted);
}

.lesson-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== STATS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary);
}

.stat-unit {
    font-size: 0.5em;
    color: var(--text-muted);
    margin-left: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.subject-list {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.subject-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.subject-info {
    flex: 1;
}

.subject-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.subject-teacher {
    font-size: 0.9em;
    color: var(--text-muted);
}

.subject-stats {
    display: flex;
    gap: 24px;
    align-items: center;
}

.subject-stat {
    text-align: center;
}

.subject-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary);
}

.subject-stat-label {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* ==================== NEXT LESSON WIDGET ==================== */
.next-lesson-widget {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.next-lesson-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-widget 100s ease-in-out infinite;
}

@keyframes pulse-widget {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50%       { transform: scale(1.1); opacity: 0.8; }
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.widget-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.status-indicator.active   { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-indicator.upcoming { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.status-indicator.finished { background: #6b7280; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.widget-timer {
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
}

.timer-label {
    font-size: 0.5em;
    opacity: 0.9;
    display: block;
    margin-top: 4px;
}

.widget-lesson-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.widget-lesson-name {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 12px;
}

.widget-lesson-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.widget-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    opacity: 0.9;
}

.widget-detail-icon {
    font-size: 1em;
}

.widget-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.2));
    border: 2px solid #f59e0b;
    border-left: 6px solid #f59e0b;
    padding: 14px 18px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: pulse-warning 100s infinite;
}

.widget-warning-icon {
    font-size: 1.6em;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.5));
}

.widget-warning-text {
    flex: 1;
}

.widget-warning strong {
    display: block;
    margin-bottom: 6px;
    color: #f59e0b;
    font-size: 1.05em;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.widget-warning-text span {
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
        transform: scale(1.02);
    }
}

:root[data-theme="light"] .widget-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.1));
    border: 2px solid #d97706;
    border-left: 6px solid #d97706;
}

:root[data-theme="light"] .widget-warning strong {
    color: #d97706;
}

.widget-empty {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.widget-empty-icon {
    font-size: 3em;
    margin-bottom: 12px;
    opacity: 0.7;
}

.progress-ring {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
}

.progress-ring-circle {
    transition: stroke-dashoffset 1s linear;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* ==================== FAVORITES ==================== */
.favorites-list {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.favorite-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.remove-favorite {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px 8px;
    transition: all 0.3s;
}

.remove-favorite:hover {
    transform: scale(1.2);
}

/* ==================== PWA / OFFLINE ==================== */
.install-prompt {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    display: none;
}

.install-prompt.show {
    display: flex;
}

.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1000;
}

.offline-indicator.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.calendar-modal-content {
    max-width: 1400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ==================== CALENDAR ==================== */
.calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-grid.has-data {
    min-height: 600px;
}

.calendar-header-cell {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    border-radius: 8px;
    font-size: 0.9em;
}

.calendar-day {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    min-height: 100px;
    padding: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.calendar-day.no-lessons {
    cursor: default;
    opacity: 0.55;
}

.calendar-day.no-lessons:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}

.calendar-day.has-lessons:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.calendar-day.other-month { opacity: 0.3; cursor: default; }

.calendar-day.today {
    border-color: var(--warning);
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.calendar-day-number {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--text);
}

.calendar-day.today .calendar-day-number {
    color: var(--warning);
}

.calendar-lessons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-lesson {
    background: var(--primary);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.calendar-lesson:hover {
    transform: scale(1.05);
    z-index: 10;
    white-space: normal;
    overflow: visible;
}

.calendar-lesson.type-lecture  { background: var(--primary); }
.calendar-lesson.type-practice { background: var(--success); }
.calendar-lesson.type-lab      { background: var(--warning); }
.calendar-lesson.type-other    { background: var(--secondary); }

.calendar-lesson-count {
    font-size: 0.7em;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}

/* ==================== SUBJECT FILTERS ==================== */
.subject-filter-section {
    background: var(--bg);
    padding: 16px;
    border-radius: 12px;
}

.subject-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-chip {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    user-select: none;
}

.subject-chip:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.subject-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== CALENDAR LEGEND ==================== */
.calendar-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* ==================== ANIMATIONS (from JS) ==================== */
@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(400px); opacity: 0; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .container { padding: 12px; }

    h1 { font-size: 1.8em; }

    .header-controls {
        position: static;
        justify-content: center;
        margin-top: 16px;
    }

    .tabs { flex-wrap: nowrap; overflow-x: auto; }

    .filter-group { flex-direction: column; }

    .input-group { min-width: 100%; }

    .stats-grid { grid-template-columns: 1fr; }

    .subject-stats {
        flex-direction: column;
        gap: 12px;
    }

    .next-lesson-widget { padding: 16px; }

    .widget-timer { font-size: 1.4em; }

    .widget-lesson-name { font-size: 1.1em; }

    .widget-lesson-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .progress-ring { display: none; }

    .widget-warning {
        padding: 12px 16px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .widget-warning-icon { font-size: 1.4em; }

    .modal-content { max-height: 95vh; }

    .calendar-grid { gap: 4px; }

    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .calendar-day-number { font-size: 0.9em; }

    .calendar-lesson {
        font-size: 0.65em;
        padding: 2px 4px;
    }

    .calendar-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .calendar-navigation h3 { margin: 0 !important; }
}

/* ==================== SUBGROUP BADGES - ИСПРАВЛЕННЫЕ ==================== */
.subgroup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 25px;
    margin-left: 12px;
    vertical-align: middle;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 1 Подгруппа - ОРАНЖЕВЫЙ (контрастный) */
.subgroup-badge-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 2px solid rgba(245, 158, 11, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 2 Подгруппа - ЗЕЛЁНЫЙ */
.subgroup-badge-2 {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 2px solid rgba(16, 185, 129, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Усиленные границы для карточек подгрупп */
.lesson-subgroup-1 {
    border-left: 5px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), var(--bg));
}

.lesson-subgroup-2 {
    border-left: 5px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), var(--bg));
}

/* Для светлой темы */
:root[data-theme="light"] .lesson-subgroup-1 {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), var(--bg));
}

:root[data-theme="light"] .lesson-subgroup-2 {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), var(--bg));
}

/* Иконка подгруппы */
.subgroup-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ==================== TOAST ANIMATIONS ==================== */
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0)    scale(1); }
    to   { opacity: 0; transform: translateY(16px) scale(0.95); }
}

/* ==================== SEARCHABLE DROPDOWN ==================== */
.sd-container {
    position: relative;
    width: 100%;
}

.sd-input-wrap {
    position: relative;
}

.sd-input {
    width: 100%;
    padding: 12px 36px 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1em;
    transition: all 0.3s ease;
}

.sd-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.sd-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9em;
}

.sd-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.sd-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text);
    transition: background 0.15s;
}

.sd-item:hover,
.sd-item.selected {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.sd-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 0.9em;
    text-align: center;
}

/* ==================== BUTTON SPINNER ==================== */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== WIDGET PLACEHOLDER ==================== */
.widget-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    gap: 10px;
    opacity: 0.5;
}

.widget-placeholder-icon {
    font-size: 2.2em;
}

.widget-placeholder p {
    text-align: center;
    font-size: 0.9em;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.5;
}
/* ==================== PUSH BUTTON ==================== */
#pushBtn {
    transition: transform 0.2s ease, color 0.2s ease;
}

#pushBtn.push-active {
    color: var(--primary);
    animation: bellRing 0.4s ease;
}

@keyframes bellRing {
    0%   { transform: rotate(0deg);    }
    20%  { transform: rotate(-15deg);  }
    40%  { transform: rotate(15deg);   }
    60%  { transform: rotate(-10deg);  }
    80%  { transform: rotate(10deg);   }
    100% { transform: rotate(0deg);    }
}