:root {
  /* Paleta Labbo (labbo.com.br) */
  --labbo-black: #121212;
  --labbo-ink-2: #1f1f1f;
  --labbo-ink-3: #262626;
  --labbo-blue: #0058ff;
  --labbo-cyan: #04a5ff;
  --labbo-grad: linear-gradient(90deg, #015cf1 0%, #01b7f1 100%);

  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #121212;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --soft: #f0f0f0;
  --brand: var(--labbo-blue);
  --brand-soft: #e6eeff;
  --err: #d92d20;
  --err-bg: #fdecea;
  --warn: #b25e00;
  --warn-bg: #fff3e0;
  --note: #0058ff;
  --note-bg: #e6eeff;
  --ok: #12805c;
  --ok-bg: #e3f5ed;
  --radius: 12px;
  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --display: 'Space Grotesk', 'Instrument Sans', system-ui, sans-serif;
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, .card .big, .ring b { font-family: var(--display); letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--labbo-cyan); outline-offset: 2px; }

/* ── Topo ── */
.top {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--labbo-black); color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--labbo-grad); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { display: block; height: 22px; width: auto; }
.brand-tag {
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; border: 1px solid #404040; color: #e8e8e8;
}
.new { display: flex; gap: 8px; flex: 1; max-width: 720px; position: relative; }
.new input[name=url] {
  flex: 1; padding: 10px 14px; border-radius: 10px; font-size: 15px; min-width: 180px;
  background: var(--labbo-ink-2); color: #fff; border: 1px solid #404040; font-family: inherit;
}
.new input[name=url]::placeholder { color: #8a8a8a; }
.new input[name=url]:focus { outline: none; border-color: var(--labbo-blue); box-shadow: 0 0 0 3px rgba(0,88,255,.3); }
.new button {
  padding: 10px 20px; border-radius: 10px; border: 0; background: var(--labbo-blue); color: #fff; font-weight: 600;
  transition: background .15s;
}
.new button:hover { background: #1a6bff; }
.new button:disabled { opacity: .6; cursor: wait; }
.opts summary {
  list-style: none; padding: 10px 12px; border-radius: 10px; background: var(--labbo-ink-3); border: 1px solid #404040; cursor: pointer; font-size: 14px;
}
.opts summary:hover { border-color: #5a5a5a; }
.opts summary::-webkit-details-marker { display: none; }
.opts-body {
  position: absolute; right: 0; top: 50px; background: var(--panel); color: var(--ink); border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,.22); padding: 14px 16px; display: grid; gap: 10px; width: 300px;
}
.opts-body label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.opts-body input[type=number] { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.opts-body .chk { justify-content: flex-start; }
input[type=checkbox] { accent-color: var(--labbo-blue); }

.user { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 14px; color: #e8e8e8; }
.user[hidden] { display: none; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--labbo-grad); color: #fff;
}
.logout {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px;
  background: transparent; border: 1px solid #404040; color: #e8e8e8; font-size: 13px;
}
.logout:hover { border-color: #b2b2b2; color: #fff; }

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 60px); }
.side { border-right: 1px solid var(--line); padding: 20px 14px; background: #fafafa; }
.side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 6px 10px; }
.audit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.audit-list a {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.audit-list a:hover { background: #fff; border-color: var(--line); }
.audit-list a.active { background: #fff; border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.audit-list .host { font-weight: 600; font-size: 14px; word-break: break-all; }
.audit-list .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-top: 4px; }
.mini-bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--labbo-grad); transition: width .4s; }

.main { padding: 24px 32px 60px; min-width: 0; }
.empty { max-width: 620px; margin: 10vh auto; text-align: center; color: var(--muted); }
.empty h1 { color: var(--ink); font-size: 26px; }

/* ── Cabeçalho do relatório ── */
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.report-head h1 { margin: 0; font-size: 22px; word-break: break-all; }
.report-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 8px; }
.btn {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 14px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn.danger { color: var(--err); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.badge.running, .badge.queued { background: var(--note-bg); color: var(--note); }
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.failed { background: var(--err-bg); color: var(--err); }
.badge.canceled { background: #eee; color: var(--muted); }

/* ── Progresso ── */
.progress { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.progress .row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--labbo-grad); transition: width .5s; }
.bar.indet span { width: 30% !important; animation: indet 1.4s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.steps { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.steps span { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.steps span.on { background: var(--brand); color: #fff; }
.steps span.done { background: var(--ok-bg); color: var(--ok); }

/* ── Cartões de resumo ── */
.cards { display: grid; grid-template-columns: 200px repeat(3, 1fr) 1.4fr; gap: 14px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card .big { font-size: 34px; font-weight: 750; line-height: 1; }
.card small { color: var(--muted); font-size: 12px; }
.card.err .big { color: var(--err); }
.card.warn .big { color: var(--warn); }
.card.note .big { color: var(--note); }
.health { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c, var(--ok)) calc(var(--p) * 1%), var(--line) 0); }
.ring b { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 20px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ── Abas ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs button:hover { color: var(--ink); }
.tabs .n { font-size: 11px; background: var(--soft); border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.tabs .n.e { background: var(--err-bg); color: var(--err); }

.filters { display: flex; gap: 6px; margin-bottom: 12px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.filters button.on { border-color: var(--labbo-black); background: var(--labbo-black); color: #fff; }

/* ── Lista de problemas ── */
.issues { display: grid; gap: 8px; }
.issue { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.issue > button {
  width: 100%; display: grid; grid-template-columns: 92px 1fr auto auto; gap: 14px; align-items: center;
  padding: 12px 16px; background: none; border: 0; text-align: left;
}
.issue > button:hover { background: #fafbff; }
.lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; text-align: center; }
.lvl.error { background: var(--err-bg); color: var(--err); }
.lvl.warning { background: var(--warn-bg); color: var(--warn); }
.lvl.notice { background: var(--note-bg); color: var(--note); }
.issue .t { font-weight: 600; font-size: 14px; }
.issue .cat { font-size: 12px; color: var(--muted); }
.issue .count { font-variant-numeric: tabular-nums; font-weight: 700; }
.issue .chev { color: var(--muted); transition: transform .2s; }
.issue.open .chev { transform: rotate(90deg); }
.issue .body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line); }
.issue.open .body { display: block; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 13px; padding: 14px 0; color: #404040; }
.help h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 8px 10px; border-bottom: 1px solid var(--soft); vertical-align: top; }
td.url { font-family: var(--mono); font-size: 12px; word-break: break-all; }
td.url a { color: var(--ink); text-decoration: none; }
td.url a:hover { text-decoration: underline; }
td.val { color: #404040; word-break: break-word; }
.more { margin-top: 10px; }
.status { font-family: var(--mono); font-weight: 600; }
.status.s2 { color: var(--ok); } .status.s3 { color: var(--note); } .status.s4, .status.s5, .status.s0 { color: var(--err); }

.search { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 320px; max-width: 100%; margin-bottom: 12px; font: inherit; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }
.error-box { background: var(--err-bg); color: var(--err); padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; }
.ok-box { background: var(--ok-bg); color: var(--ok); padding: 18px; border-radius: var(--radius); text-align: center; }

/* ── Modal de página ── */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(820px, 94vw); max-height: 86vh; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(18,18,18,.55); backdrop-filter: blur(2px); }
dialog .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
dialog .dh h3 { margin: 0; font-size: 15px; word-break: break-all; font-family: var(--mono); }
dialog .db { padding: 16px 20px; overflow: auto; max-height: calc(86vh - 60px); }
dialog .close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .user-name, .logout span { display: none; }
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 18px; }
  .issue > button { grid-template-columns: 80px 1fr auto; }
  .issue .chev { display: none; }
  .help { grid-template-columns: 1fr; }
}

/* ── Tela de login ── */
.login-page {
  background: var(--labbo-black); color: #fff; min-height: 100vh; position: relative; overflow-x: hidden;
}
.login-glow {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 420px at 85% 15%, rgba(4,165,255,.20), transparent 70%),
    radial-gradient(700px 500px at 10% 100%, rgba(0,88,255,.22), transparent 70%);
}
.login-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.login-wrap {
  position: relative; min-height: 100vh; max-width: 1080px; margin: 0 auto; padding: 48px 24px;
  display: grid; grid-template-columns: 1.1fr 420px; gap: 64px; align-items: center;
}
.login-logo { display: block; height: 28px; width: auto; margin-bottom: 40px; }
.login-intro h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; margin: 0 0 18px; font-weight: 700; }
.login-intro h1 span { background: var(--labbo-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-intro p { color: #b2b2b2; font-size: 16px; line-height: 1.6; margin: 0 0 28px; max-width: 480px; }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 12px; color: #e8e8e8; font-size: 15px; }
.login-points li::before {
  content: ''; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: rgba(0,88,255,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304a5ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid rgba(4,165,255,.35);
}

.login-card {
  background: #fff; color: var(--ink); border-radius: 18px; padding: 32px 30px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
  display: grid; gap: 16px;
}
.login-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login-card-head { margin-bottom: 4px; }
.login-mark {
  display: inline-block; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  padding: 4px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px;
}
.login-card h2 { margin: 0 0 6px; font-size: 24px; }
.login-card-head p { margin: 0; color: var(--muted); font-size: 14px; }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #404040; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #d6d6d6; background: #fafafa;
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:hover { border-color: #b2b2b2; }
.field input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(0,88,255,.14); }
.pass { position: relative; }
.pass input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: #8a8a8a; display: grid; place-items: center;
}
.pass-toggle:hover, .pass-toggle.on { color: var(--brand); background: var(--brand-soft); }
.caps { font-size: 12px; color: var(--warn); margin-top: -8px; }
.caps[hidden], .login-error[hidden] { display: none; }

.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #404040; cursor: pointer; user-select: none; }
.remember input { width: 16px; height: 16px; margin: 0; }

.login-btn {
  position: relative; margin-top: 4px; padding: 13px 18px; border-radius: 10px; border: 0;
  background: var(--labbo-blue); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 20px rgba(0,88,255,.3); transition: background .15s, transform .1s, box-shadow .15s;
}
.login-btn:hover { background: #1a6bff; box-shadow: 0 10px 26px rgba(0,88,255,.4); }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { cursor: wait; opacity: .85; }
.login-btn .spin {
  display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.login-btn.loading .lbl { visibility: hidden; }
.login-btn.loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-error {
  display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px;
  background: var(--err-bg); color: var(--err); font-size: 14px; border: 1px solid #f7c9c4;
}
.login-foot { margin: 4px 0 0; text-align: center; font-size: 12px; color: #8a8a8a; }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; gap: 32px; max-width: 460px; padding: 32px 16px; align-content: center; }
  .login-intro p, .login-points { display: none; }
  .login-logo { margin-bottom: 24px; }
  .login-intro h1 { font-size: 28px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .login-card.shake, .login-btn .spin { animation: none; }
}
