@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");
/* ====== Личный кабинет КБ ====== */
:root {
    --bg: #eef1f7;
    --card: #ffffff;
    --text: #141a2e;
    --muted: #6a7390;
    --line: #e4e8f1;
    --accent: #1565c0;
    --accent-2: #4fb3f6;
    --accent-soft: #e6f1fc;
    --ok: #0f8a5f;
    --ok-soft: #dcf7ea;
    --fail: #c2342b;
    --fail-soft: #fde8e6;
    --work: #a15c00;
    --work-soft: #fff1d6;
    --radius: 18px;
    --shadow-1: 0 1px 2px rgba(20, 26, 46, .06), 0 4px 12px rgba(20, 26, 46, .06);
    --shadow-3d: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(20, 26, 46, .05), 0 12px 28px -6px rgba(31, 41, 90, .16), 0 30px 60px -20px rgba(31, 41, 90, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.brand { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.alert { background: var(--fail-soft); color: var(--fail); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.notice { background: #e6f1fc; color: #0b4a94; border: 1px solid #cde3f8; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-weight: 600; box-shadow: var(--shadow-1); }
.card-3d { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-3d); }

/* ---------- Вход ---------- */
body.auth {
    background:
        radial-gradient(1200px 600px at 10% -10%, #2a8ae6 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 110%, #4fb3f6 0%, transparent 55%),
        linear-gradient(160deg, #0b3c8a 0%, #072a63 100%);
    min-height: 100vh;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden; }
.login-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(79, 179, 246, .45), transparent 65%); filter: blur(20px); top: 50%; left: 50%; transform: translate(-50%, -60%); }
.login {
    position: relative; width: 100%; max-width: 400px; padding: 34px 30px 26px;
    background: rgba(255, 255, 255, .96); border-radius: 24px;
    box-shadow: 0 1px 0 #fff inset, 0 30px 80px -20px rgba(0, 0, 0, .55), 0 10px 30px -10px rgba(10, 50, 120, .5);
}
.login-mark {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px;
    font-weight: 800; color: #fff; letter-spacing: .02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 20px -6px rgba(21, 101, 192, .6), 0 -3px 0 rgba(0, 0, 0, .12) inset, 0 2px 0 rgba(255, 255, 255, .35) inset;
}
.login h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 4px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { margin: 0 0 22px; color: var(--muted); }
.login label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.login input {
    display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: #f7f8fc; box-shadow: 0 1px 2px rgba(20, 26, 46, .06) inset; transition: border-color .15s, box-shadow .15s, background .15s;
}
.login input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .15); }
.login button[type=submit] {
    width: 100%; margin-top: 6px; padding: 13px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; font-weight: 700; font-size: 15px;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    box-shadow: 0 10px 22px -8px rgba(13, 71, 161, .7), 0 -2px 0 rgba(0, 0, 0, .15) inset, 0 1px 0 rgba(255, 255, 255, .3) inset;
    transition: transform .12s, box-shadow .12s;
}
.login button[type=submit]:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -8px rgba(13, 71, 161, .75), 0 -2px 0 rgba(0, 0, 0, .15) inset, 0 1px 0 rgba(255, 255, 255, .3) inset; }
.login button[type=submit]:active { transform: translateY(1px); }
.hint { font-size: 13px; color: var(--muted); margin: 18px 0 0; text-align: center; }

/* ---------- Шапка ---------- */
.hero {
    height: 210px;
    background:
        radial-gradient(700px 300px at 15% 0%, rgba(42, 138, 230, .9), transparent 70%),
        radial-gradient(600px 300px at 95% 30%, rgba(79, 179, 246, .55), transparent 70%),
        linear-gradient(160deg, #0b3c8a 0%, #08306f 100%);
    position: relative;
}
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(#000, transparent); }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 18px 16px; position: relative; z-index: 1; }
.hero-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand-light { color: rgba(255, 255, 255, .75); }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: #fff; padding: 7px 16px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
body.app .wrap { margin-top: -130px; position: relative; z-index: 2; }

/* ---------- Профиль ---------- */
.profile { display: grid; grid-template-columns: auto 1fr minmax(280px, 400px); gap: 22px; align-items: center; padding: 26px; margin-bottom: 18px; }
.avatar {
    width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center;
    font-size: 30px; font-weight: 800; color: #fff; letter-spacing: .02em;
    background: linear-gradient(140deg, #4fb3f6 0%, #1565c0 45%, #4fb3f6 100%);
    box-shadow: 0 16px 30px -10px rgba(21, 101, 192, .65), 0 -4px 0 rgba(0, 0, 0, .15) inset, 0 3px 0 rgba(255, 255, 255, .35) inset;
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.kb-name { margin: 2px 0 10px; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text); font-size: 14px; }
.meta-item { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-k { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.chip { background: var(--accent-soft); color: #0b4a94; border: 1px solid #cde3f8; padding: 3px 10px; border-radius: 8px; font-weight: 600; box-shadow: 0 1px 0 #fff inset; }
.profile-links { background: linear-gradient(180deg, #f7f8fd, #f1f3fa); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px rgba(20, 26, 46, .05) inset; }
.links-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.links-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.link-row { display: flex; gap: 8px; margin-top: 6px; }
.link-row input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.copy, .btn {
    padding: 9px 14px; border: 0; border-radius: 10px; cursor: pointer; white-space: nowrap; font-size: 14px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    box-shadow: 0 6px 14px -6px rgba(13, 71, 161, .7), 0 -2px 0 rgba(0, 0, 0, .15) inset; transition: transform .12s;
}
.copy:hover, .btn:hover { transform: translateY(-1px); }
.copy.done { background: linear-gradient(135deg, #16a34a, #0f8a5f); }

/* ---------- Плитки ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--c); opacity: .09; }
.stat-k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-v { font-size: 38px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; letter-spacing: -.03em; color: var(--c); }
.stat-s { font-size: 12.5px; color: var(--muted); }
.stat-blue { --c: #1565c0; } .stat-teal { --c: #2196f3; } .stat-violet { --c: #0b4a94; } .stat-green { --c: #0f8a5f; }

/* ---------- Таблица ---------- */
.board { padding: 8px 0 6px; overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: #f0f2f8; border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 26, 46, .08) inset; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 0 #fff inset, 0 4px 10px -3px rgba(20, 26, 46, .18); }
.count { display: inline-block; min-width: 24px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: #e3e6f0; color: var(--muted); font-size: 12px; text-align: center; }
.tab.active .count { background: var(--accent); color: #fff; }
.search { width: 300px; max-width: 100%; padding: 10px 14px 10px 36px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236a7390' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.search:focus { outline: none; background-color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .12); }
.panel { display: none; }
.panel.active { display: block; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 14px 18px; text-align: left; vertical-align: middle; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.tbl tbody tr { border-bottom: 1px solid #f0f2f7; transition: background .12s; }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8f9ff; }
.c-title { font-weight: 600; }
.sub { display: block; font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 2px; }
.num { font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: 13px; }
.date { display: block; font-weight: 700; }
.time { display: block; font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-work { background: var(--work-soft); color: var(--work); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-fail { background: var(--fail-soft); color: var(--fail); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 46px 20px; color: var(--muted); }
.empty b { color: var(--text); font-size: 16px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; color: var(--accent); background: var(--accent-soft); margin-bottom: 8px; box-shadow: 0 8px 18px -8px rgba(21, 101, 192, .5); }
.foot { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .profile { grid-template-columns: auto 1fr; }
    .profile-links { grid-column: 1 / -1; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .hero { height: 170px; }
    body.app .wrap { margin-top: -100px; }
    .profile { padding: 20px; gap: 14px; }
    .avatar { width: 60px; height: 60px; font-size: 22px; border-radius: 18px; }
    .kb-name { font-size: 22px; }
    .stats { gap: 10px; }
    .stat { padding: 14px 16px; }
    .stat-v { font-size: 30px; }
    .board-head { padding: 12px; }
    .search { width: 100%; }
    .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
    .tbl thead { display: none; }
    .tbl tbody { padding: 8px 12px; }
    .tbl tbody tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 8px 0; box-shadow: var(--shadow-1); background: #fff; }
    .tbl td { padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
    .dt { text-align: right; }
    .c-title { font-size: 15px; }
}

/* ---------- Админка (admin.php) ---------- */
body:not(.app):not(.auth) { background: var(--bg); }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.who { font-size: 18px; font-weight: 700; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 0; font-weight: 600; }
body:not(.app) .wrap { padding-top: 20px; }
.btn { color: #fff; }
.btn-primary { }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, #e5484d, #c2342b); box-shadow: 0 6px 14px -6px rgba(194, 52, 43, .6); }
.login-wrap .login button:not([type=submit]) { width: auto; }
/* Админка */
.admin h2 { font-size: 18px; margin: 30px 0 10px; }
.admin .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.admin .grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.admin label { display: block; font-size: 13px; color: var(--muted); }
.admin input[type=text], .admin input[type=password], .admin textarea {
    display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff;
}
.admin textarea { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.admin .note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.admin .creds { background: var(--ok-soft); border: 1px solid #b7e1c8; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.admin .creds pre { white-space: pre-wrap; background: #fff; border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.admin .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin .actions form { margin: 0; }
.admin .utm { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 7px; margin: 1px 4px 1px 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.admin tr.off td { opacity: .5; }
.admin .topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 640px) { .admin .grid { grid-template-columns: 1fr; } }

/* Админка: ручные записи */
.manual-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 14px; align-items: end; }
.manual-form .full { grid-column: 1 / -1; }
.manual-form select { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin input[type=datetime-local] { display: block; width: 100%; margin-top: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.seg { grid-column: 1 / -1; display: inline-flex; gap: 6px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fc; color: var(--text); font-weight: 600; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: #0b4a94; }
.admin .tbl select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.more { margin-top: 34px; }
.more > summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 10px 0; }
@media (max-width: 640px) { .manual-form { grid-template-columns: 1fr; } }

/* ---------- Админка: навигация и аналитика ---------- */
.admin-nav { display: inline-flex; gap: 4px; padding: 4px; background: #f0f2f8; border-radius: 12px; }
.admin-nav a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 700; text-decoration: none; }
.admin-nav a.on { background: #fff; color: var(--text); box-shadow: 0 4px 10px -3px rgba(20, 26, 46, .18); }
.admin a { color: var(--accent); }
.admin a.btn { color: #fff; text-decoration: none; display: inline-block; }
.filters { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #f7f8fc; color: var(--text) !important; text-decoration: none; font-weight: 600; font-size: 14px; }
.chipbtn.on { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.frm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.frm label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.frm input[type=date], .frm select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.period { font-size: 14px; color: var(--muted); }
.notice-admin { background: #e6f1fc; color: #0b4a94; border: 1px solid #cde3f8; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 14px 0 18px; }
.kpi { background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-3d); }
.kpi-k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; color: var(--text); }
.kpi-s { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-a, .bar-a { background: #1565c0; } .sw-b, .bar-b { background: #0d9488; }
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 200px; margin-top: 12px; border-bottom: 1px solid var(--line); }
.chart .col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; outline: none; }
.chart .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart .bar { width: 40%; max-width: 22px; min-height: 2px; border-radius: 4px 4px 0 0; }
.chart .xl { text-align: center; font-size: 12px; color: var(--muted); padding-top: 6px; position: absolute; bottom: -24px; left: 0; right: 0; }
.chart .tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #141a2e; color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; z-index: 5; }
.chart .col:hover .tip, .chart .col:focus .tip { display: block; }
.chart .col:hover { background: rgba(21, 101, 192, .05); border-radius: 6px; }
.chart-card { padding-bottom: 34px; }
.tbl-scroll { overflow-x: auto; }
.reg-tbl tr.total td { font-weight: 800; border-top: 2px solid var(--line); background: #fafbfd; }
.region { padding: 0; margin-bottom: 10px; }
.region > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.region > summary::-webkit-details-marker { display: none; }
.region > summary::before { content: "▸"; color: var(--accent); font-weight: 800; }
.region[open] > summary::before { content: "▾"; }
.region[open] > summary { border-bottom: 1px solid var(--line); }
.rname { font-weight: 800; font-size: 16px; margin-right: 6px; }
.rstat { font-size: 13.5px; color: var(--muted); }
.rstat b { color: var(--text); }
.region > h3, .region > table, .region > .kbsearch { margin-left: 16px; margin-right: 16px; width: calc(100% - 32px); }
.region > h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 16px; }
.region > table { margin-bottom: 16px; }
.kb-tbl tr.zero td { background: #fff8eb; }
.kb-tbl tr.off td { opacity: .55; }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.st-active { background: var(--ok-soft); color: var(--ok); } .st-pause { background: var(--work-soft); color: var(--work); } .st-gone { background: #eceef3; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.toplist { margin: 10px 0 0; padding-left: 22px; }
.toplist li { padding: 5px 0; border-bottom: 1px solid #f0f2f7; }
.toplist .tv { float: right; font-weight: 700; }
.kbcard .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.analytics h3 { margin: 18px 0 8px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, 1fr); } .two { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, 1fr); } .top-inner { flex-wrap: wrap; } }
.kpi-v, .reg-tbl td:last-child { white-space: nowrap; }
.kpi-v { font-size: clamp(20px, 2vw, 26px); }

/* ---------- Быстрый поиск по блогеру и перевод обращения в договор ---------- */
.kb-finder { padding: 18px 20px; margin-bottom: 18px; }
.finder { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.finder label { flex: 1 1 320px; display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.finder input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; background: #f7f8fc; }
.finder input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .12); }
.kb-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 22px; margin-bottom: 16px; }
.kb-head-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.kb-head-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 14px; }
.kb-head-meta b { color: var(--text); }
.stats.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stats-5 .stat-v { font-size: 32px; }
.type { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.type-lead { background: #e6f1fc; color: #0b4a94; }
.type-deal { background: #ecfdf5; color: #047857; }
.link-rel { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.link-rel:hover { text-decoration: underline; }
.kb-link { color: inherit; text-decoration: none; }
.kb-link:hover b { color: var(--accent); text-decoration: underline; }
tr:target td { background: #fff7d6; transition: background .3s; }
@media (max-width: 900px) {
    .stats.stats-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Список записей в кабинете админа ---------- */
.list-card { padding: 0 !important; overflow: hidden; }
.tbl-manual th { background: #f7f8fc; padding: 12px 16px; }
.tbl-manual td { padding: 14px 16px; vertical-align: middle; }
.tbl-manual th.r { text-align: right; }
.tbl-manual .c-num { width: 70px; white-space: nowrap; }
.tbl-manual .c-kb { min-width: 170px; }
.tbl-manual .c-date { white-space: nowrap; width: 110px; }
.tbl-manual .c-date b { font-weight: 700; }
.tbl-manual .c-status { width: 210px; }
.tbl-manual .c-acts { width: 1%; white-space: nowrap; }
.kb-link { display: block; font-weight: 700; color: var(--text) !important; text-decoration: none; }
.kb-link:hover { color: var(--accent) !important; }
.client-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.client { font-weight: 600; }
.sub.amount { color: var(--text); font-weight: 700; }
.type { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.type-lead { background: #e6f1fc; color: #0b4a94; }
.type-deal { background: #e7f8ef; color: #0f7a52; }
.link-rel { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.link-rel:hover { text-decoration: underline; }

.admin .tbl .st-select { width: 100%; max-width: 200px; padding: 8px 32px 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; appearance: none; -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236a7390' stroke-width='2.5' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.admin .tbl .st-work { background-color: var(--work-soft); color: var(--work); border-color: transparent; }
.admin .tbl .st-ok { background-color: var(--ok-soft); color: var(--ok); border-color: transparent; }
.admin .tbl .st-fail { background-color: var(--fail-soft); color: var(--fail); border-color: transparent; }
.admin .tbl .st-select option { color: var(--text); background: #fff; }

.acts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.acts form { margin: 0; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.act-conv { background: #fff; color: #0f7a52; border: 1.5px solid #9fdcbf; }
.act-conv::before { content: "→"; font-weight: 800; }
.act-conv:hover { background: #e7f8ef; border-color: #0f8a5f; }
.admin a.act-done { background: #e7f8ef; color: #0f7a52; border: 1.5px solid transparent; }
.act-done::before { content: "✓"; }
.act-done:hover { border-color: #9fdcbf; }
.act-del { width: 36px; padding: 0; background: #fff; color: #9aa1b5; border: 1.5px solid var(--line); }
.act-del:hover { color: #c2342b; border-color: #f2b8b5; background: #fff5f5; }

.empty-card { text-align: center; color: var(--muted); padding: 30px !important; }
.admin .btn-light { background: #f1f3f9; color: var(--text); box-shadow: none; border: 1px solid var(--line); }

/* Окно «Перевести в договор» */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(20, 26, 46, .35); color: var(--text); }
.dlg::backdrop { background: rgba(20, 26, 46, .45); backdrop-filter: blur(2px); }
.dlg-body { padding: 22px 24px; display: grid; gap: 16px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-title { font-size: 20px; font-weight: 800; }
.dlg-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dlg-x { border: 0; background: #f1f3f9; width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-grid .full { grid-column: 1 / -1; }
.dlg-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dlg-grid input, .dlg-grid select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; color: var(--text); background: #f7f8fc; box-sizing: border-box; }
.dlg-grid input:focus, .dlg-grid select:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .12); }
.dlg-note { margin: 0; font-size: 13px; color: var(--muted); background: #f7f8fc; border-radius: 10px; padding: 10px 12px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 640px) {
    .dlg-grid { grid-template-columns: 1fr; }
    .tbl-manual .c-status, .tbl-manual .c-date, .tbl-manual .c-acts { width: auto; }
    .acts { justify-content: flex-start; }
}

/* Ровная сетка списка: в каждой ячейке две строки, кнопки в фиксированных слотах */
.tbl-manual { table-layout: fixed; }
.tbl-manual .c-num { width: 64px; }
.tbl-manual .c-kb { width: 22%; min-width: 0; }
.tbl-manual .c-date { width: 120px; }
.tbl-manual .c-status { width: 200px; }
.tbl-manual .c-acts { width: 200px; }
.tbl-manual th:nth-child(1) { width: 64px; }
.tbl-manual td { overflow: hidden; }
.tbl-manual .client { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-manual .kb-link, .tbl-manual .c-kb .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.meta-line > * + *::before { content: "·"; margin-right: 10px; color: #c3c8d6; }
.meta-line .amount { color: var(--text); font-weight: 700; }
.meta-line .link-rel { margin: 0; font-size: 13px; }
.tp { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.tp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tp-lead { color: #1565c0; }
.tp-deal { color: #0f8a5f; }
.admin .tbl .st-select { width: 100%; max-width: none; }
.acts { display: grid; grid-template-columns: 1fr 36px; gap: 10px; align-items: center; }
.act-slot { display: flex; justify-content: flex-end; }
.act-slot .act { width: 100%; }
@media (max-width: 640px) {
    .tbl-manual { table-layout: auto; }
    .tbl-manual .c-kb, .tbl-manual .c-date, .tbl-manual .c-status, .tbl-manual .c-acts, .tbl-manual .c-num { width: auto; }
    .tbl-manual .client { white-space: normal; }
    .acts { grid-template-columns: 1fr 36px; width: 100%; }
}

.tbl-manual .c-kb { width: 19%; }
.tbl-manual .c-status { width: 220px; }
.tbl-manual .c-acts { width: 190px; }
.meta-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-line > * { display: inline; }
.meta-line > * + *::before { margin: 0 8px; }
@media (max-width: 640px) {
    .list-card { background: transparent !important; border: 0 !important; box-shadow: none !important; }
    .tbl-manual tbody { padding: 0; }
    .tbl-manual tbody tr { position: relative; padding: 14px 16px; display: grid; gap: 8px; }
    .tbl-manual td { display: block; padding: 0; text-align: left; width: auto !important; }
    .tbl-manual td::before { display: none; }
    .tbl-manual .c-num { position: absolute; top: 14px; right: 16px; }
    .tbl-manual .c-date { display: flex; justify-content: flex-start; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); padding-right: 60px; }
    .tbl-manual .c-date .sub { margin: 0; }
    .tbl-manual .c-kb { padding-right: 60px; }
    .meta-line { white-space: normal; }
    .acts { grid-template-columns: 1fr 40px; }
}

/* Цвета статусов как в воронке Битрикс24 */
.s-new        { --sc: #0b6fb3; --sb: #e1f1fd; }
.s-work       { --sc: #0a7f9e; --sb: #dcf5fd; }
.s-meeting    { --sc: #a15c00; --sb: #fff0cf; }
.s-no_meeting { --sc: #c2410c; --sb: #ffe6dc; }
.s-decision   { --sc: #b45309; --sb: #ffead1; }
.s-deal, .s-signed { --sc: #566500; --sb: #eef6c4; }
.s-callback   { --sc: #be3a62; --sb: #fde3ea; }
.s-closed     { --sc: #c2342b; --sb: #fde1e0; }
.s-success    { --sc: #377300; --sb: #e2f6c9; }
.badge[class*=" s-"] { background: var(--sb); color: var(--sc); }
.admin .tbl .st-select[class*=" s-"] { background-color: var(--sb); color: var(--sc); border-color: transparent; }

/* Загрузка из Битрикс24 */
.b24-box { padding: 0 !important; }
.b24-box > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.b24-box > summary::-webkit-details-marker { display: none; }
.b24-box > summary::before { content: "▸"; color: var(--muted); }
.b24-box[open] > summary::before { content: "▾"; }
.b24-t { font-weight: 800; font-size: 16px; }
.b24-s { color: var(--muted); font-size: 14px; }
.b24-s b { color: #c2342b; }
.b24-box > *:not(summary) { margin-left: 20px; margin-right: 20px; }
.b24-box > *:last-child { margin-bottom: 18px; }
.b24-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.b24-form input[type=file] { flex: 1 1 280px; padding: 10px; border: 1.5px dashed var(--line); border-radius: 12px; background: #f7f8fc; }
.b24-h { font-size: 15px; margin: 18px 0 4px; }
.b24-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 10px; max-height: 460px; overflow-y: auto; }
.b24-row { display: grid; grid-template-columns: 1fr minmax(260px, 340px) 36px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f0f2f7; }
.b24-row:last-child { border-bottom: 0; }
.b24-info { min-width: 0; }
.b24-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b24-assign { display: flex; gap: 8px; margin: 0; }
.b24-assign input { flex: 1; min-width: 0; margin: 0 !important; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.b24-row > form { margin: 0; }
.b24-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #e1f1fd; color: #0b6fb3; font-size: 11px; font-weight: 800; }
@media (max-width: 640px) { .b24-row { grid-template-columns: 1fr 36px; } .b24-assign { grid-column: 1 / -1; grid-row: 2; } }
.admin .b24-box > .note, .admin .b24-box > .b24-h, .admin .b24-box > .b24-form, .admin .b24-box > .b24-list { margin-left: 20px; margin-right: 20px; }
.admin .b24-box > .note { margin-top: 8px; }
.admin .b24-box > .b24-list { margin-bottom: 18px; }
.tbl-manual .c-num { width: 76px; }
.tbl-manual .b24-tag { display: table; margin: 4px 0 0; }

/* Сортировка и фильтр по статусу */
.list-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: -4px 0 14px; }
.admin .list-tools label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.list-tools select { min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.admin a.reset-link { padding: 9px 4px; font-size: 14px; font-weight: 700; text-decoration: none; }
.admin a.th-sort { color: inherit; text-decoration: none; }
.admin a.th-sort:hover, .admin a.th-sort.on { color: var(--accent); }
.tbl-manual .c-status { width: 245px; }
.admin .tbl .st-select { font-size: 13.5px; padding-right: 28px; text-overflow: ellipsis; }
.tbl-manual .c-kb { width: 18%; }

/* Аналитика: статусы и непривязанные */
.reg-tbl tr.unb td { background: #fff8e6; }
.st-tbl .st-barcol { width: 40%; }
.st-bar { height: 10px; border-radius: 6px; background: #eef0f6; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
@media (max-width: 640px) { .st-tbl .st-barcol { display: none !important; } }

/* Регионы — в виде тех же плиток, что общая статистика */
.reg-blocks { display: grid; gap: 22px; margin-bottom: 28px; }
.reg-block .kpis { margin: 8px 0 0; }
.reg-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.admin .reg-title > a:first-child { color: var(--text); text-decoration: none; font-size: 18px; }
.reg-title > a:first-child b { font-weight: 800; }
.reg-title > a:first-child span { color: var(--muted); font-weight: 600; }
.admin .reg-title > a:first-child:hover b { color: var(--accent); }
.admin a.reg-more { font-size: 14px; font-weight: 700; text-decoration: none; }
.reg-block.hl .kpi { box-shadow: 0 0 0 2px var(--accent), var(--shadow-3d); }
.reg-block.unb .kpi { background: #fff8e6; }

/* Страница региона */
.reg-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 4px 0 6px; }
.reg-page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; flex: 1 1 auto; }
.reg-page-head h1 span { color: var(--muted); font-weight: 700; }
.admin .reg-page-head a.back { font-weight: 700; text-decoration: none; width: 100%; }
.reg-switch select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; max-width: 100%; }
details.region.solo > summary { display: none; }
.admin a.rgo { margin-left: auto; font-size: 13px; font-weight: 700; text-decoration: none; }

/* ---------- Кабинет ответственного и вкладка «Ответственные» ---------- */
.who-sub { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .kpis.kpis-4 { grid-template-columns: repeat(2, 1fr); } }
.staff-tools .grow { flex: 1 1 260px; }
.staff-tools input[type=search] { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; box-sizing: border-box; }
.st-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.st-pill.st-active { background: #e2f6c9; color: #377300; }
.st-pill.st-pause { background: #fff0cf; color: #a15c00; }
.st-pill.st-gone { background: #fde1e0; color: #c2342b; }
.pend { color: #a15c00; font-weight: 700; }
.mono, .tbl-staff code { font-family: ui-monospace, Consolas, monospace; }
.tbl-staff td { vertical-align: middle; }
.act.no-arrow::before { content: none; }
.admin a.back-link { font-weight: 700; text-decoration: none; }
.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .staff-grid { grid-template-columns: 1fr; } }
.staff-grid h2, .notes-card h2 { margin: 0 0 12px; font-size: 18px; }
.acc { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.acc dt { color: var(--muted); font-weight: 600; }
.acc dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.acc code { font-size: 15px; font-weight: 700; }
.msg-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.access-card textarea { width: 100%; box-sizing: border-box; margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fc; font: inherit; font-size: 13.5px; resize: vertical; }
.kb-form { display: grid; gap: 12px; }
.admin .kb-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kb-form input, .kb-form select, .kb-form textarea, .note-form textarea, .staff-add input[type=text] { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f8fc; font: inherit; font-size: 15px; color: var(--text); }
.kb-form input:focus, .kb-form select:focus, .kb-form textarea:focus, .note-form textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .12); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.soc-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.soc-row { display: grid; grid-template-columns: 170px 1fr; gap: 8px; }
@media (max-width: 640px) { .soc-row { grid-template-columns: 1fr; } }
.kb-form > .btn, .new-kb > .btn { justify-self: start; }
.new-kb { max-width: 720px; }
.notes-card { margin-top: 16px; }
.note-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; margin-bottom: 12px; }
@media (max-width: 640px) { .note-form { grid-template-columns: 1fr; } }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes li { padding: 10px 12px; border-radius: 10px; background: #f7f8fc; border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; }
.staff-add { display: grid; gap: 14px; max-width: 900px; }
.admin .staff-add label { font-weight: 600; }
.reg-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.reg-checks .soc-label { width: 100%; }
.admin label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); font-weight: 500; }
.reg-edit summary { cursor: pointer; font-weight: 600; }
.reg-edit form { display: grid; gap: 6px; margin-top: 8px; }
.reg-edit form .btn { justify-self: start; }
.admin .note-form textarea { min-height: 64px; }
.admin .access-card textarea { min-height: 230px; font-family: inherit; }
.staff-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.staff-acts form { margin: 0; }
.staff-add > .btn { justify-self: start; width: auto; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 10px 0; }
.cred-grid pre { margin: 0; }


/* ---------- Фирменный стиль «Бизнес-Юрист» ---------- */
body { font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body.auth {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 64px 64px,
        radial-gradient(900px 500px at 85% 10%, rgba(79, 179, 246, .45), transparent 60%),
        linear-gradient(160deg, #0d58b8 0%, #0a3f8f 55%, #072a63 100%);
}
.login-logo { display: block; width: 190px; max-width: 70%; height: auto; margin: 0 auto 14px; }
.login h1 { text-align: center; }
.login-sub, .login .note { text-align: center; }
.hero {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 56px 56px,
        radial-gradient(700px 320px at 90% 0%, rgba(79, 179, 246, .55), transparent 70%),
        linear-gradient(160deg, #0f5fc4 0%, #0b4596 60%, #08306f 100%);
}
.hero::after { display: none; }
.brand-wrap { display: flex; align-items: center; gap: 14px; }
.hero-logo { height: 52px; width: auto; display: block; }
.brand-light { color: rgba(255, 255, 255, .9); }
/* Шапка админки и кабинета ответственного — синяя, как на сайте компании */
.top { background: linear-gradient(120deg, #0f5fc4 0%, #0b4596 70%, #08306f 100%); border-bottom: 0; box-shadow: 0 6px 20px -10px rgba(8, 48, 111, .6); }
.top .who { color: #fff; display: flex; align-items: center; gap: 12px; }
.top .who-sub { color: rgba(255, 255, 255, .75); }
.top-logo { height: 40px; width: auto; display: block; }
.top .link { color: #fff; }
.top .admin-nav { background: rgba(255, 255, 255, .12); }
.top .admin-nav a { color: rgba(255, 255, 255, .85); }
.top .admin-nav a:hover { color: #fff; }
.top .admin-nav a.on { background: #fff; color: #0b4596; }
.copy, .btn { background: linear-gradient(180deg, #2b9af0, #1565c0); }
.login button[type=submit] { background: linear-gradient(180deg, #2b9af0, #1565c0); }
.btn-light { background: #f1f5fb; color: var(--text); }
.btn-danger { background: linear-gradient(135deg, #e5484d, #c2342b); }
.avatar { background: linear-gradient(140deg, #4fb3f6 0%, #1e88e5 45%, #0b4596 100%); }
.stat-violet { --c: #0b4a94; }
@media (max-width: 640px) {
    .hero-logo { height: 38px; }
    .top-logo { height: 32px; }
    .top .who { font-size: 15px; }
}
.who-t { display: flex; flex-direction: column; line-height: 1.25; }
.top .who-sub { display: block; font-size: 12.5px; }
.top-logo { height: 50px; }
.hero-logo { height: 62px; }
.top-inner { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 640px) {
    .hero-logo { height: 40px; }
    .top-logo { height: 36px; }
    .brand-wrap { gap: 10px; }
    .brand-wrap .brand { font-size: 11px; }
}
.list-card { overflow-x: auto; }
.tbl-staff td:last-child { white-space: nowrap; padding-right: 18px; }

/* ---------- Отчёты, задания, план (wk) ---------- */
.wk h2 { scroll-margin-top: 16px; }
.wk-h1 { font-size: 24px; margin: 6px 0 4px; }
.wk-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 18px 0 8px; padding: 18px 20px; border-radius: var(--radius);
    background: linear-gradient(135deg, #0b4a94, #1565c0 55%, #2b8be0); color: #fff; box-shadow: var(--shadow-3d); }
.wk-total-k { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.wk-total-v { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.wk-total-v span { font-size: 15px; font-weight: 600; opacity: .8; }
.wk-total-s { font-size: 14px; opacity: .95; }
.wk-total-s b { font-size: 18px; }
.wk-track { flex-basis: 100%; height: 10px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.wk-track > div { height: 100%; border-radius: 99px; background: #fff; }
.wk-total.good .wk-track > div { background: #7be3b3; }
.wk-total.warn .wk-track > div { background: #ffd27a; }
.wk-total.bad .wk-track > div { background: #ff9d97; }
.wk-pct { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: 13px; background: #eef1f7; color: var(--muted); }
.wk-pct.good { background: var(--ok-soft); color: var(--ok); }
.wk-pct.warn { background: var(--work-soft); color: var(--work); }
.wk-pct.bad { background: var(--fail-soft); color: var(--fail); }
.wk .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.wk-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.wk-month-nav b { font-size: 18px; }
.wk-plan-in { width: 90px !important; padding: 8px 10px !important; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 700; }
.wk-plan-tbl tfoot td { padding: 14px 18px; border-top: 1px solid var(--line); background: #f8f9fd; }
.wk-weeks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.wk-wk { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.wk-wk.has { color: var(--ok); }
.wk-wk.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.wk-chips-k { font-size: 14px; color: var(--muted); margin-right: 4px; }
.admin a.wk-chip { padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 700; text-decoration: none; }
.admin a.wk-chip.ok { background: var(--ok-soft); color: var(--ok); }
.admin a.wk-chip.no { background: var(--fail-soft); color: var(--fail); }
.wk-fix { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--work-soft); color: var(--work); font-size: 11px; font-weight: 800; cursor: help; }
.wk-cut { max-width: 340px; font-size: 13.5px; }
/* задания */
.wk-tasks { padding: 6px 16px !important; }
.wk-task { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.wk-task:last-of-type { border-bottom: 0; }
.wk-check { display: flex !important; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text) !important; font-size: 15px !important; }
.wk-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ok); flex-shrink: 0; }
.wk-task-title { font-weight: 700; font-size: 15px; }
.wk-task.is-done .wk-task-title { color: var(--muted); text-decoration: line-through; }
.wk-task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 28px; }
.wk-task-text { padding-left: 28px; font-size: 14px; color: var(--text); white-space: pre-wrap; }
.wk-task-c { display: flex; gap: 8px; padding-left: 28px; }
.wk-task-c input { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; }
.wk-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.wk-b-all { background: #e6f1fc; color: #0b4a94; }
.wk-b-reg { background: #efe8fd; color: #5b2fb3; }
.wk-b-own { background: #eef1f7; color: var(--muted); }
.wk-b-late { background: var(--work-soft); color: var(--work); }
.wk-due { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.is-over .wk-due { color: var(--fail); font-weight: 800; }
.wk-own-add { display: flex; gap: 8px; padding: 12px 0 10px; border-top: 1px dashed var(--line); margin-top: 4px; }
.wk-own-add input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.wk-task-new { display: grid; gap: 12px; }
.wk-scope { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.wk-scope-list { display: flex; flex-wrap: wrap; gap: 6px 14px; width: 100%; padding: 10px 12px; border-radius: 12px; background: #f7f8fc; border: 1px solid var(--line); }
.wk-task-adm { padding: 0 !important; }
.wk-task-adm summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.wk-task-adm summary::-webkit-details-marker { display: none; }
.wk-task-adm summary .wk-task-title { flex: 1 1 260px; }
.wk-task-adm > *:not(summary) { margin-left: 16px; margin-right: 16px; }
.wk-task-adm > form { margin-bottom: 14px; }
.wk-task-adm.is-over { border-color: #f3b9b4 !important; }
.wk-st-list { list-style: none; padding: 0; margin: 0 16px 12px; display: grid; gap: 4px; }
.wk-st-list li { padding: 7px 10px; border-radius: 9px; font-size: 14px; }
.wk-st-list li.ok { background: #f0faf5; }
.wk-st-list li.no { background: #fdf3f2; }
.wk-st-list li.ok b { color: var(--ok); }
.wk-st-list li.no b { color: var(--fail); }
.wk-own-list { display: grid; gap: 10px; }
.wk-own-reg ul { margin: 4px 0 0; padding-left: 18px; list-style: none; font-size: 14px; }
.wk-own-reg li.ok { color: var(--muted); }
/* форма отчёта */
.wk-form { display: grid; gap: 14px; }
.wk-form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.wk-sub { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-top: 4px; }
.wk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.admin .wk-field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); align-content: start; }
.wk-field input, .wk-field select, .admin .wk-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; color: var(--text); background: #fff; min-height: 0; }
.wk-field input[type=number] { font-weight: 700; font-size: 17px; }
.wk-auto { padding: 10px; border-radius: 12px; background: #f4f8fe; border: 1px solid #dbe8f7; }
.wk-auto.changed { background: var(--work-soft); border-color: #f0d9a8; }
.wk-hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.admin .wk-why { display: none; font-size: 13px !important; }
.wk-auto.changed .wk-why { display: block; }
.wk-save { display: flex; justify-content: flex-end; }
.wk-rep { display: grid; gap: 10px; }
.wk-rep p { margin: 0; font-size: 14px; }
.wk-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-num { min-width: 110px; padding: 8px 11px; border-radius: 10px; background: #f6f8fc; border: 1px solid var(--line); display: grid; }
.wk-num b { font-size: 20px; }
.wk-num span { font-size: 12px; color: var(--muted); }
.wk-num.changed { background: var(--work-soft); border-color: #f0d9a8; }
.wk-num em { font-size: 12px; color: var(--work); font-style: normal; font-weight: 600; max-width: 260px; }
@media (max-width: 760px) {
    .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wk-total-v { font-size: 26px; }
    .wk-task-c, .wk-own-add { flex-direction: column; }
    .wk-cut { max-width: none; }
}
.admin .wk-month-nav a.btn { color: var(--text); }
/* компактный список заданий */
.wk-tasks { padding: 4px 18px 6px !important; }
.wk-tasks-head { display: flex; align-items: center; gap: 12px; padding: 12px 0 6px; font-size: 14px; color: var(--muted); }
.wk-tasks-head b { color: var(--text); }
.wk-mini { flex: 1; max-width: 260px; height: 7px; border-radius: 99px; background: #eef1f7; overflow: hidden; }
.wk-mini > div { height: 100%; background: var(--ok); border-radius: 99px; }
.wk-grp-h { margin: 12px 0 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.wk-grp-h.late { color: var(--work); }
.wk-tasks .wk-task { display: grid; grid-template-columns: 22px 1fr 34px; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid #f0f2f7; }
.wk-tasks .wk-task:last-child { border-bottom: 0; }
.wk-cb { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--ok); cursor: pointer; }
.wk-tasks .wk-task-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.wk-tasks .wk-task-meta { padding: 0; margin-top: 3px; gap: 4px 12px; }
.wk-tasks .wk-task-text { padding: 0; font-size: 13px; color: var(--muted); }
.wk-cm-show { font-size: 13px; color: var(--text); }
.wk-cm-edit { display: flex; gap: 8px; margin-top: 7px; }
.wk-cm-edit[hidden] { display: none; }
.wk-cm-edit input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; }
.wk-cm-btn { width: 32px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; font-size: 14px; opacity: .7; }
.wk-cm-btn:hover { opacity: 1; border-color: var(--accent); }
.wk-done-grp { margin: 8px 0 4px; border-top: 1px solid var(--line); }
.wk-done-grp summary { padding: 10px 0; cursor: pointer; font-size: 13px; font-weight: 800; color: var(--ok); list-style: none; }
.wk-done-grp summary::-webkit-details-marker { display: none; }
.wk-done-grp .wk-task-title { color: var(--muted); text-decoration: line-through; font-weight: 500; }
@media (max-width: 760px) { .wk-cm-edit { flex-direction: column; } }
/* ---------- Карточки заданий ---------- */
.tk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 8px 0 6px; }
.tk-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 210px; padding: 18px 18px 16px; border-radius: 22px; background: #fff;
    border: 1px solid #e7eaf3; box-shadow: 0 1px 0 #fff inset, 0 10px 26px -14px rgba(31, 41, 90, .28); transition: transform .15s, box-shadow .15s; }
.tk-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 #fff inset, 0 18px 34px -16px rgba(31, 41, 90, .35); }
.tk-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tk-emo { font-size: 22px; line-height: 1; min-height: 22px; }
.tk-dots { display: inline-block; width: 14px; height: 10px; background: radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 0 / 7px 5px; opacity: .55; }
.tk-num { font-size: 26px; font-weight: 300; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.tk-title { margin-top: auto; font-size: 16px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; color: var(--text); }
.tk-text { font-size: 13px; line-height: 1.45; color: var(--muted); }
.tk-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tk-due { color: var(--accent); }
.is-over .tk-due { color: var(--fail); font-weight: 800; }
.tk-cm-show { font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 12px; background: #f4f6fb; color: var(--text); }
.tk-cm { display: grid; gap: 8px; }
.tk-cm[hidden] { display: none; }
.admin .tk-cm textarea { min-height: 64px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 14px; resize: vertical; }
.tk-foot { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.tk-btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s; }
.tk-btn:hover { border-color: var(--accent); }
.tk-ok { flex: 1; background: var(--text); border-color: var(--text); color: #fff; }
.tk-ok:hover { background: var(--accent); border-color: var(--accent); }
.tk-save { background: var(--accent); border-color: var(--accent); color: #fff; }
.tk-undo { flex: 1; color: var(--muted); }
.tk-cm-btn { width: 40px; height: 38px; padding: 0; flex: none; }
.tk-card.is-done { background: #f3fbf7; border-color: #cdeedd; box-shadow: none; }
.tk-card.is-done .tk-title { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.tk-card.is-done .tk-num { color: var(--ok); font-weight: 700; }
.tk-card.is-over:not(.accent) { border-color: #f3b9b4; }
/* акцентная карточка */
.tk-card.accent { background: linear-gradient(150deg, #0b4a94 0%, #1565c0 55%, #4fb3f6 130%); border-color: transparent; color: #fff;
    box-shadow: 0 18px 40px -18px rgba(21, 101, 192, .65); }
.tk-card.accent .tk-num, .tk-card.accent .tk-title { color: #fff; }
.tk-card.accent .tk-text, .tk-card.accent .tk-meta, .tk-card.accent .tk-due { color: rgba(255, 255, 255, .82); }
.tk-card.accent .tk-cm-show { background: rgba(255, 255, 255, .14); color: #fff; }
.tk-card.accent .tk-btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.tk-card.accent .tk-ok { background: #fff; border-color: #fff; color: #0b4a94; }
.tk-card.accent .tk-dots { color: #fff; }
.tk-card.accent .tk-bar { background: rgba(255, 255, 255, .22); }
.tk-card.accent .tk-bar > div { background: #fff; }
.tk-card.accent .tk-regs summary { color: #fff; }
.tk-card.accent .wk-st-list li { color: var(--text); }
/* админка: прогресс и регионы */
.tk-prog { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tk-bar { flex: 1; height: 7px; border-radius: 99px; background: #eef1f7; overflow: hidden; }
.tk-bar > div { height: 100%; border-radius: 99px; background: var(--ok); }
.tk-regs summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); list-style: none; }
.tk-regs summary::-webkit-details-marker { display: none; }
.tk-regs summary::after { content: ' ▾'; }
.tk-regs[open] summary::after { content: ' ▴'; }
.tk-regs .wk-st-list { margin: 8px 0 10px; }
.tk-regs form { margin: 0; }
.tk-state { flex: 1; font-size: 13px; font-weight: 800; color: var(--muted); }
.tk-state.ok { color: var(--ok); }
.tk-card.accent .tk-state { color: #fff; }
.tk-when { font-size: 12px; color: var(--muted); }
.tk-wrap .wk-own-add { margin-top: 12px; border-top: 0; padding: 12px 14px !important; }
.wk-done-grp summary span { font-weight: 600; color: var(--muted); }
@media (max-width: 980px) { .tk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tk-grid { grid-template-columns: 1fr; } .tk-card { min-height: 0; } .tk-title { margin-top: 6px; } }
.tk-wrap .wk-grp-h { margin: 22px 0 4px; font-size: 12px; }
.tk-wrap .wk-tasks-head { padding-top: 4px; }
/* ---------- Форма отчёта: разделы в рамках ---------- */
.wk-form { gap: 16px; }
.wk-form-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 18px; }
.rp-sec { border: 1.5px solid #dde3ef; border-radius: 18px; padding: 16px; background: #fbfcfe; }
.rp-sec.rp-auto { border-color: #c9dcf3; background: #f5f9fe; }
.rp-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.rp-h b { display: block; font-size: 16px; color: var(--text); }
.rp-h span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.rp-i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff !important; font-weight: 800; font-size: 14px; margin: 0 !important; }
.rp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.rp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e3e8f2; border-radius: 14px; background: #fff; }
.admin .rp-l { display: flex; align-items: flex-end; min-height: 2.6em; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.rp-grid-2 .rp-l { min-height: 0; }
.rp-in { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid #d5dcea; border-radius: 12px; font: inherit; font-size: 20px; font-weight: 800; color: var(--text); background: #fff; }
.rp-in:focus, .admin .rp-ta:focus, .admin .rp-why:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 101, 192, .12); }
.admin .rp-ta { width: 100%; min-height: 140px; padding: 12px 14px; border: 1.5px solid #d5dcea; border-radius: 12px; font: inherit; font-size: 14.5px; line-height: 1.55; color: var(--text); resize: vertical; }
.rp-hint { font-size: 12.5px; color: var(--muted); }
.admin .rp-why { min-height: 64px; padding: 9px 11px; border: 1.5px solid #f0d9a8; border-radius: 10px; font: inherit; font-size: 13.5px; resize: vertical; }
.rp-box.wk-auto { background: #fff; border-color: #dbe8f7; }
.rp-box.wk-auto.changed { background: #fffaf0; border-color: #f0d9a8; }
.wk-save { padding-top: 4px; }
.wk-save .btn { padding: 12px 26px; font-size: 15px; }
@media (max-width: 900px) { .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rp-grid, .rp-grid-2 { grid-template-columns: 1fr; } .admin .rp-l { min-height: 0; } .rp-sec { padding: 12px; } }
.rp-h .rp-i { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 0; font-size: 14px; line-height: 1; color: #fff; }
.rp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .rp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rp-grid-3 { grid-template-columns: 1fr; } }
