:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #171717;
  --text-2: #404040;
  --muted: #737373;
  --faint: #a3a3a3;
  --green: #368732;
  --green-hover: #2c6b2a;
  --green-text: #2c6b2a;
  --green-soft: #f4faf3;
  --green-soft-2: #e3f6e2;
  --green-line: #c9ebc7;
  --green-dot: #4bb047;
  --green-bar: #6cc167;
  --amber: #f7ab3b;
  --amber-text: #b45309;
  --amber-soft: #fffbeb;
  --amber-line: #fde68a;
  --red: #dc2626;
  --red-bar: #ef4444;
  --red-soft: #fef2f2;
  --red-line: #fecaca;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --container: 1200px;
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
[x-cloak] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding: 20px 0 48px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.topbar .container { display: flex; align-items: center; height: 66px; gap: 28px; }
.logo { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 2px; }
.logo b { color: var(--green); }
.nav { display: flex; gap: 22px; height: 100%; }
.nav a { display: flex; align-items: center; height: 100%; padding: 4px 4px 0; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--green); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.pill-status { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--green-line); background: var(--green-soft); color: var(--green-text); }
.pill-status.bad { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.pill-status.warn { border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber-text); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); background: none; border: 0; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.user { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--green-bar), var(--green)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.burger { display: none; }

