:root {
    --accent: #2d6cdf;
    --bg: #f5f7fa;
    --fg: #1a2230;
    --muted: #6b7685;
}

* { box-sizing: border-box; }

/* Верхняя навигация (рабочие пространства) */
.topnav { display: flex; align-items: center; gap: 16px; background: #1a2230;
    padding: 0 24px; height: 46px; color: #cdd5e0; font-size: 13px; }
.topnav .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 16px; }
.topnav .nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.topnav .nav-links a { color: #cdd5e0; text-decoration: none; }
.topnav .nav-links a:hover, .topnav .nav-links a.active { color: #fff; }
.topnav .nav-user { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.topnav .nav-user .who { color: #fff; }
.topnav .nav-user em { color: #8fa0b6; font-style: normal; }
.topnav .nav-user a { color: #8fa0b6; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

header {
    background: #fff;
    padding: 28px 40px;
    border-bottom: 1px solid #e3e8ef;
}

header h1 {
    margin: 0;
    color: var(--accent);
    font-size: 28px;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--muted);
}

main {
    padding: 32px 40px;
    max-width: 760px;
    line-height: 1.6;
}

.health {
    margin-top: 24px;
    color: var(--muted);
}

a { color: var(--accent); }

/* Реестр страниц */
main.wide { max-width: 100%; padding: 24px 32px; }

.filters { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.filters select { padding: 4px 8px; }

.summary { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; color: var(--muted); }
.summary .total { margin-left: auto; }
.inline { display: inline; margin: 0; }
.btn {
    background: var(--accent); color: #fff; border: 0; padding: 7px 14px;
    border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn:hover { opacity: .9; }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.dot.green { background: #2b9d4f; }
.dot.yellow { background: #e3a008; }
.dot.red { background: #d63b3b; }

table.grid { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
table.grid th, table.grid td { border: 1px solid #e3e8ef; padding: 5px 8px; text-align: left; }
table.grid thead th { background: #f0f3f8; position: sticky; top: 0; }
table.grid tr:hover td { background: #f8fafc; }
td.url { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.ell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.issues { color: #8a6d00; font-size: 12px; }

.status-list { list-style: none; padding: 0; }
.status-list li { margin: 8px 0; }
.status-list .dot { margin-right: 8px; }

/* Таблица скоринга */
.filters .count { color: var(--muted); margin-left: auto; }
.flash { background: #e6f5ec; border: 1px solid #b6e0c5; color: #1c6b3a;
    padding: 8px 12px; border-radius: 6px; }

table.scoring { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
table.scoring th, table.scoring td { border: 1px solid #e8ecf2; padding: 4px 7px; text-align: left; }
table.scoring thead th { background: #f0f3f8; position: sticky; top: 0; white-space: nowrap; }
table.scoring thead th a { color: var(--fg); text-decoration: none; }
table.scoring tr:hover td { background: #f8fafc; }
table.scoring td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.scoring td.phrase { max-width: 320px; }
table.scoring td.url { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.prio { font-weight: 600; }
.rel-bad { color: #d63b3b; }

/* подсветка позиции */
.pos-top3  { background: #cdeccc; }
.pos-top10 { background: #e7f6e0; }
.pos-out   { background: #f0f0f0; color: var(--muted); }
/* подсветка сложности */
.diff-easy     { background: #d8f0d8; }
.diff-mid      { background: #fdf2cf; }
.diff-hard     { background: #fadfc8; }
.diff-veryhard { background: #f7cfcf; }

.btn-mini { border: 1px solid #cfd6e0; background: #fff; cursor: pointer;
    border-radius: 5px; padding: 1px 7px; font-size: 14px; line-height: 1.2; }
.btn-mini:hover { background: var(--accent); color: #fff; }
.pager { display: flex; gap: 16px; align-items: center; margin: 14px 0; color: var(--muted); }

/* Карточка страницы */
.crumbs { margin: 0 0 12px; }
.page-url { font-size: 18px; margin: 0 0 4px; word-break: break-all; }
.meta { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.card-cols { display: flex; gap: 28px; flex-wrap: wrap; }
.card-block { flex: 1; min-width: 320px; margin-bottom: 22px; }
.card-block h3 { font-size: 15px; margin: 0 0 10px; }
table.kv { border-collapse: collapse; width: 100%; font-size: 13px; }
table.kv td { border-bottom: 1px solid #eef1f6; padding: 5px 8px; vertical-align: top; }
table.kv td:first-child { color: var(--muted); width: 42%; }
svg.chart { background: #fff; border: 1px solid #e8ecf2; border-radius: 6px; }
.chart-max { fill: #98a2b3; font-size: 11px; }
.ok { color: #2b9d4f; }

/* Доска задач */
.board { display: flex; gap: 18px; align-items: flex-start; }
.board-col { flex: 1; min-width: 280px; background: #eef1f6; border-radius: 8px; padding: 10px; }
.board-col h3 { font-size: 14px; margin: 2px 4px 12px; display: flex; justify-content: space-between; }
.col-count { color: var(--muted); font-weight: 400; }
.task-card { background: #fff; border: 1px solid #e3e8ef; border-radius: 7px; padding: 9px 11px; margin-bottom: 10px; font-size: 13px; }
.task-url { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.task-goal { font-weight: 600; margin: 6px 0; }
.task-tasks { color: #344054; white-space: pre-wrap; }
.task-comment { color: #1c6b3a; margin-top: 5px; }
.task-label { color: var(--muted); font-size: 11px; margin-top: 5px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task-edit { margin-top: 8px; }
.task-edit summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.task-edit label { display: block; margin: 6px 0; font-size: 12px; color: var(--muted); }
.task-edit input[type=text], .task-edit textarea { width: 100%; box-sizing: border-box; }

/* Прогноз трафика */
.legend { color: var(--muted); margin: 6px 0 14px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin: 0 3px 0 12px; }
.legend .sw.plan { background: #2d6cdf; }
.legend .sw.fact { background: #2b9d4f; }
.chart-x { fill: #667085; font-size: 11px; text-anchor: middle; }

/* Формы рекламы */
form.stack { display: flex; flex-direction: column; gap: 8px; max-width: 280px; }
form.stack input, form.stack select { padding: 5px 8px; }
table.grid tfoot td { border-top: 2px solid #cbd5e1; background: #f8fafc; }

/* Страница входа */
.login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: #eef1f6; }
.login-card { background: #fff; padding: 32px 36px; border-radius: 10px; box-shadow: 0 6px 24px rgba(26,34,48,.12); width: 320px; }
.login-card h1 { color: var(--accent); margin: 0; }
.login-card .subtitle { margin: 4px 0 20px; }
.login-card form.stack { max-width: 100%; }
.login-card input { padding: 9px 11px; }
.login-error { background: #fdecec; border: 1px solid #f5c2c2; color: #b42318; padding: 8px 11px; border-radius: 6px; font-size: 13px; }
