:root {
    --bg: #f3f5f9; --panel: #fff; --ink: #1d2433; --muted: #6b7488; --line: #e2e6ef;
    --brand: #2b4a9a; --brand-2: #4a6fd8;
    --go: #1f8a4c; --go-bg: #e6f6ec; --nogo: #c62f3b; --nogo-bg: #fdeaec;
    --und: #8a6d12; --und-bg: #fff6d9; --minor: #b26a00; --minor-bg: #fff0d6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
h1, h2 { margin: 0; }
.muted { color: var(--muted); font-size: .9em; }

.brand-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 1.2rem; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; font-size: .85rem; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh;
    background: linear-gradient(135deg, #e9eefc, #f7f9ff 60%); }
.login-card { width: min(400px, 92vw); background: var(--panel); border-radius: 18px; padding: 32px;
    box-shadow: 0 12px 40px rgba(43, 74, 154, .15); }
.brand { text-align: center; margin-bottom: 20px; }
.brand h1 { font-size: 1.35rem; margin: 12px 0 4px; }
.brand p { margin: 0; color: var(--muted); font-size: .92rem; }
.login-card label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .9rem; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.login-card input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.login-card button { width: 100%; margin-top: 22px; padding: 12px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--brand); color: #fff; font-size: 1rem; font-weight: 600; }
.login-card button:hover { background: var(--brand-2); }
.alert { background: var(--nogo-bg); color: var(--nogo); padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }

/* Top bar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px;
    background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 14px; margin: 0; }
.topbar-user small { color: var(--muted); }
button.link { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--brand); }
button.link:hover { background: var(--bg); }

/* Layout */
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.empty { max-width: 500px; margin: 80px auto; text-align: center; color: var(--muted); }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }

.list h2 { font-size: 1rem; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.count { background: var(--line); border-radius: 99px; padding: 1px 9px; font-size: .8rem; }
.card { display: block; background: var(--panel); border: 2px solid transparent; border-radius: 12px; padding: 12px 14px;
    margin-bottom: 10px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.card:hover { border-color: var(--line); }
.card.active { border-color: var(--brand-2); }
.card-name { display: block; font-weight: 600; }
.card-title { display: block; color: var(--muted); font-size: .85rem; margin: 2px 0 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ver { margin-left: auto; color: var(--muted); font-size: .8rem; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.badge.go, .badge.ok { background: var(--go-bg); color: var(--go); }
.badge.nogo, .badge.critical { background: var(--nogo-bg); color: var(--nogo); }
.badge.undecided { background: var(--und-bg); color: var(--und); }
.badge.minor { background: var(--minor-bg); color: var(--minor); }

/* Detail */
.doc-head h1 { font-size: 1.5rem; }
.doc-head h1 small { font-size: .85rem; color: var(--muted); font-weight: 400; margin-left: 8px; }
.doc-title { font-size: 1.1rem; margin: 6px 0 2px; }
.doc-sub { margin: 0 0 16px; color: var(--muted); }

.verdict { display: flex; gap: 18px; align-items: center; padding: 18px 22px; border-radius: 14px; margin-bottom: 18px; border: 1px solid; }
.verdict.go { background: var(--go-bg); border-color: var(--go); color: var(--go); }
.verdict.nogo { background: var(--nogo-bg); border-color: var(--nogo); color: var(--nogo); }
.verdict.undecided { background: var(--und-bg); border-color: #e6c64d; color: var(--und); }
.verdict-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: currentColor; flex: none; }
.verdict-icon { color: inherit; font-size: 1.6rem; font-weight: 700; position: relative; }
.verdict.go .verdict-icon, .verdict.nogo .verdict-icon, .verdict.undecided .verdict-icon { color: #fff; }
.verdict.go .verdict-icon { background: var(--go); }
.verdict.nogo .verdict-icon { background: var(--nogo); }
.verdict.undecided .verdict-icon { background: #d4a900; }
.verdict-label { font-size: 1.4rem; font-weight: 700; }
.verdict-text, .verdict-note { color: var(--ink); }
.verdict-note { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, .1); }

.panel { background: var(--panel); border-radius: 14px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
.panel h2 { font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel p { margin: 6px 0; }

.issues { list-style: none; margin: 8px 0 0; padding: 0; }
.issues li { padding: 8px 12px; border-left: 3px solid var(--nogo); background: var(--nogo-bg); border-radius: 6px; margin-bottom: 6px; }
.kind { font-weight: 700; font-size: .78rem; text-transform: uppercase; margin-right: 6px; color: var(--nogo); }

.remark { border-left: 3px solid var(--brand-2); padding: 4px 0 4px 14px; margin: 14px 0; }
.remark header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.remark time { color: var(--muted); font-size: .8rem; margin-left: auto; }
.stars { color: #e0a800; letter-spacing: 2px; }

.model { font-size: .78rem; font-weight: 500; background: var(--bg); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; color: var(--muted); }
.avg { display: flex; align-items: baseline; gap: 8px; }
.avg-value { font-size: 2.2rem; font-weight: 700; color: var(--brand); }
.avg-of { color: var(--muted); }
.ai-summary { background: var(--bg); padding: 10px 14px; border-radius: 10px; }
.aspect { border-top: 1px solid var(--line); padding: 8px 0; }
.aspect summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; }
.aspect p { color: #3a4358; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 18px; height: 8px; border-radius: 4px; background: var(--line); }
.pips i.on { background: #e0a800; }
.pips i.on.s1 { background: var(--nogo); }
.pips i.on.s2 { background: #e2742b; }
.pips i.on.s4, .pips i.on.s5 { background: var(--go); }
