/* ============================================================
   Мактаб-интернат №1 — стили
   ============================================================ */
:root {
    --teal: #14b8a6;
    --teal-dark: #0d9488;
    --teal-light: #5eead4;
    --mint: #10b981;
    --mint-dark: #059669;
    
    --bg: #f5f9fb;
    --bg-alt: #eef6f8;
    --bg-input: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f9fbfc;
    
    --text: #0f172a;
    --text-strong: #020617;
    --text-muted: #5b6b80;
    --text-placeholder: #94a3b8;
    
    --border: #cbd5e1;
    --border-strong: #94a3b8;
    --border-input: #94a3b8;
    --border-input-hover: #64748b;
    --border-input-focus: var(--teal);
    
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --info: #2563eb;
    
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    
    --navbar-h: 68px;
}

html[data-theme="dark"] {
    --bg: #0a1f1c;
    --bg-alt: #0e2622;
    --bg-input: #103028;
    --surface: #103028;
    --surface-hover: #143d36;
    
    --text: #f0fdfa;
    --text-strong: #ffffff;
    --text-muted: #94b8b0;
    
    --border: #1d4a41;
    --border-input: #2a6b5e;
    
    --teal: #2dd4bf;
    --teal-dark: #14b8a6;
    
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scrollbar-gutter: stable;
    background: var(--bg-alt);
}

body {
    font-family: var(--font-app, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: var(--density-font, 15px);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }
button { font-family: inherit; cursor: pointer; }

/* ═══════════ IMPERSONATE BAR ═══════════ */
.impersonate-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #ffffff;
    padding: 10px 20px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    animation: slideDown 0.3s ease-out;
}

.impersonate-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
}

.impersonate-bar i {
    font-size: 18px;
}

.impersonate-stop-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.impersonate-stop-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

body:has(.impersonate-bar) .navbar {
    margin-top: 52px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ═══════════ NAVBAR ═══════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1.5px solid rgba(20, 184, 166, 0.14);
    box-shadow: 0 1px 0 rgba(20, 184, 166, 0.08), 0 6px 20px rgba(15, 23, 42, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--navbar-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-title {
    font-weight: 800;
    font-size: 15px;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Языковой переключатель */
.lang-switch {
    display: flex;
    gap: 4px;
    background: rgba(20, 184, 166, 0.08);
    padding: 3px;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.lang-btn {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    transition: all 0.2s;
    letter-spacing: 0.04em;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}

.lang-btn:hover:not(.active) {
    background: rgba(20, 184, 166, 0.15);
    color: var(--teal-dark);
}

.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(20, 184, 166, 0.10);
    border: 1.5px solid rgba(20, 184, 166, 0.35);
    color: var(--teal-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(20, 184, 166, 0.20);
    transform: translateY(-1px);
}

.theme-toggle i {
    position: absolute;
    font-size: 15px;
    transition: opacity 0.25s, transform 0.35s;
}

.theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.theme-icon-moon { opacity: 1; transform: rotate(0) scale(1); }
html[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
html[data-theme="dark"] .theme-icon-sun { opacity: 1; transform: rotate(0) scale(1); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    min-width: 0;
}

.nav-link {
    padding: 8px 12px;
    color: var(--text);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.2;
    position: relative;
}

.nav-link:hover {
    background: rgba(20, 184, 166, 0.08);
    color: var(--teal-dark);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(16, 185, 129, 0.10));
    color: var(--teal-dark);
    font-weight: 600;
}

.nav-link-owner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(109, 40, 217, 0.08));
    color: #7c3aed;
}

.nav-link-owner:hover, .nav-link-owner.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.20), rgba(109, 40, 217, 0.15));
    color: #6d28d9;
}

.nav-link-honor {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.10), rgba(217, 119, 6, 0.08));
    color: #b45309;
}

.nav-link-danger { color: var(--danger); }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: var(--danger);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 10px;
    margin-left: 4px;
    line-height: 1;
}

/* ═══════════ CONTAINERS ═══════════ */
.main-content {
    min-height: 60vh;
    padding-bottom: 60px;
}

.container, .container-wide {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--density-pad, 16px) clamp(10px, 2vw, 20px);
}

.container-wide { max-width: 1400px; }

