/* Общая дизайн-система LMS: тёмная тема, один источник правды для всех страниц */
:root {
    --bg: #0f172a;
    --card: #1e293b;
    --line: #334155;
    --line-2: #475569;
    --accent: #3b82f6;
    --ok: #10b981;
    --warn: #f59e0b;
    --bad: #ef4444;
    --text: #f8fafc;
    --dim: #94a3b8;
}
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text);
    margin: 0; padding: 20px; line-height: 1.5;
}
a { color: var(--accent); }
.logo {
    font-weight: 800; font-size: 1.2rem;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Шапка */
header.site {
    display: flex; justify-content: space-between; align-items: center; gap: 15px;
    margin-bottom: 25px; background: var(--card); padding: 15px 25px;
    border-radius: 20px; border: 1px solid var(--line); flex-wrap: wrap;
}
.user-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge { background: var(--line); color: var(--dim); font-size: 0.8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.badge-accent { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.4); }
.logout-link { color: var(--bad); text-decoration: none; font-size: 0.85rem; font-weight: 800; }
.nickname { font-weight: 700; cursor: pointer; border-bottom: 1px dashed var(--line-2); }
.nickname:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Навигация-чипы */
.nav-scroller { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; flex-wrap: wrap; }
.nav-chip {
    background: var(--line); padding: 9px 18px; border-radius: 30px; text-decoration: none;
    color: var(--dim); font-size: 0.85rem; font-weight: 600; transition: 0.2s;
    border: 1px solid transparent; white-space: nowrap; cursor: pointer;
}
.nav-chip:hover { color: var(--text); }
.active-chip { background: var(--accent); color: white; border-color: #60a5fa; }
.chip-ghost { background: transparent; border: 1px dashed var(--line-2); }

/* Кнопки */
.btn {
    display: inline-block; background: var(--accent); color: white; border: none;
    padding: 10px 18px; border-radius: 10px; cursor: pointer; font-weight: 700;
    font-size: 0.9rem; text-decoration: none; transition: 0.2s; text-align: center;
}
.btn:hover { filter: brightness(1.12); }
.btn-green { background: var(--ok); }
.btn-gray { background: var(--line); border: 1px solid var(--line-2); }
.btn-red { background: var(--bad); }
.btn-orange { background: var(--warn); }
.btn-block { width: 100%; }

/* Поля ввода */
.inp {
    background: var(--bg); border: 1px solid var(--line-2); color: white;
    padding: 11px 14px; border-radius: 10px; outline: none; transition: 0.2s;
    font-size: 0.95rem; width: 100%;
}
.inp:focus { border-color: var(--accent); }
select.inp { appearance: auto; }

/* Карточки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }

/* Модальные окна */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.95);
    display: none; align-items: center; justify-content: center;
    z-index: 9999; backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: var(--card); padding: 35px; border-radius: 24px;
    border: 1px solid var(--line); width: 92%; max-width: 460px;
    position: relative; max-height: 88vh; overflow-y: auto;
}
.modal-close { position: absolute; top: 14px; right: 18px; color: var(--dim); font-size: 1.5rem; cursor: pointer; }
.modal-content h2 { margin-top: 0; }
.modal-content .inp { margin: 8px 0; }

/* Оценки */
.grade-5 { color: var(--ok); font-weight: 800; }
.grade-4 { color: var(--accent); font-weight: 800; }
.grade-3 { color: var(--warn); font-weight: 800; }
.grade-2 { color: var(--bad); font-weight: 800; }

/* Страница входа */
.auth-wrap { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; padding: 40px; text-align: center; }
.auth-card .inp { margin: 8px 0; text-align: center; }
.auth-error { color: var(--bad); font-size: 0.9rem; margin-top: 12px; font-weight: 600; }

