/* ============================================================
   NULLGRID · Exposure Intelligence — design system
   Tema escuro minimalista: uma cor de destaque, bordas finas,
   tipografia sóbria. Sem gradientes, sem decoração desnecessária.
   ============================================================ */

:root {
  --bg: #0a0b0d;
  --surface: #101216;
  --surface-2: #14171c;
  --surface-3: #1a1e25;
  --border: #22262e;
  --border-strong: #2e333d;

  --text: #e8eaee;
  --text-mut: #9aa1ad;
  --text-dim: #767f8d;

  --accent: #34d399;
  --accent-ink: #06231a;
  --accent-dim: rgba(52, 211, 153, 0.09);

  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --info: #7dd3fc;

  --radius: 8px;
  --radius-sm: 6px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --focus-ring: 0 0 0 3px rgba(52, 211, 153, 0.28);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(52, 211, 153, 0.25); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- abas do painel Origem ---------------- */

.panel-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: -20px -20px 0;
  padding: 0 20px;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-mut);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  padding: 11px 14px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.tab:hover { color: var(--text); }

.tab.is-on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px 4px 0 0;
}

/* ---------------- shell: sidebar + conteúdo ---------------- */

.shell { display: flex; min-height: 100vh; }
.maincol { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.sidebar.is-collapsed { width: 62px; }
.sidebar.is-collapsed .sb-brand-name,
.sidebar.is-collapsed .sb-label { display: none; }
.sidebar.is-collapsed .sb-item { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sb-collapse { justify-content: center; padding: 0; }
.sidebar.is-collapsed .sb-collapse .sb-ic svg { transform: scaleX(-1); }

.sb-brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px 14px; color: var(--text); }
.sb-brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-mut);
  font-family: var(--sans); font-size: 13.5px; font-weight: 550;
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.sb-item:hover { color: var(--text); background: var(--surface-3); }
.sb-item.is-on {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(52, 211, 153, 0.22);
  box-shadow: inset 2px 0 0 var(--accent);
}
.sb-item:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.sb-item .sb-ic { display: inline-flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; }

.sb-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-collapse {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  font-family: var(--sans); font-size: 12px; font-weight: 550;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.sb-collapse:hover { color: var(--text); background: var(--surface-3); }
.sb-collapse:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.sb-collapse .sb-ic { display: inline-flex; align-items: center; justify-content: center; width: 16px; flex-shrink: 0; }

.btn-menu { display: none; }
.sb-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 19; }

.reports-shell { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* tablet: rail recolhida por padrão; mobile: drawer */
@media (max-width: 1099px) {
  .sidebar { width: 62px; }
  .sidebar .sb-brand-name,
  .sidebar .sb-label { display: none; }
  .sidebar .sb-item { justify-content: center; padding: 0; }
  .sidebar .sb-collapse { justify-content: center; padding: 0; }
}

@media (max-width: 899px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 240px; height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 30;
  }
  .sidebar.is-open { transform: none; }
  .sidebar .sb-brand-name,
  .sidebar .sb-label { display: inline; }
  .sidebar .sb-item { justify-content: flex-start; padding: 0 10px; }
  .sidebar .sb-collapse { justify-content: flex-start; padding: 0 10px; }
  .sidebar.is-collapsed { width: 240px; }
  .btn-menu { display: inline-flex; }
}

/* ---------------- top bar ---------------- */

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 13, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  max-width: none;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }

.brand-mark {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  align-self: center;
}

.brand-name {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  color: var(--text-dim);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- layout ---------------- */

.wrap {
  max-width: none;
  margin: 0 auto;
  padding: 28px 28px 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-head.split {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.panel-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-mut);
}

/* ---------------- fields ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1; }

.field > label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-mut);
}

.label-note {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: lowercase;
  font-size: 11.5px;
}

.field-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

textarea, input[type="password"], input[type="text"], .select {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
  tab-size: 2;
}

textarea::placeholder, input::placeholder { color: var(--text-dim); }

textarea:focus, input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }

.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }

.key-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.key-status {
  font-size: 12.5px;
  color: var(--text-mut);
}

.key-status.is-ok { color: var(--ok); }
.key-status.is-err { color: var(--err); }

.select {
  font-family: var(--sans);
  font-size: 13px;
  padding: 0 30px 0 12px;
  height: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa1ad' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}

.btn:disabled {
  cursor: not-allowed;
  background: var(--surface-3);
  color: var(--text-dim);
  border-color: var(--border);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover:not(:disabled) { background: #4adea0; }
.btn.primary:active:not(:disabled) { background: #2fbf8c; }

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn.ghost:hover:not(:disabled) { background: var(--surface-3); }

.btn.ghost.danger:hover:not(:disabled) {
  color: var(--err);
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}

.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 5px; }
.btn.square { width: 36px; padding: 0; }

.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.status {
  font-size: 13px;
  color: var(--text-mut);
}

.status.is-err { color: var(--err); }

/* ---------------- toolbar ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------- workspace / empty ---------------- */

.workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: var(--text-dim);
}

