:root {
  --bg: #f5f6f8; --card: #fff; --text: #0f172a; --muted: #5b6474; --line: #e5e8ee; --side: #0b1324; --side-text: #c7cfdd;
  --accent: #4f46e5; --accent-2: #06b6d4; --accent-ink: #fff; --accent-soft: #eef0ff;
  --ok: #15803d; --warn: #a16207; --bad: #b91c1c; --ok-bg: #e9f7ee; --warn-bg: #fdf4dc; --bad-bg: #fdeceb; --chip: #f0f2f6;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.04);
  font: 14.5px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 99; }
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; padding: 4px 8px 16px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-weight: 500; }
.sidenav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.sidenav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidenav a[aria-current=page] { background: rgba(99,102,241,.22); color: #fff; }
.small-nav a { font-size: 13.5px; }
.small-nav img, .small-nav .plat { width: 18px; height: 18px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8390a8; margin: 18px 10px 4px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.side-foot a { color: var(--side-text); }
.plan { background: rgba(255,255,255,.06); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; font-size: 13px; }
.plan strong { color: #fff; }
.content { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.crumbs { font-weight: 600; } .crumbs a { color: var(--muted); text-decoration: none; }
.top-right { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 28px 80px; }
main:focus { outline: none; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; } h2 { font-size: 16.5px; margin: 30px 0 12px; } h3 { font-size: 15px; margin: 0 0 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
button, .btn { font: inherit; font-weight: 600; border-radius: 9px; padding: 9px 16px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 1px 2px rgba(79,70,229,.25); }
button:hover, .btn:hover { filter: brightness(1.07); }
button.ghost, .btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); box-shadow: none; }
button.danger { background: var(--card); color: var(--bad); border-color: #f3c4c0; box-shadow: none; }
button:disabled { opacity: .55; cursor: progress; }
button.small { padding: 5px 11px; font-size: 13px; }
label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: 13.5px; }
input[type=text], input[type=password], input[type=url], input[type=email], select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #d4d9e2; border-radius: 9px; background: #fff; color: var(--text); }
input:focus { border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; } .check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.score { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.good { color: var(--ok); } .mid { color: var(--warn); } .bad { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--chip); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--accent); border-color: var(--accent); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
details summary { cursor: pointer; padding: 3px 0; }
code, pre { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip); border-radius: 6px; }
code { padding: 1px 5px; word-break: break-all; } pre { padding: 10px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
.cms { cursor: pointer; text-align: left; background: var(--card); color: var(--text); border: 1.5px solid var(--line); font-weight: 400; padding: 18px; border-radius: 14px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); }
.cms:hover { border-color: #c7cbf7; filter: none; }
.cms[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cms strong { display: block; font-size: 15px; margin-bottom: 3px; }
.plat { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.plat i { display: block; width: 58%; height: 58%; background: #fff; -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; }
.plat.sm { width: 26px; height: 26px; border-radius: 7px; }
.plat.xs { width: 18px; height: 18px; border-radius: 5px; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .trend { font-size: 12.5px; color: var(--muted); }
.ring { --p: 0; --c: var(--accent); width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #edf0f5 0); display: grid; place-items: center; flex: none; }
.ring span { width: 66px; height: 66px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.notice { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.notice.err { border-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); }
.empty { text-align: center; padding: 56px 24px; }
.empty .platrow { display: flex; justify-content: center; gap: 10px; margin: 18px 0 24px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; display: none; max-width: 90vw; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.statement { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 26px 18px; }
.sitecard { text-decoration: none; color: inherit; display: block; transition: transform .12s, box-shadow .12s; }
.sitecard:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(15,23,42,.08); }
.vis { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-label, #sitenav, .side-foot { display: none; }
  .sidenav { flex-direction: row; }
  .brand { padding: 4px 8px; }
  main { padding: 20px 16px 60px; } .topbar { padding: 12px 16px; }
  .hide-sm { display: none; }
}

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button[aria-pressed=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
.cms[hidden] { display: none; }
.cms > span:last-child { min-width: 0; }

.trend { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.trend span { flex: 1; border-radius: 5px 5px 0 0; background: var(--accent); min-width: 8px; }
.trend span.good { background: #16a34a; } .trend span.mid { background: #d97706; } .trend span.bad { background: #dc2626; }
.bar { height: 8px; background: var(--chip); border-radius: 9px; overflow: hidden; margin-top: 4px; } .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

body.auth .side, body.auth .topbar { display: none; }
body.auth .shell { grid-template-columns: 1fr; }
body.auth main { min-height: 100vh; display: grid; place-items: center; }
.login { max-width: 440px; width: 100%; padding: 36px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 16px; border: 1px solid #d4d9e2; border-radius: 10px; background: #fff; color: #1f2937; font-weight: 600; text-decoration: none; margin-top: 18px; }
.gbtn:hover { background: #f8fafc; }
.avatar img { display: block; }
.top-right a.chip { text-decoration: none; }
