:root {
    color-scheme: light;
    font: 15px/1.55 system-ui, sans-serif;
    color: #18283c;
    background: #f3f6fb;
    --nav: #122438;
    --accent: #1755be;
    --line: #dbe3ef;
    --muted: #50617a;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.04em; margin-bottom: 1.1rem; }
h2 { font-size: 1.15rem; }
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--nav); color: white; padding: 28px 16px; display: flex; flex-direction: column; gap: 32px; }
.brand { display: block; color: inherit; text-decoration: none; font-weight: 750; font-size: 1.2rem; letter-spacing: -.025em; }
.brand span { display: block; font-size: .8rem; color: #8ca8ca; letter-spacing: .03em; }
nav { display: grid; gap: 6px; }
nav a { display: block; color: #d5e3f5; padding: 9px 12px; border-radius: 8px; text-decoration: none; }
nav a:hover, nav a[aria-current] { background: #25476e; color: white; }
aside form { margin-top: auto; }
main { width: 100%; max-width: 1350px; padding: clamp(16px, 3vw, 42px); min-width: 0; }
.login { max-width: 460px; margin: 10vh auto 0; }
.login .brand { margin-bottom: 22px; }
.login .brand span { color: var(--muted); }
.panel, .metric { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel { margin: 16px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.metric strong { display: block; font-size: 1.75rem; line-height: 1.2; margin-top: 4px; }
.metric span, .muted, small { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 16px 0; }
.filters label { margin: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.wide { grid-column: 1 / -1; }
label { display: block; font-weight: 650; margin-bottom: 14px; }
label small { display: block; font-weight: 400; }
input, textarea, select, button { font: inherit; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #aebed2; border-radius: 8px; color: inherit; background: white; }
textarea { resize: vertical; }
.check { align-self: center; }
button { border: 0; border-radius: 8px; padding: 9px 14px; background: var(--accent); color: white; font-weight: 650; cursor: pointer; }
button:hover { background: #113f90; }
button.secondary { background: #25476e; }
:focus-visible { outline: 3px solid #477ee0; outline-offset: 3px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 9px; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: #eef3fa; font-size: .86rem; }
tbody tr:last-child > * { border-bottom: 0; }
.break, .message { overflow-wrap: anywhere; }
.message { white-space: pre-wrap; }
.chart th, .chart td { padding-block: 5px; }
.bar { display: flex; align-items: center; gap: 10px; min-width: 110px; }
.bar span { min-width: 3ch; text-align: right; }
meter { flex: 1; width: 100%; height: 14px; }
meter::-webkit-meter-bar { background: #e7eef9; border: 0; }
meter::-webkit-meter-optimum-value { background: #2765db; }
meter::-moz-meter-bar { background: #2765db; }
.previous meter::-webkit-meter-optimum-value { background: #537579; }
.previous meter::-moz-meter-bar { background: #537579; }
.notice { background: #e9f8ef; border-radius: 8px; padding: 10px 14px; }
.error { background: #fdebed; }
.next { margin-left: 12px; }
dt { font-weight: 700; }
dd { margin: 0 0 12px; overflow-wrap: anywhere; }
@media (max-width: 670px) {
    .layout { grid-template-columns: 132px minmax(0, 1fr); }
    aside { padding: 16px 7px; gap: 20px; }
    .brand { font-size: .94rem; }
    nav a { padding-inline: 7px; }
    .fields { grid-template-columns: 1fr; }
    .panel, .metric { padding: 12px; }
}
.rating-red { background: #fde8e8; }
.rating-yellow { background: #fff4c7; }
.rating-green { background: #e4f5e8; }
mark { background: #ffeb3b; color: #18283c; border-radius: 2px; }
.filters input[type=search] { min-width: min(270px, 55vw); }
.template-list { padding-left: 1.3rem; }