.empty-title { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--text-mut); }
.empty-hint { margin: 0; font-size: 13px; max-width: 46ch; color: var(--text-dim); }
.empty-hint strong { color: var(--text-mut); font-weight: 550; }

/* ---------------- pull card ---------------- */

.pull {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.pull-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.pull-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.pull-name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46ch;
}

.badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid;
  flex: none;
}

.badge-csv  { color: var(--info);   border-color: rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.08); }
.badge-json { color: var(--warn);   border-color: rgba(251, 191, 36, 0.35);  background: rgba(251, 191, 36, 0.08); }
.badge-txt  { color: #a3e635;       border-color: rgba(163, 230, 53, 0.35);  background: rgba(163, 230, 53, 0.08); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-mut);
}

.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex: none;
}

.chip.active { color: var(--warn); }
.chip.active .dot { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
.chip.ok { color: var(--ok); }
.chip.ok .dot { background: var(--ok); }
.chip.err { color: var(--err); }
.chip.err .dot { background: var(--err); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pull-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stats {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.pull-controls { display: flex; align-items: center; gap: 6px; }

.pull-error {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--err);
  background: rgba(248, 113, 113, 0.06);
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}

.pull-progress {
  height: 2px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.pull-progress > span {
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--accent);
  opacity: 0.8;
  animation: slide 1.1s linear infinite;
}

@keyframes slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}

.pull-body {
  max-height: 340px;
  overflow: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.pull-body::-webkit-scrollbar { width: 8px; height: 8px; }
.pull-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.pull-body::-webkit-scrollbar-track { background: transparent; }

.line {
  display: grid;
  grid-template-columns: 5ch minmax(0, 1fr);
  gap: 12px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  min-height: 21px;
}

.line .ln {
  color: var(--text-dim);
  text-align: right;
  user-select: none;
  font-size: 11px;
  padding-top: 2px;
}

.line .t {
  color: var(--text-mut);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line:hover { background: rgba(255, 255, 255, 0.02); }
.line.is-last { background: var(--accent-dim); }
.line.is-last .t { color: var(--text); }

.gap-line {
  padding: 4px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--border);
  margin-bottom: 4px;
  user-select: none;
}

.jump {
  position: sticky;
  bottom: 10px;
  display: block;
  width: fit-content;
  margin: 6px 14px 10px auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

/* ---------------- footer ---------------- */

.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}

.foot-count { font-family: var(--mono); }

/* ---------------- origem: modo, checks, fila ---------------- */

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  align-self: flex-start;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-mut);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.seg-btn:hover { color: var(--text); }

.seg-btn.is-on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.seg-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.back-simple {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  margin: 0 0 12px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.back-simple:hover {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.55);
  color: var(--text);
}

.back-simple:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}

.checks-row { align-items: flex-end; }

.field-label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-mut);
}

.checks { display: inline-flex; gap: 14px; height: 36px; align-items: center; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-3);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.check input[type="checkbox"]:checked::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

.check input[type="radio"] {
  border-radius: 50%;
}

.check input[type="radio"]:checked::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
}

.check input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.usage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mut);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}

.usage .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.usage.is-warn .dot { background: var(--warn); }
.usage.is-err .dot { background: var(--err); }
.usage.is-err { color: var(--err); }

