:root {
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc;
  --brand: #1d4ed8; --brand2: #0ea5e9; --ok: #059669; --warn: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Lato", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

.top { background: #0b1220; color: #fff; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 900; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand2)); font-size: 14px; }
.link { background: none; border: 0; color: #cbd5e1; font: inherit; cursor: pointer; margin-left: 18px; }
.link:hover { color: #fff; }

.hero { background: linear-gradient(180deg, #0b1220 0%, #13213f 100%); color: #fff; padding: 46px 0 34px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 40px); font-weight: 900; }
.sub { margin: 0 0 22px; color: #cbd5e1; }
.search { display: flex; gap: 10px; background: #fff; padding: 8px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.q { flex: 1; border: 0; font: inherit; font-size: 18px; padding: 10px 12px; outline: none; min-width: 0; }
.btn { font: inherit; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #94a3b8; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: #1e40af; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.advanced { margin-top: 14px; color: #cbd5e1; }
.advanced summary { cursor: pointer; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.adv-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.adv-grid input, .adv-grid select { font: inherit; padding: 9px 10px; border-radius: 9px; border: 1px solid #334155; background: #0f1a33; color: #fff; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #e2e8f0; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: rgba(255,255,255,.2); }

main { padding: 22px 20px 50px; }
.status { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.status.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.spinner { width: 18px; height: 18px; border: 3px solid #cbd5e1; border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 6px; background: #e2e8f0; border-radius: 9px; overflow: hidden; flex: 1; max-width: 260px; }
.bar > i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .3s; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.filter { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 220px; }
.spacer { flex: 1; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 70vh; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { position: sticky; top: 0; background: #f1f5f9; text-align: left; padding: 10px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); z-index: 1; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: #f8fafc; }
td .name { font-weight: 700; }
td .op { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.soc a { display: inline-block; margin: 0 4px 4px 0; padding: 2px 7px; border-radius: 6px; background: #f1f5f9; text-decoration: none; font-size: 12px; }
.pending { color: var(--muted); font-style: italic; font-size: 12px; }
.none { color: #cbd5e1; }
.attrib { color: var(--muted); font-size: 12px; margin-top: 10px; }

.empty .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card p { color: var(--muted); margin: 6px 0 0; }

dialog { border: 0; border-radius: 14px; max-width: 620px; padding: 22px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(15,23,42,.55); }
dialog li { margin-bottom: 8px; line-height: 1.5; }

@media (max-width: 640px) {
  .search { flex-direction: column; }
  .q { font-size: 16px; }
}

.datainfo { margin: -12px 0 18px; color: #93c5fd; font-size: 13px; }
.filter.small { min-width: 0; width: 180px; }
.ok { color: var(--ok); font-weight: 900; }
.bad { color: #b91c1c; background: #fee2e2; border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.src { color: #94a3b8; font-size: 11px; margin-top: 2px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }
label.btn { display: inline-flex; align-items: center; }

tr.inlist td { opacity: .45; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 10px 0; }