/* ═══════════ FLASH ═══════════ */
.flash-container {
    max-width: 1280px;
    margin: 8px auto 0;
    padding: 0 clamp(10px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flash {
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid transparent;
    animation: slideDown 0.3s ease-out;
}

.flash-success { background: rgba(5, 150, 105, 0.10); color: #065f46; border-left-color: var(--success); }
.flash-danger { background: rgba(220, 38, 38, 0.10); color: #991b1b; border-left-color: var(--danger); }
.flash-warning { background: rgba(217, 119, 6, 0.10); color: #92400e; border-left-color: var(--warning); }
.flash-info { background: rgba(37, 99, 235, 0.10); color: #1e40af; border-left-color: var(--info); }

html[data-theme="dark"] .flash-success { background: rgba(52, 211, 153, 0.15); color: #a7f3d0; }
html[data-theme="dark"] .flash-danger { background: rgba(248, 113, 113, 0.15); color: #fecaca; }
html[data-theme="dark"] .flash-warning { background: rgba(251, 191, 36, 0.15); color: #fde68a; }
html[data-theme="dark"] .flash-info { background: rgba(96, 165, 250, 0.15); color: #bfdbfe; }

/* ═══════════ CARDS ═══════════ */
.card {
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    transition: all 0.2s;
}

.card:hover {
    border-color: rgba(20, 184, 166, 0.30);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: var(--density-h3, 15px);
    font-weight: 700;
    margin-bottom: var(--density-gap, 10px);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.card h3 i { color: var(--teal); }

/* ═══════════ BUTTONS ═══════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.30);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(20, 184, 166, 0.40);
    color: #ffffff;
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--teal-dark);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.30);
}

.btn-danger:hover {
    transform: translateY(-1px);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.40);
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; gap: 6px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--radius); }

/* ═══════════ FORMS ═══════════ */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 12.5px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group label .req { color: var(--danger); }

.form-control {
    display: block;
    width: 100%;
    padding: 10px 13px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s;
    font-family: inherit;
}

.form-control::placeholder { color: var(--text-placeholder); }
.form-control:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

/* SELECT
   Внимание: стрелка и appearance для выпадающих списков задаются в
   css/components.css через переменную --select-arrow. Здесь оставлен только
   безопасный базовый сброс, чтобы ни при каком порядке загрузки не появилось
   второй (системной) стрелки. */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

select.form-control::-ms-expand { display: none; }

/* ═══════════ CLASS BADGE (5 + А сверху) ═══════════ */
.class-badge {
    display: inline-flex;
    align-items: flex-start;
    gap: 1px;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    line-height: 1;
    vertical-align: middle;
    margin-right: 8px;
}

.class-badge-num {
    font-size: 20px;
    color: var(--text);
}

.class-badge-letter {
    font-size: 13px;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    margin-top: -2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-weight: 800;
    transform: translateY(-4px);
}

.class-badge-lg .class-badge-num { font-size: 28px; }
.class-badge-lg .class-badge-letter { font-size: 16px; padding: 3px 8px; }

.class-badge-sm .class-badge-num { font-size: 16px; }
.class-badge-sm .class-badge-letter { font-size: 11px; padding: 1px 5px; }

/* ═══════════ TABLES ═══════════ */
.table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    padding: 12px 14px;
    background: linear-gradient(180deg, var(--bg-alt), var(--bg));
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.4);
    vertical-align: middle;
    color: var(--text);
}

.data-table tbody tr:hover {
    background: rgba(20, 184, 166, 0.05);
}

/* ═══════════ GRADE BADGES ═══════════ */
.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.grade-excellent { background: linear-gradient(135deg, #10b981, #059669); color: #ffffff; }
.grade-good { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #ffffff; }
.grade-satisfactory { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff; }
.grade-bad { background: linear-gradient(135deg, #ef4444, #dc2626); color: #ffffff; }

/* ═══════════ HONOR BOARD ═══════════ */
.honor-hero {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: 0 12px 40px rgba(217, 119, 6, 0.30);
}

.honor-hero h1 {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.honor-hero p {
    font-size: 15px;
    opacity: 0.95;
}

.honor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
}

.honor-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.honor-item:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.honor-item.top-1 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(217, 119, 6, 0.08));
    border-color: rgba(251, 191, 36, 0.5);
}

.honor-item.top-2 {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(100, 116, 139, 0.08));
    border-color: rgba(148, 163, 184, 0.5);
}

.honor-item.top-3 {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(180, 83, 9, 0.06));
    border-color: rgba(217, 119, 6, 0.4);
}

.honor-medal {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.honor-info { flex: 1; min-width: 0; }

.honor-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.honor-class {
    font-size: 13px;
    color: var(--text-muted);
}

.honor-avg {
    font-size: 22px;
    font-weight: 900;
    color: var(--teal-dark);
    flex-shrink: 0;
}

html[data-theme="dark"] .honor-avg { color: #5eead4; }

/* ═══════════ EMPTY STATE ═══════════ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 44px;
    color: var(--border-strong);
    margin-bottom: 12px;
    display: block;
    opacity: 0.6;
}

.empty-state p {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

/* ═══════════ DRAWER (Mobile) ═══════════ */
.menu-trigger {
    display: none;
    width: 42px;
    height: 42px;
    background: rgba(20, 184, 166, 0.10);
    border: 1.5px solid rgba(20, 184, 166, 0.35);
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.menu-trigger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--teal-dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.side-drawer, .drawer-overlay { display: none; }

/* ═══════════ FOOTER ═══════════ */
.footer {
    background: linear-gradient(180deg, #0f2e2b 0%, #0a2320 100%);
    color: #d1fae5;
    padding: 40px 24px 18px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 700;
}

.footer-col p {
    font-size: 13.5px;
    color: #a7f3d0;
    margin-bottom: 6px;
}

.footer-col a { color: #a7f3d0; }
.footer-col a:hover { color: #ffffff; }

.footer-slogan {
    color: var(--teal-light) !important;
    font-weight: 700;
    margin-bottom: 10px !important;
}

.footer-logo {
    height: 44px;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 12px;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12.5px;
    color: #6ee7b7;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .menu-trigger { display: flex; }
    .logo-subtitle { display: none; }
    .lang-switch { margin-left: auto; }
    
    .side-drawer {
        display: flex;
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 80%;
        max-width: 380px;
        background: var(--surface);
        z-index: 1999;
        transform: translateX(100%);
        transition: transform 0.35s;
        flex-direction: column;
        overflow-y: auto;
    }
    
    .side-drawer.open { transform: translateX(0); }
    
    .drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 46, 43, 0.55);
        z-index: 1998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    
    .drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
    
    .drawer-head {
        padding: 20px;
        background: linear-gradient(135deg, var(--teal), var(--teal-dark));
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .drawer-user { display: flex; align-items: center; gap: 12px; }
    
    .drawer-avatar {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 18px;
    }
    
    .drawer-user-name { font-size: 14.5px; font-weight: 800; }
    .drawer-user-role { font-size: 11px; opacity: 0.85; }
    
    .drawer-close {
        width: 38px; height: 38px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.35);
        color: #ffffff;
        font-size: 14px;
        cursor: pointer;
    }
    
    .drawer-nav { padding: 14px; }
    
    .drawer-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 12px;
        color: var(--text);
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .drawer-link:hover, .drawer-link.active {
        background: rgba(20, 184, 166, 0.10);
        color: var(--teal-dark);
    }
    
    .drawer-link-icon {
        width: 34px; height: 34px;
        border-radius: 10px;
        background: rgba(20, 184, 166, 0.10);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--teal-dark);
        flex-shrink: 0;
    }
    
    .drawer-divider {
        height: 1px;
        background: rgba(20, 184, 166, 0.20);
        margin: 10px 8px;
    }
    
    .drawer-link-danger { color: var(--danger); }
}

@media (max-width: 480px) {
    .container, .container-wide { padding: 12px; }
    .card { padding: 14px; }
    .logo-title { font-size: 13px; }
    .logo-img { height: 38px; }
    .theme-toggle { width: 36px; height: 36px; }
    .lang-btn { padding: 4px 8px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════
   ECO-AUTOFIX-ADDITIONS
   Автоматически добавлено fix_project.py
   Не удаляй этот блок — он содержит критичные стили
   ═══════════════════════════════════════════════════════════ */

/* ═══ HERO (главная страница) ═══ */
.hero {
    padding: 60px 20px 80px;
    text-align: center;
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.04) 0%, transparent 100%);
}
.hero-content {
    max-width: 720px;
    margin: 0 auto;
}
.hero-logo {
    height: 100px;
    width: auto;
    max-width: 180px;
    margin: 0 auto 24px;
    object-fit: contain;
    display: block;
}
.hero-title {
    font-size: clamp(24px, 3.5vw, 38px);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.15;
}
.hero-subtitle {
    font-size: clamp(14px, 1.6vw, 17px);
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ═══ SECTIONS ═══ */
.section {
    padding: 40px 0;
}
.section-alt {
    background: rgba(238, 246, 248, 0.5);
}
html[data-theme="dark"] .section-alt {
    background: rgba(7, 24, 21, 0.5);
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.section-title {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i { color: var(--teal); }

/* ═══ DASHBOARD TOPBAR ═══ */
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-title {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.15;
    flex-wrap: wrap;
}
.page-title i { color: var(--teal); }
.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 14.5px;
    margin-bottom: 22px;
}

/* ═══ ANNOUNCEMENTS ═══ */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.announcement-card {
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.announcement-card:hover {
    border-color: rgba(20, 184, 166, 0.40);
    box-shadow: var(--shadow-md);
}
.announcement-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.announcement-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
}
.announcement-date {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: monospace;
    font-weight: 700;
    flex-shrink: 0;
}
.announcement-body {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ═══ INFO GRID (главная) ═══ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.info-card {
    text-align: center;
    padding: 28px 20px;
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.info-card:hover {
    transform: translateY(-3px);
    border-color: rgba(20, 184, 166, 0.40);
    box-shadow: var(--shadow-md);
}
.info-card i {
    font-size: 36px;
    color: var(--teal);
    margin-bottom: 14px;
    display: block;
}
.info-card h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}
.info-card p {
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

/* ═══ AUTH (логин) ═══ */
.auth-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    padding: 34px 28px;
    border-radius: var(--radius-lg);
    border: 1.5px solid rgba(20, 184, 166, 0.20);
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo img {
    height: 70px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
}
.auth-logo h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}
.auth-logo p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.auth-form .form-group { margin-bottom: 14px; }
.auth-footer {
    text-align: center;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 13.5px;
}
.btn-block { width: 100%; }

/* ═══ ERROR PAGE ═══ */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.error-content { text-align: center; max-width: 520px; }
.error-code {
    font-size: clamp(60px, 10vw, 92px);
    font-weight: 900;
    color: var(--teal-dark);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}
html[data-theme="dark"] .error-code { color: #5eead4; }
.error-msg {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

/* ═══ FILTERS (honor, generic) ═══ */
.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-field { min-width: 0; }
.filter-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.filter-field label i { color: var(--teal); }
.filter-reset { display: flex; align-items: end; }
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ═══ SYSTEM INFO (owner dashboard) ═══ */
.sys-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.sys-info-item {
    padding: 12px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sys-info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.sys-info-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}
.sys-info-value.ok { color: var(--success); }

/* ═══ LOGS ═══ */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-card {
    padding: 12px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--teal);
}
.log-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
    flex-wrap: wrap;
}
.log-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    font-weight: 700;
}
.log-user {
    font-size: 11.5px;
    color: var(--teal-dark);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.log-action {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.log-details { font-size: 12px; color: var(--text-muted); }

/* ═══ ALERT BLOCK ═══ */
.alert-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border-left: 5px solid;
    flex-wrap: wrap;
}
.alert-block-warning {
    background: rgba(217, 119, 6, 0.10);
    border-left-color: #d97706;
    color: #92400e;
}
.alert-block i { font-size: 22px; }
.alert-link { margin-left: auto; font-weight: 800; color: inherit; }

/* ═══ CLASSES (school) ═══ */
.classes-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.class-card-main {
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.18);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    display: block;
    color: inherit;
}
.class-card-main:hover {
    transform: translateY(-3px);
    border-color: var(--teal);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.class-card-main-head { margin-bottom: 14px; }
.class-card-main-info { display: flex; flex-direction: column; gap: 6px; }
.class-card-main-count,
.class-card-main-room,
.class-card-main-head-teacher {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.class-card-main-count i { color: var(--teal); }
.class-card-main-count strong { color: var(--text); }
.class-card-main-room i { color: var(--teal); }
.class-card-main-head-teacher i { color: var(--teal); }

/* ═══ DASHBOARD STATS GRID ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    flex-shrink: 0;
}
.stat-teal .stat-icon { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.stat-blue .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-green .stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-info { min-width: 0; }
.stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.stat-label {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
}

/* ═══ LESSONS (расписание на день) ═══ */
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lesson-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.lesson-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    font-size: 13px;
}
.lesson-subject {
    font-weight: 700;
    flex: 1;
    min-width: 0;
}
.lesson-teacher {
    color: var(--text-muted);
    font-size: 12px;
}
.lesson-room {
    color: var(--text-muted);
    font-size: 12.5px;
}

/* ═══ GRADES GRID (student) ═══ */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.grade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}
.grade-info { min-width: 0; }
.grade-subject { font-weight: 700; font-size: 13px; }
.grade-date { font-size: 11.5px; color: var(--text-muted); }

/* ═══ HW LIST (student) ═══ */
.hw-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hw-item {
    padding: 12px 14px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--teal);
}
.hw-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.hw-meta { font-size: 11.5px; color: var(--text-muted); }
.hw-meta i { color: var(--teal); margin: 0 3px; }

/* ═══ STUDENT HERO ═══ */
.student-card-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(16, 185, 129, 0.05));
    border-radius: var(--radius-lg);
    border: 1.5px solid rgba(20, 184, 166, 0.25);
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.student-hero-class { flex-shrink: 0; }
.student-hero-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}
.student-hero-avg {
    font-size: 14px;
    color: var(--text-muted);
}
.student-hero-avg strong {
    color: var(--teal-dark);
    font-size: 18px;
    font-weight: 900;
}

/* ═══ HONOR FILTERS ═══ */
.honor-filters {
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

/* ═══ ADMIN PANEL TILES ═══ */
.admin-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.admin-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1.5px solid rgba(20, 184, 166, 0.14);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.admin-tile:hover {
    border-color: rgba(20, 184, 166, 0.45);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--teal-dark);
}
.admin-tile-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}
.admin-tile-info { flex: 1; min-width: 0; }
.admin-tile-info h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 3px;
    color: var(--text);
}
.admin-tile-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}
.admin-tile-arrow {
    color: var(--text-muted);
    font-size: 15px;
    opacity: 0.4;
    transition: all 0.25s;
    flex-shrink: 0;
}
.admin-tile:hover .admin-tile-arrow {
    color: var(--teal);
    opacity: 1;
    transform: translateX(4px);
}

/* ═══ Тёмная тема — фиксы для новых блоков ═══ */
html[data-theme="dark"] .hero {
    background: linear-gradient(180deg, rgba(16, 48, 40, 0.5) 0%, transparent 100%);
}
html[data-theme="dark"] .announcement-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .class-card-main,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .admin-tile {
    background: rgba(16, 48, 40, 0.72);
    border-color: rgba(45, 212, 191, 0.18);
}
html[data-theme="dark"] .announcement-card:hover,
html[data-theme="dark"] .info-card:hover,
html[data-theme="dark"] .class-card-main:hover,
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .admin-tile:hover {
    background: rgba(20, 60, 50, 0.85);
    border-color: rgba(45, 212, 191, 0.45);
}
html[data-theme="dark"] .lesson-row,
html[data-theme="dark"] .grade-item,
html[data-theme="dark"] .hw-item,
html[data-theme="dark"] .sys-info-item,
html[data-theme="dark"] .log-card {
    background: rgba(7, 24, 21, 0.6);
}
html[data-theme="dark"] .auth-card {
    background: rgba(16, 48, 40, 0.92);
    border-color: rgba(45, 212, 191, 0.25);
}
html[data-theme="dark"] .honor-filters {
    background: rgba(16, 48, 40, 0.72);
    border-color: rgba(45, 212, 191, 0.18);
}
html[data-theme="dark"] .student-card-hero {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(52, 211, 153, 0.06));
    border-color: rgba(45, 212, 191, 0.30);
}
html[data-theme="dark"] .student-hero-avg strong { color: #5eead4; }
html[data-theme="dark"] .sys-info-value.ok { color: #34d399; }

/* ═══ PAGE HEADER SIMPLE ═══ */
.page-header-simple {
    margin-bottom: 22px;
}

/* ═══ BACK LINK ═══ */
.back-link {
    color: var(--text-muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    transition: all 0.2s;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover {
    color: var(--teal);
    transform: translateX(-3px);
}

/* ═══ NOTIFICATION TOAST (для JS) ═══ */
.eco-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #0d9488;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    max-width: 90vw;
    text-align: center;
    animation: slideUpToast 0.3s ease-out;
}
@keyframes slideUpToast {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ═══ END ECO-AUTOFIX-ADDITIONS ═══ */