.queue-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.queue-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mut);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.queue-list { display: flex; flex-direction: column; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.queue-item:last-child { border-bottom: none; }

.queue-item .q-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.queue-empty {
  padding: 18px 14px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------- chips de estado ---------------- */

.chip.idle { color: var(--text-mut); }
.chip.idle .dot { background: var(--text-dim); }
.chip.process { color: var(--info); }
.chip.process .dot { background: var(--info); }

/* ---------------- linha manual de download ---------------- */

.manual-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.manual-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 10px;
}

.manual-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.retry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.retry-row .status { flex: 1; min-width: 0; }

/* ---------------- cards de seção do domínio ---------------- */

.sec-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.sec-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.sec-card:hover { border-color: var(--accent); }

.sec-card.is-on {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.sec-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sec-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sec-card.is-on .sec-num { color: var(--accent); }

.sec-label {
  font-size: 11px;
  color: var(--text-mut);
}

/* ---------------- tabela de resultados (FASE 3) ---------------- */

.rtable-wrap {
  display: flex;
  flex-direction: column;
}

.rtoolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.rtoolbar .rtfilter {
  flex: 1;
  min-width: 180px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 10px;
}

.rtoolbar .rtfilter:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.rttipo {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  height: 30px;
  padding: 0 26px 0 10px;
  cursor: pointer;
}

.rtcount {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.rtable-scroll {
  overflow-x: auto;
}

.rtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.rtable th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  font-weight: 600;
}

.rtable td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mut);
  vertical-align: middle;
  white-space: nowrap;
}

.rtable tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

.cell-origem {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 12px;
}

.cell-ident {
  font-family: var(--mono);
  font-size: 12px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-pass { font-family: var(--mono); }

.pass-mask { color: var(--text-mut); letter-spacing: 1px; }

.pass-eye { margin-left: 6px; }

.cell-date { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

.date-line { display: block; }
.date-time { opacity: 0.75; }

.cell-status { font-size: 12px; }

.cell-val {
  font-family: var(--mono);
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cell-raw { text-align: right; }

.tipo-badge, .strength-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid;
}

.tipo-email { color: var(--info); border-color: rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.08); }
.tipo-user { color: #a3e635; border-color: rgba(163, 230, 53, 0.35); background: rgba(163, 230, 53, 0.08); }
.tipo-neutro { color: var(--text-mut); border-color: var(--border-strong); background: var(--surface-3); }

.strength-badge.st-0 { color: var(--err); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.strength-badge.st-1 { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.strength-badge.st-2 { color: var(--info); border-color: rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.08); }
.strength-badge.st-3 { color: var(--accent); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }

.cell-actions {
  position: relative;
  text-align: center;
}

.row-menu-btn {
  border: none;
  background: transparent;
  color: var(--text-mut);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.row-menu-btn:hover { background: var(--surface-3); color: var(--text); }
.row-menu-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.row-menu {
  position: fixed;
  z-index: 50;
  min-width: 168px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.row-menu-item:hover { background: var(--surface-2); }
.row-menu-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.raw-row td { padding: 10px 12px; background: var(--surface-2); }

.raw-row pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-mut);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow: auto;
}

.rtable-empty td {
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
}

/* ---------------- resumo de exposição (FASE 4) ---------------- */

.resumo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.resumo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.resumo-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--text-dim);
}

.resumo-approx {
  font-size: 11.5px;
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  background: rgba(251, 191, 36, 0.06);
}

.resumo-main {
  display: flex;
  align-items: baseline;
  gap: 26px;
  flex-wrap: wrap;
}

.resumo-domain {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

.resumo-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.resumo-num {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 650;
  color: var(--accent);
}

.resumo-label {
  font-size: 12px;
  color: var(--text-mut);
}

.resumo-strength,
.resumo-alerts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.strength-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.strength-tab {
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-mut);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 550;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.strength-tab:hover { color: var(--text); }

.strength-tab.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.strength-tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.strength-total {
  font-size: 12px;
  color: var(--text-mut);
}

.strength-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 560px;
}

.strength-row {
  display: grid;
  grid-template-columns: 108px minmax(80px, 1fr) 128px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.strength-label { color: var(--text-mut); }

.strength-bar {
  display: block;
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.strength-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.strength-fill.st-0 { background: var(--err); }
.strength-fill.st-1 { background: var(--warn); }
.strength-fill.st-2 { background: var(--info); }
.strength-fill.st-3 { background: var(--accent); }

.strength-nums {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: right;
}

.strength-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
}

.alerts-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-mut);
  line-height: 1.55;
}

.alerts-list li::marker { color: var(--warn); }

.alerts-none {
  color: var(--text-dim);
  list-style: none;
  margin-left: -18px;
}

@media (max-width: 720px) {
  .strength-row { grid-template-columns: 86px minmax(60px, 1fr) 100px; gap: 8px; }
  .resumo-main { gap: 16px; }
}