.crumbs { background: var(--surface); border-bottom: 1px solid var(--border); }
.crumbs .container { display: flex; align-items: center; gap: 12px; height: 38px; font-size: 12px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .current { color: var(--green-text); font-weight: 600; }

.footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer .container { display: flex; justify-content: space-between; align-items: center; height: 56px; font-size: 12px; color: var(--muted); }
.footer a { color: var(--green); }

.logo .eye { display: inline-block; width: 17px; height: 17px; margin: 0 1px; border-radius: 50%; border: 3.5px solid var(--text); position: relative; top: 2px; }
.logo .eye::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(54, 135, 50, 0.25); }
.btn.primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn.soft { background: var(--green-soft); border-color: var(--green-line); color: var(--green-text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red-line); background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: var(--bg); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 600; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 20px; }
.card-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft-2); color: var(--green); flex: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 20px; flex-wrap: wrap; }
.page-head:first-child { margin-top: 8px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 20px; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat .ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat .ico.green { background: var(--green-soft-2); color: var(--green); }
.stat .ico.gray { background: #f5f5f5; color: var(--muted); }
.stat .ico.red { background: var(--red-soft); color: var(--red); }
.stat .label { color: var(--muted); }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 2px; line-height: 36px; }
.stat .value svg { width: 34px; height: 34px; stroke: var(--green); stroke-width: 2; }
.stat .value.bad { color: var(--red); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; background: var(--green-soft); color: var(--green-text); border: 1px solid transparent; white-space: nowrap; }
.badge.gray { background: #f5f5f5; color: var(--text-2); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.outline { background: var(--surface); border-color: var(--border); color: var(--text-2); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.req { color: var(--red); }
.hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(54, 135, 50, 0.12); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(54, 135, 50, 0.12); }
.input-group .addon { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); }
.input-group .addon select { border: 0; background: transparent; outline: none; color: var(--text-2); font-size: 13px; cursor: pointer; }
.input-group .input { border: 0; box-shadow: none; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); flex: none; cursor: pointer; }
.check b { font-weight: 500; display: block; }
.check span { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-text); }
.alert.ok { background: var(--green-soft); border-color: var(--green-line); color: var(--green-text); }
.alert.bad { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.alert.info { background: #f5f8ff; border-color: #dbe5ff; color: #1e40af; }
.errors { margin: 0 0 16px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link-row { cursor: pointer; }
.table tr.link-row:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--mono); font-size: 12px; }
.table-wrap { overflow-x: auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 40px; height: 40px; border-radius: 12px; background: #f5f5f5; display: grid; place-items: center; margin: 0 auto 10px; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.section-title h2 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title h2 svg { color: var(--green); width: 22px; height: 22px; }
.section-title .meta { color: var(--muted); }
.favs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fav { padding: 16px 18px; display: block; transition: border-color .15s; }
.fav:hover { border-color: var(--green-line); }
.fav-top { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 15px; overflow: hidden; }
.fav-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-state { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--green-soft-2); color: var(--green); flex: none; }
.fav-state.down { background: var(--red-soft); color: var(--red); }
.fav-state.warn { background: var(--amber-soft); color: var(--amber-text); }
.fav-bottom { display: flex; justify-content: space-between; padding-top: 10px; font-size: 13px; color: var(--muted); }
.fav-bottom b { color: var(--green-text); font-weight: 600; }
.fav-bottom b.bad { color: var(--red); }

.toolbar { display: flex; gap: 12px; padding: 14px 16px; align-items: center; }
.search { flex: 1; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 42px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { background: #f0f0f0; }
.chip.on { background: var(--green-soft); border-color: var(--green-line); color: var(--green-text); }
.chip .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; }
.menu a, .menu button, .menu label { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13px; color: var(--text-2); }
.menu a:hover, .menu button:hover, .menu label:hover { background: var(--bg); color: var(--text); }
.menu .danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }

.project { margin-top: 16px; overflow: visible; }
.project-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.project-head .folder { width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft-2); color: var(--green); display: grid; place-items: center; flex: none; }
.project-head h3 { font-size: 17px; font-weight: 600; }
.project-head .sub { color: var(--muted); font-size: 13px; }
.project-head .tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.project-head .tags .badge { height: 26px; }
.square-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.square-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chev { transition: transform .2s; }
.collapsed .chev { transform: rotate(180deg); }
.rows { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.row:hover { background: var(--surface-2); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green-dot); flex: none; position: relative; }
.status-dot.down { background: var(--red); }
.status-dot.down::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red); opacity: .5; animation: ping 1.6s infinite; }
.status-dot.warn { background: var(--amber); }
.status-dot.pending { background: var(--border-strong); }
.status-dot.paused { background: var(--faint); }
@keyframes ping { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.8); opacity: 0; } }
.row-main { min-width: 0; flex: 1; }
.row-title { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; }
.row-title a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title a:hover { color: var(--green-text); }
.flag { font-size: 13px; line-height: 1; }
.row-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.row-meta .fresh { color: var(--green-text); }
.row-meta .stale { color: var(--amber-text); }
.row-meta .err { color: var(--red); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.bars { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.bars i { width: 6px; border-radius: 2px; background: var(--green-bar); }
.bars i.fail { background: var(--red-bar); }
.bars i.warn { background: var(--amber); }
.bars i.nodata, .bars i.blank { background: #e5e5e5; }
.pct { width: 64px; text-align: right; font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.pct.bad { color: var(--red); }
.row-actions { display: flex; align-items: center; gap: 4px; }
.row-actions .icon-btn.on { color: var(--green); }
.row-actions .icon-btn.pause { color: var(--amber); }
.row-actions .icon-btn.resume { color: var(--green); }
.row.is-paused { opacity: .6; }
.hidden-by-filter { display: none !important; }

.flag-ico { display: inline-block; width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: none; background: #e5e5e5; }
.flag-ru { background: linear-gradient(#fff 33.3%, #1c57a7 33.3% 66.6%, #d52b1e 66.6%); }
.flag-by { background: linear-gradient(#c8313e 66.6%, #4aa657 66.6%); }
.flag-kz { background: #00afca; }
.flag-nl { background: linear-gradient(#ae1c28 33.3%, #fff 33.3% 66.6%, #21468b 66.6%); }
.flag-de { background: linear-gradient(#000 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%); }
.flag-fi { background: linear-gradient(90deg, transparent 30%, #003580 30% 45%, transparent 45%), linear-gradient(#fff 40%, #003580 40% 60%, #fff 60%); }
.flag-tr { background: #e30a17; }
.flag-es { background: linear-gradient(#aa151b 25%, #f1bf00 25% 75%, #aa151b 75%); }
