:root {
    --ink: #14243F; --muted: #5A6B85; --line: #DDE3EF;
    --blue: #2F5BEA; --blue-dk: #1E42C0; --bg: #F4F6FB;
    --ok: #0E9E9C; --danger: #D64535; --marker: #FFD24C;
    --radius: 14px; --shadow: 0 10px 30px -16px rgba(20,36,63,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Manrope', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; }

/* Вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow); padding: 40px; width: 100%; max-width: 380px;
}
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login .mark { display: inline-grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: var(--marker); border-radius: 11px; font-family: 'JetBrains Mono', monospace; font-size: 24px; margin-bottom: 16px; }

/* Шапка */
.topbar { background: var(--ink); color: #fff; }
.topbar__inner { max-width: 1080px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.topbar__title { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.topbar__title .mark { display: grid; place-items: center; width: 32px; height: 32px; background: rgba(255,255,255,.12); color: var(--marker); border-radius: 8px; font-family: 'JetBrains Mono', monospace; }
.topbar a.exit { color: #B9C6E0; text-decoration: none; font-size: 14px; font-weight: 600; }
.topbar a.exit:hover { color: #fff; }
.topbar a.view { color: var(--marker); text-decoration: none; font-size: 14px; font-weight: 700; margin-right: 20px; }

/* Вкладки */
.tabs { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a {
    padding: 16px 18px; text-decoration: none; color: var(--muted);
    font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--blue); }
.tabs a:hover { color: var(--ink); }

/* Контент */
.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 22px; }
.card h2 { font-size: 19px; margin-bottom: 4px; }
.card .hint { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.section-title { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 16px; }

label.field { display: block; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
label.field span.req { color: var(--danger); }
input[type=text], input[type=email], input[type=url], input[type=password], textarea, select {
    width: 100%; margin-top: 7px; padding: 11px 13px; border: 1px solid var(--line);
    border-radius: 10px; font-family: inherit; font-size: 15px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 700; font-size: 15px; padding: 11px 20px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dk); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--danger { background: #fff; color: var(--danger); border-color: #F0C4BE; padding: 7px 12px; font-size: 13px; }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: 14px; }

.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; font-weight: 600; }
.flash--ok { background: rgba(14,158,156,.12); color: #0a6b6a; }
.flash--err { background: rgba(214,69,53,.1); color: #a52c1e; }

/* Списки */
.item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; display: flex; gap: 16px; align-items: flex-start; }
.item__thumb { width: 120px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000; flex-shrink: 0; }
.item__thumb iframe, .item__thumb img { width: 100%; height: 100%; border: 0; object-fit: cover; }
.item__body { flex: 1; min-width: 0; }
.item__body h4 { font-size: 16px; margin-bottom: 4px; }
.item__body .meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 8px; border-radius: 5px; background: rgba(47,91,234,.12); color: var(--blue-dk); margin-bottom: 6px; }

.avatar-preview { width: 120px; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #eef; }

/* Варианты тестов */
.variant { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.variant__head { background: #F7F9FD; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.variant__head h3 { font-size: 17px; }
.variant__head .count { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted); }
.variant__body { padding: 18px; }
.qrow { padding: 12px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.qrow:first-child { border-top: 0; }
.qrow__text { font-size: 15px; }
.qrow__text b { font-family: 'JetBrains Mono', monospace; color: var(--blue); margin-right: 8px; }
.qrow__meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
details.addq { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 14px; }
details.addq summary { cursor: pointer; font-weight: 700; color: var(--blue); }
details.addq[open] summary { margin-bottom: 14px; }

.empty { color: var(--muted); text-align: center; padding: 24px; }
.req-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.req-item .date { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.req-item .who { font-weight: 700; margin: 4px 0; }

@media (max-width: 620px) {
    .row { grid-template-columns: 1fr; }
    .item { flex-direction: column; }
    .item__thumb { width: 100%; }
}