/* ---------------- bloco contextual do estado inicial ---------------- */

.context-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctx-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ctx-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-mut);
  max-width: 78ch;
  line-height: 1.55;
}

.ctx-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.ctx-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.ctx-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.ctx-item-desc {
  font-size: 12px;
  color: var(--text-mut);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .ctx-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .ctx-items { grid-template-columns: 1fr; }
}

/* ---------------- gráfico de crescimento ---------------- */

.growth-chart {
  position: relative;
  width: 100%;
}

/* card do gráfico mais compacto (plot sobe junto com os controles) */
#growthSection {
  padding: 14px 20px 14px;
  gap: 10px;
}

.growth-svg {
  display: block;
  width: 100%;
  height: auto;
}

.growth-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.growth-tick {
  fill: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.growth-line {
  stroke-linejoin: round;
  stroke-linecap: round;
}

.growth-hover-line {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.growth-hover-dot {
  stroke: var(--bg);
  stroke-width: 1.5;
}

.growth-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 200px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
}

.growth-tooltip .tt-title {
  display: block;
  color: var(--text-mut);
  font-size: 11px;
  margin-bottom: 4px;
}

.growth-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.75;
}

.growth-tooltip .tt-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.growth-tooltip .tt-progress {
  color: var(--accent);
}

.growth-note {
  margin: 6px 0 0;
  font-size: 11.5px;
}

.growth-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mut);
}

.growth-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.growth-legend .lg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.growth-state {
  margin: 0;
  padding: 26px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------- navegação da pesquisa ---------------- */

.search-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.search-nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-info {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ---------------- resumo do domínio ---------------- */

.domain-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
}

.ds-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.ds-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
}

.ds-num {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.ds-item.is-zero .ds-num { color: var(--text-dim); }

.ds-label {
  font-size: 12px;
  color: var(--text-mut);
}

.ds-detail {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.ds-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-mut);
}

.ds-hint strong { color: var(--warn); }

.search-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(251, 191, 36, 0.06);
  font-size: 12.5px;
  color: var(--text-mut);
}

.search-hint strong { color: var(--warn); }

.search-note {
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.06);
  border-bottom: 1px solid var(--border);
  white-space: pre-line;
}

/* ---------------- estatísticas globais ---------------- */