/* Кабинет студента: карточки заданий */
.container { max-width: 800px; margin: 0 auto; padding-bottom: 50px; }
.service-nav { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; }
.btn-service {
    flex: 1; min-width: 110px; background: var(--line); color: white; text-decoration: none;
    padding: 12px; border-radius: 12px; text-align: center; font-size: 0.85rem;
    font-weight: 600; border: 1px solid var(--line-2); transition: 0.2s;
}
.btn-service:hover { background: var(--line-2); transform: translateY(-2px); }

.progress-block { padding: 25px; margin-bottom: 30px; }
.progress-bar-bg { background: var(--line); height: 12px; border-radius: 10px; overflow: hidden; margin-top: 15px; }
.progress-fill { height: 100%; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

.criteria-btn {
    font-size: 0.75rem; background: var(--line); color: #cbd5e1; padding: 4px 8px;
    border-radius: 6px; margin-left: 10px; cursor: pointer; border: 1px solid var(--line-2);
}
.criteria-btn:hover { background: var(--line-2); color: white; }

.section-title {
    font-size: 0.85rem; text-transform: uppercase; color: var(--dim);
    font-weight: 700; margin: 30px 0 15px 10px; letter-spacing: 1px;
}

.task-card { margin-bottom: 15px; }
.task-header { padding: 20px; display: flex; align-items: center; gap: 20px; }
.task-num {
    width: 40px; height: 40px; background: var(--line); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: var(--dim); flex-shrink: 0;
}
.done-mark { color: white !important; }
.task-link { color: var(--accent); text-decoration: none; font-weight: 700; font-size: 0.85rem; margin-top: 8px; display: inline-block; }
.task-link:hover { text-decoration: underline; }
.answer-area { padding: 20px; background: var(--bg); display: flex; gap: 10px; border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
.locked { opacity: 0.4; filter: grayscale(1); pointer-events: none; }
.done-at { font-size: 0.7rem; color: var(--dim); text-align: right; white-space: nowrap; }

/* Журнал */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.summary-line { color: var(--dim); font-size: 0.85rem; margin: 0 0 15px 4px; }
.summary-line b { color: var(--text); }

.table-container { overflow-x: auto; background: var(--card); border-radius: 12px; border: 1px solid var(--line); }
table.journal { width: 100%; border-collapse: collapse; min-width: 900px; }
.journal th, .journal td {
    padding: 10px 12px; border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line); text-align: center; font-size: 0.9rem;
}
.journal th { background: var(--bg); color: var(--dim); font-weight: normal; font-size: 0.8rem; }
.journal th a { color: inherit; text-decoration: none; }
.journal th a:hover { color: var(--text); }
.journal td.student-cell, .journal th.student-cell {
    text-align: left; position: sticky; left: 0; background: var(--card);
    z-index: 2; border-right: 2px solid var(--line-2); min-width: 190px;
}
.journal th.student-cell { background: var(--bg); z-index: 3; }

.status-cell { font-family: monospace; font-size: 1.1rem; cursor: pointer; user-select: none; transition: background 0.2s; }
.status-cell:hover { background: var(--line); }
.done { color: var(--ok); }
.pending { color: var(--line); }
.login-sub { display: block; font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.last-seen { font-size: 0.78rem; color: var(--dim); white-space: nowrap; }

.edit-icon { opacity: 0; cursor: pointer; margin-left: 8px; filter: grayscale(1); transition: 0.2s; }
tr:hover .edit-icon { opacity: 1; }
.edit-icon:hover { filter: none; transform: scale(1.2); }

.action-btn { background: none; border: none; cursor: pointer; font-size: 1.05rem; padding: 2px; transition: 0.2s; opacity: 0.55; }
.action-btn:hover { opacity: 1; transform: scale(1.2); }

/* Таблица критериев и выданных аккаунтов */
.crit-table { width: 100%; border-collapse: collapse; margin-top: 15px; text-align: left; }
.crit-table th, .crit-table td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 0.9rem; }
.crit-table th { color: white; }
.cred-pass { font-family: monospace; font-size: 1rem; color: var(--ok); }