.stats-hero {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 24px 120px;
  flex-wrap: wrap;
  padding: 30px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stats-main {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stats-big {
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #7bcdd6; /* fallback sólido: ciano frio legível se o degradê não for suportado */
  font-variant-numeric: tabular-nums;
}

/* contador principal: degradê sutil ciano → azul; sem animação, aplicado ao texto inteiro */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .stats-big {
    background: linear-gradient(90deg, #68d5d0 0%, #6f8fea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.stats-big.is-unavailable {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px 0;
  background: none;
  -webkit-text-fill-color: var(--text-dim);
}

.stats-caption {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-mut);
}

.stats-deltas {
  display: flex;
  align-items: baseline;
  gap: 26px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

/* distribui o respiro: o trio hoje/semana/mês avança para a direita, mais perto do "atualizado" */
.stats-deltas .stat-delta:first-child { margin-left: auto; }

.stat-delta {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
}

.stat-delta span {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.stat-fresh {
  margin-left: auto;
  border-left: 1px solid var(--border-strong);
  padding-left: 18px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(232, 234, 238, 0.85);
  white-space: nowrap;
}

/* ---------------- busca simples ---------------- */

.mode-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-mut);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

.mode-btn:hover { color: var(--text); border-color: var(--accent); }

.mode-btn.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.mode-btn-advanced { border-style: dashed; }

.mode-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.simple-hero {
  display: flex;
  gap: 10px;
  max-width: 720px;
}

.simple-hero input {
  flex: 1;
  min-width: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  padding: 13px 16px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.simple-hero input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.simple-hero .btn.primary {
  height: auto;
  padding: 0 22px;
  font-size: 14px;
}

/* spinner discreto no chip de processamento */

.chip.process .dot {
  animation: pulse 1.2s ease-in-out infinite;
}

/* ---------------- fases 5.x: monitoramento, remediação, dark web, relatório ---------------- */

.mon-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mon-toolbar .spacer { flex: 1; }

.mon-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.mon-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mon-item .grow { flex: 1; min-width: 200px; }
.mon-item .mon-title { font-size: 13.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.mon-item .mon-sub { font-size: 12px; color: var(--text-mut); word-break: break-all; }
.mon-item .mon-sub b { color: var(--text); font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
  color: var(--text-mut);
  white-space: nowrap;
}
.badge.is-on { color: var(--accent); border-color: rgba(52, 211, 153, 0.4); background: var(--accent-dim); }
.badge.is-err { color: var(--err); border-color: rgba(248, 113, 113, 0.4); }
.badge.is-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }

.status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty-note { font-size: 13px; color: var(--text-dim); padding: 14px 2px; }

/* linhas de execução (runs) */
.run-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* remediação */
.remed-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.remed-row .ident { font-family: var(--mono); font-size: 13px; color: var(--text); word-break: break-all; flex: 1; min-width: 180px; }
.remed-row .url { font-size: 12px; color: var(--text-mut); word-break: break-all; max-width: 34ch; }
.remed-row select { height: 28px; font-size: 12.5px; border-radius: 5px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); padding: 0 8px; }
.remed-row input.cmt { height: 28px; font-size: 12.5px; border-radius: 5px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); padding: 0 8px; width: 220px; }

/* dark web */
.dark-item { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.dark-item:hover { border-color: var(--accent); }
.dark-item .t { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dark-item .m { font-size: 12px; color: var(--text-mut); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.dark-post-meta { font-size: 12px; color: var(--text-mut); margin: 6px 0 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.dark-post-content {
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0c0e11;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* recência no card de pesquisa */
.recency { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.recency .lbl { font-size: 12px; color: var(--text-mut); }
.recency .chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); font-size: 12.5px; font-weight: 550; cursor: pointer; }
.recency .chip:hover { border-color: var(--accent); }
.recency .chip .num { font-family: var(--mono); color: var(--accent); }
.recency .chip.is-busy { opacity: 0.6; pointer-events: none; }

.estimate { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-mut); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.estimate b { color: var(--warn); font-family: var(--mono); }

/* relatório executivo impresso */
.report-overlay { position: fixed; inset: 0; background: #0a0b0d; z-index: 1000; padding: 34px 38px; overflow: auto; color: #e8eaee; }
.report-overlay .r-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid #2e333d; padding-bottom: 14px; margin-bottom: 18px; }
.report-overlay h1 { font-size: 22px; margin: 0; }
.report-overlay .r-sub { font-size: 12.5px; color: #9aa1ad; }
.report-overlay h2 { font-size: 14px; letter-spacing: 0.08em; color: #9aa1ad; margin: 20px 0 8px; }
.report-overlay .r-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.report-overlay .r-card { border: 1px solid #22262e; border-radius: 6px; padding: 12px 14px; background: #101216; }
.report-overlay .r-card .v { font-family: ui-monospace, monospace; font-size: 20px; color: #68d5d0; }
.report-overlay .r-card .k { font-size: 11px; letter-spacing: 0.08em; color: #767f8d; margin-top: 3px; }
.report-overlay table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-overlay th, .report-overlay td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #22262e; }
.report-overlay th { color: #9aa1ad; font-size: 11.5px; letter-spacing: 0.06em; }
.report-overlay .r-actions { position: sticky; top: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 8px 0; background: #0a0b0d; margin: -12px -14px 0; padding-left: 14px; padding-right: 14px; }
.report-overlay .r-actions .btn { height: 32px; }
@media print {
  body > *:not(.report-overlay) { display: none !important; }
  .report-overlay { position: static; padding: 0; background: #fff; color: #000; }
  .report-overlay .r-actions { display: none !important; }
  .report-overlay .r-card, .report-overlay table, .report-overlay th, .report-overlay td, .report-overlay .r-head { border-color: #ccc; }
  .report-overlay h1, .report-overlay .r-card .v { color: #000; }
  .report-overlay h2, .report-overlay .r-sub, .report-overlay .r-card .k, .report-overlay th { color: #444; }
}

.sb-item .sb-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------------- fase 5.6: exposição de infraestrutura ---------------- */

.infra-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.infra-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer; text-align: left;
  font-family: var(--sans); color: var(--text);
}
.infra-card:hover { border-color: var(--accent); }
.infra-card:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.infra-card-name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.infra-card-desc { font-size: 12px; color: var(--text-mut); line-height: 1.5; }
.infra-card-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; width: 100%; }
.infra-card .num { font-family: var(--mono); font-size: 15px; color: var(--accent); }
.conf {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 4px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em;
  border: 1px solid; white-space: nowrap;
}
.conf-api { color: var(--accent); border-color: rgba(52, 211, 153, 0.4); background: var(--accent-dim); }
.conf-high { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.08); }
.conf-hint { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.infra-detail { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.infra-detail h4 { margin: 14px 0 6px; font-size: 12.5px; color: var(--text-mut); letter-spacing: 0.06em; }
.infra-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.infra-row:last-child { border-bottom: none; }
.infra-row .grow { flex: 1; min-width: 220px; }
.infra-row .mono { font-family: var(--mono); color: var(--text); word-break: break-all; }
.infra-row .sub { font-size: 12px; color: var(--text-mut); }
.infra-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.infra-note { font-size: 12.5px; color: var(--text-mut); margin-top: 8px; line-height: 1.5; }
@media (max-width: 720px) {
  .infra-cats { grid-template-columns: 1fr; }
}

/* ---------------- fase 6.1: login / cadastro ---------------- */

.login-body { background: var(--bg); min-height: 100vh; overflow-x: hidden; }
.login-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% 18%, rgba(52, 211, 153, 0.05) 0%, transparent 60%),
    radial-gradient(800px 520px at 15% 85%, rgba(104, 213, 208, 0.04) 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 64px);
}
.login-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 28px 16px 24px; gap: 14px; }
.login-card {
  width: 100%;
  max-width: 980px;
  min-height: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.login-form { padding: 40px 46px 30px; display: flex; flex-direction: column; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-brand-text { display: flex; flex-direction: column; gap: 2px; }
.login-brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.08em; color: var(--text); }
.login-brand-sub { font-size: 11px; letter-spacing: 0.06em; color: var(--text-dim); text-transform: uppercase; }
.login-title { font-size: 23px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-sub { font-size: 13px; color: var(--text-mut); margin: 0 0 22px; line-height: 1.5; }
.login-form .field { margin-bottom: 14px; }
.login-form label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-mut); margin-bottom: 6px; }
.login-form input {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-form input:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--accent); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-dim); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); color: var(--text); }
.login-error {
  margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.07);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--err); line-height: 1.45;
}
.login-submit { width: 100%; height: 44px; margin-top: 2px; font-size: 14px; }
.login-submit.is-busy { opacity: 0.75; cursor: wait; }
.login-submit.is-busy::before {
  content: ''; width: 13px; height: 13px; margin-right: 8px;
  border: 2px solid rgba(6, 35, 26, 0.35); border-top-color: var(--accent-ink);
  border-radius: 50%; display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-link { background: none; border: none; padding: 0; font-family: var(--sans); font-size: 12.5px; color: var(--accent); cursor: pointer; }
.login-link:hover { text-decoration: underline; }
.login-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }
.login-link.forgot { align-self: flex-end; margin: -6px 0 14px; color: var(--text-mut); }
.login-link.forgot:hover { color: var(--text); }
.login-switch { margin: 18px 0 0; font-size: 12.5px; color: var(--text-mut); text-align: center; }
.login-copy { margin-top: auto; padding-top: 26px; font-size: 11px; color: var(--text-dim); text-align: center; }
.login-card .login-form { transition: opacity 0.18s ease; }

.login-side {
  display: flex; flex-direction: column; justify-content: center;
  padding: 46px 44px;
  background:
    radial-gradient(500px 300px at 80% 10%, rgba(104, 213, 208, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #0d1315 0%, #0a0b0d 100%);
  border-left: 1px solid var(--border);
}
.login-big-wrap { position: relative; margin-bottom: 14px; }
.login-spark { display: block; width: 100%; height: 52px; margin-top: 14px; opacity: 0.8; }
.login-big {
  position: relative;
  font-family: var(--mono);
  font-size: 58px;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #68d5d0 0%, #6f8fea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #7bcdd6;
  word-break: break-all;
}
.login-big-cap { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mut); margin-top: 8px; }
.login-big-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.login-live { margin: 18px 0 22px; font-size: 11.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.login-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.login-feats li { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; position: relative; }
.login-feats li::before {
  content: ''; position: absolute; left: 0; top: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); opacity: 0.7;
}
.login-feats strong { font-size: 13.5px; color: var(--text); font-weight: 600; }
.login-feats span { font-size: 12.5px; color: var(--text-mut); line-height: 1.55; }

@media (max-width: 900px) {
  .login-card { grid-template-columns: 1.15fr 0.85fr; min-height: 560px; }
  .login-form { padding: 34px 32px 26px; }
  .login-side { padding: 36px 30px; }
  .login-big { font-size: 44px; }
}
@media (max-width: 720px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; min-height: 0; }
  .login-side { border-left: none; border-top: 1px solid var(--border); padding: 26px 26px 30px; order: 2; }
  .login-form { padding: 28px 24px 22px; order: 1; }
  .login-big { font-size: 38px; }
  .login-feats { gap: 12px; }
}


/* ---------------- fase 6.3: planos / checkout / financeiro ---------------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 6px; }
.plan-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); min-height: 190px;
}
.plan-card:hover { border-color: var(--accent); }
.plan-card .plan-name { font-size: 14px; font-weight: 650; color: var(--text); }
.plan-card .plan-price { font-family: var(--mono); font-size: 20px; font-weight: 650; color: var(--accent); }
.plan-card .plan-price small { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.plan-card ul { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-card li { font-size: 12.5px; color: var(--text-mut); }
.plan-card li b { color: var(--text); font-family: var(--mono); }
.plan-card .plan-cta { margin-top: auto; }
.coin-btns { display: flex; gap: 8px; margin: 10px 0; }
.coin-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px;
  background: var(--surface-3); color: var(--text-mut); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-family: var(--mono); font-size: 13px; font-weight: 600; cursor: pointer;
}
.coin-btn.is-on { color: var(--accent); border-color: rgba(52, 211, 153, 0.5); background: var(--accent-dim); }
.order-box {
  padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #0c0e11; font-family: var(--mono); font-size: 13px; margin: 10px 0;
}
.order-box .addr { color: var(--text); word-break: break-all; }
.order-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.paywall-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.paywall-card { max-width: 440px; width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 26px; }
.paywall-card h3 { margin: 0 0 8px; font-size: 17px; }
.paywall-card p { margin: 0 0 18px; font-size: 13px; color: var(--text-mut); line-height: 1.55; }
.paywall-actions { display: flex; gap: 10px; justify-content: flex-end; }
.trial-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin: 0 0 14px; padding: 12px 16px;
  border: 1px solid rgba(104, 213, 208, 0.35); background: rgba(104, 213, 208, 0.06);
  border-radius: var(--radius-sm);
}
.trial-banner .tb-main { flex: 1; min-width: 240px; }
.trial-banner .tb-title { font-size: 13px; font-weight: 650; color: #7dd3fc; letter-spacing: 0.03em; margin-bottom: 3px; }
.trial-banner .tb-text { font-size: 12.5px; color: var(--text-mut); line-height: 1.55; }
.trial-banner .tb-left { font-family: var(--mono); font-size: 13px; color: var(--text); }
.trial-banner.is-over { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.trial-banner.is-over .tb-title { color: var(--warn); }
.wallet-card { border-color: rgba(104, 213, 208, 0.25); }
.wallet-card .demo-tag { font-size: 9.5px; letter-spacing: 0.1em; color: var(--warn); }

/* ---------------- fase 6.0: admin / créditos ---------------- */

.credits-chip { display: inline-flex; align-items: stretch; gap: 0; font-size: 12px; color: var(--text-mut); }
.credits-chip .seg-credit { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 0 12px; border-left: 1px solid var(--border-strong); }
.credits-chip .seg-credit:first-child { border-left: none; padding-left: 0; }
.credits-chip .k { font-size: 9.5px; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; }
.credits-chip .v { font-family: var(--mono); font-size: 12.5px; color: var(--text); font-weight: 600; }
.sb-user { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sb-user-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-dim); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
}
.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-mail { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 6px 8px;
  color: var(--text-mut); font-family: var(--sans); font-size: 12px;
  cursor: pointer; border-radius: 4px; text-align: left;
}
.sb-logout:hover { color: var(--text); background: var(--surface-3); }
.sb-logout:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sidebar.is-collapsed .sb-user-name, .sidebar.is-collapsed .sb-user-mail { display: none; }
.sidebar.is-collapsed .sb-user-top { justify-content: center; }
.sidebar.is-collapsed .sb-logout { justify-content: center; }
.banner-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.banner-pending .bp-main { flex: 1; min-width: 240px; }
.banner-pending .bp-title { font-size: 13px; font-weight: 650; color: var(--warn); margin-bottom: 2px; letter-spacing: 0.02em; }
.banner-pending .bp-text { font-size: 12px; color: var(--text-mut); line-height: 1.5; }
.banner-pending .bp-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-mut); }
.banner-pending .bp-stats b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-mut); font-size: 11.5px; letter-spacing: 0.05em; font-weight: 600; }
.admin-table td.mono { font-family: var(--mono); }
.admin-table tr:hover td { background: var(--surface-3); }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-filters input { height: 32px; width: 220px; padding: 0 10px; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 12.5px; }
.credit-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.credit-presets .chip { height: 28px; padding: 0 10px; font-size: 12px; }
.admin-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.alert-over { border-color: rgba(251, 191, 36, 0.45); }
.alert-over .k { color: var(--warn); }
@media (max-width: 720px) {
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 720px) {
  .wrap { padding: 18px 14px 40px; }
  .topbar-inner { padding: 0 14px; }
  .brand-sub { display: none; }
  .panel { padding: 16px; }
  .panel-tabs { margin: -16px -14px 0; padding: 0 14px; flex-wrap: wrap; row-gap: 4px; }
  .toolbar { width: 100%; }
  .row { flex-wrap: wrap; }
  .mon-toolbar .seg { width: 100%; }
  .stats-hero { padding: 18px 18px; gap: 14px; }
  .stats-big { font-size: 27px; word-break: break-all; }
  .stats-deltas { gap: 14px; flex: 0 1 auto; }
  .stats-deltas .stat-delta:first-child { margin-left: 0; }
  .stat-fresh { margin-left: 0; border-left: none; padding-left: 0; }
  .simple-hero { flex-wrap: wrap; }
  .simple-hero .btn.primary { flex: 1; }
  .stats { white-space: normal; }
  .usage { white-space: normal; max-width: 100%; }
  .pull-controls { flex-wrap: wrap; justify-content: flex-end; }
  .toolbar .btn.primary { flex: 1; }
  .pull-name { max-width: 30ch; }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------- fase 6.3.1: planos comerciais + assinaturas ---------------- */

.plans-head { text-align: center; justify-content: center; }
.plans-head .panel-title { font-size: 24px; letter-spacing: -0.01em; }
.plans-head .panel-hint { max-width: 560px; margin: 6px auto 0; }
.cycle-toggle { display: flex; justify-content: center; gap: 0; margin: 6px 0 18px; }
.cycle-btn {
  height: 34px; padding: 0 22px; background: var(--surface-2); color: var(--text-mut);
  border: 1px solid var(--border-strong); font-family: var(--sans); font-size: 12px; font-weight: 650;
  letter-spacing: 0.08em; cursor: pointer;
}
.cycle-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.cycle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.cycle-btn.is-on { background: var(--accent-dim); color: var(--accent); border-color: rgba(52, 211, 153, 0.5); }
.plans-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.plan-card { position: relative; }
.plan-card.is-recommended { border-color: rgba(104, 213, 208, 0.55); box-shadow: 0 0 0 1px rgba(104, 213, 208, 0.25); }
.plan-reco {
  position: absolute; top: -9px; left: 14px; padding: 2px 10px; border-radius: 999px;
  background: #0d9488; color: #052e2b; font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
}
.plan-desc { font-size: 12.5px; color: var(--text-mut); line-height: 1.5; min-height: 38px; }
.plan-off {
  display: inline-block; margin: 2px 0 0 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 700;
}
.plan-per-month { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-dim); }
.plan-editor { max-width: 640px; max-height: 86vh; overflow-y: auto; }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 8px; }
.plan-editor .field { margin-bottom: 8px; }
.plan-editor .field label { display: block; font-size: 11.5px; color: var(--text-mut); margin-bottom: 3px; }
.plan-editor .field input, .plan-editor .field textarea, .plan-editor .field select {
  width: 100%; padding: 7px 10px; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; font-family: var(--sans);
}
.plan-editor .field textarea { resize: vertical; font-family: var(--mono); font-size: 12px; }
@media (max-width: 640px) { .pe-grid { grid-template-columns: 1fr; } }

/* ---------------- fase 6.3.2: franquia atual (bolsos) ---------------- */

.franq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.franq-grid .r-card { padding: 10px 12px; }
.franq-grid .r-card .v { font-size: 15px; }
.franq-grid .r-card .k { font-size: 9.5px; letter-spacing: 0.06em; }
