/* ══════════════════════════════════════════════════════════════
   KIT SÊNIOR — components.css
   Cards, badges, forms, pipeline, toast, botões
   ══════════════════════════════════════════════════════════════ */

/* ── TOPBAR BUTTONS ───────────────────────────────────────────── */
.topbar-btn {
  font-size: 10px;
  padding: 5px 12px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  transition: all .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.topbar-btn:hover { border-color: var(--teal); color: var(--teal); }
.topbar-btn.primary {
  border-color: rgba(45,154,176,0.4);
  color: var(--teal);
  background: rgba(45,154,176,0.08);
}
.topbar-btn.primary:hover { background: rgba(45,154,176,0.14); }

/* ── HERO STRIP ───────────────────────────────────────────────── */
.hero-strip {
  background: linear-gradient(135deg, rgba(45,154,176,0.04), rgba(124,111,205,0.04));
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-tagline {
  font-family: var(--display);
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.2;
  flex: 1;
  min-width: 240px;
  color: var(--text);
}
.hero-tagline em {
  font-style: normal;
  color: var(--teal);
}
.hero-mantra {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 320px;
  border-left: 2px solid var(--border2);
  padding-left: 16px;
}

/* ── STATS ROW ────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-val {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: .05em; }
.stat-sub   { font-size: 9px; color: var(--text-mute); margin-top: 2px; }

/* ── MODULE GRID ──────────────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.module-card:hover {
  border-color: var(--mc-color, var(--border2));
  transform: translateY(-2px);
}
.mc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.mc-num {
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--mc-color, var(--text-mute));
  font-weight: 700;
  padding-top: 2px;
}
.mc-title {
  font-family: var(--display);
  font-size: 14px;
  flex: 1;
  line-height: 1.3;
  color: var(--text);
}
.mc-status { margin-left: auto; flex-shrink: 0; }

/* status pills */
.status-pill {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}
.status-done    { background: rgba(29,184,122,.12); color: var(--green); border: 1px solid rgba(29,184,122,.25); }
.status-partial { background: rgba(212,133,26,.12);  color: var(--amber); border: 1px solid rgba(212,133,26,.25); }
.status-todo    { background: rgba(232,237,242,.06); color: var(--text-dim); border: 1px solid var(--border); }

.mc-desc { font-size: 11px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mc-tag {
  font-size: 9px; padding: 2px 7px; border-radius: 3px;
  background: rgba(232,237,242,.04);
  color: var(--text-mute);
  border: 1px solid var(--border);
}
.mc-tag.done { border-color: rgba(29,184,122,.2); color: rgba(29,184,122,.8); }

.mc-progress { margin-top: 12px; }
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-mute);
  margin-top: 4px;
}

/* ── DOMAIN LIST ──────────────────────────────────────────────── */
.domain-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.domain-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color .2s;
}
.domain-row:hover { border-color: var(--border2); }
.domain-pct  { font-size: 11px; font-weight: 700; color: var(--text-dim); width: 32px; flex-shrink: 0; }
.domain-name { font-size: 12px; font-weight: 600; flex: 1; color: var(--text); }
.domain-bar-wrap { width: 140px; height: 5px; background: var(--border); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.domain-bar  { height: 100%; border-radius: 2px; transition: width 1s ease; }
.domain-status { font-size: 9px; font-weight: 700; width: 72px; text-align: right; flex-shrink: 0; }

/* ── ACTIONS GRID ─────────────────────────────────────────────── */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.action-card:hover {
  border-color: var(--teal);
  background: var(--surface2);
  transform: translateY(-1px);
}
.ac-icon  { font-size: 20px; margin-bottom: 2px; }
.ac-title { font-size: 12px; font-weight: 600; color: var(--text); }
.ac-desc  { font-size: 10px; color: var(--text-dim); line-height: 1.5; }
.ac-tag   {
  font-size: 9px; padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border2);
  color: var(--text-mute);
  width: fit-content;
  margin-top: 2px;
}

/* ── JOB ROWS ─────────────────────────────────────────────────── */
.job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .15s;
}
.job-row:hover { border-color: var(--border2); }
.job-crew-icon { font-size: 18px; flex-shrink: 0; }
.job-info { flex: 1; min-width: 0; }
.job-crew   { font-size: 11px; font-weight: 600; text-transform: capitalize; color: var(--text); }
.job-id     { font-size: 9px; color: var(--text-mute); }
.job-preview { font-size: 10px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.job-meta   { text-align: right; flex-shrink: 0; }
.job-status { font-size: 10px; font-weight: 700; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.job-time   { font-size: 9px; color: var(--text-mute); margin-top: 2px; }

/* status dots */
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.s-pending   { background: #f0c040; }
.s-running   { background: var(--teal); animation: blink 1s infinite; }
.s-completed { background: var(--green); }
.s-failed    { background: var(--red); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── COMMANDS GRID ────────────────────────────────────────────── */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cmd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 14px;
  transition: border-color .15s;
}
.cmd-card:hover { border-color: var(--border2); }
.cmd-name { font-size: 11px; font-weight: 700; color: var(--teal); margin-bottom: 5px; }
.cmd-name.hook { color: var(--amber); }
.cmd-desc { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

/* ── CREW TABS ────────────────────────────────────────────────── */
.crew-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.crew-tab {
  padding: 9px 14px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.crew-tab.active { color: var(--teal); border-color: var(--teal); }
.crew-tab:hover:not(.active) { color: var(--text); }

/* ── FORMS ────────────────────────────────────────────────────── */
.form-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 12px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.f-label {
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 5px;
  display: block;
}
.f-input, .f-select, .f-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 10px;
  outline: none;
  border-radius: var(--r);
  transition: border-color .15s;
}
.f-input:focus,
.f-select:focus,
.f-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(45,154,176,.08);
}
.f-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.f-code { min-height: 160px; font-size: 10px; background: var(--bg); }

/* run button */
.btn-run {
  width: 100%; padding: 13px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border: none; color: #fff; cursor: pointer;
  border-radius: var(--r);
  transition: opacity .2s, transform .2s;
}
.btn-run:hover:not(:disabled) { transform: translateY(-1px); opacity: .9; }
.btn-run:disabled { opacity: .45; cursor: not-allowed; }

/* ── PIPELINE VIZ ─────────────────────────────────────────────── */
.pipeline-track {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px;
  overflow-x: auto;
}
.pipe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 80px;
}
.pipe-node {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border: 1px solid var(--border2);
  background: var(--bg);
  position: relative; z-index: 1;
  transition: all .3s;
}
.pipe-node.active {
  border-color: var(--teal);
  background: rgba(45,154,176,.08);
  box-shadow: 0 0 14px rgba(45,154,176,.25);
  animation: pulse-pipe 1.5s infinite;
}
.pipe-node.done {
  border-color: var(--green);
  background: rgba(29,184,122,.07);
  color: var(--green);
}
@keyframes pulse-pipe {
  0%,100% { box-shadow: 0 0 14px rgba(45,154,176,.25); }
  50%      { box-shadow: 0 0 28px rgba(45,154,176,.5); }
}
.pipe-label { font-size: 9px; text-align: center; color: var(--text-dim); line-height: 1.3; }
.pipe-arrow { font-size: 12px; color: var(--text-mute); flex-shrink: 0; padding: 0 2px; }

/* ── RESULT ───────────────────────────────────────────────────── */
.result-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: 14px;
}
.result-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r) var(--r) 0 0;
}
.result-head-title { font-size: 11px; font-weight: 600; flex: 1; color: var(--text); }
.result-head-status { font-size: 10px; display: flex; align-items: center; gap: 5px; }
.result-body {
  padding: 16px;
  max-height: 55vh;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
}
.result-body h1, .result-body h2 { color: var(--text); margin: 16px 0 8px; }
.result-body h2 { font-size: 14px; color: var(--teal); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.result-body h3 { font-size: 12px; color: var(--purple); margin: 12px 0 4px; }
.result-body strong { color: var(--text); }
.result-body pre { background: var(--bg2); border: 1px solid var(--border); padding: 12px; overflow-x: auto; margin: 8px 0; border-radius: var(--r); }
.result-body pre code { background: none; border: none; color: var(--green); font-size: 10px; }
.result-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11px; }
.result-body th { background: var(--surface2); padding: 7px 10px; text-align: left; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); border-bottom: 1px solid var(--border2); }
.result-body td { padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.result-body ul, .result-body ol { padding-left: 18px; margin-bottom: 8px; }
.result-body li { margin-bottom: 3px; }
.result-actions {
  display: flex; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--r) var(--r);
}
.result-btn {
  font-size: 10px; padding: 5px 12px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  border-radius: var(--r);
  transition: all .15s;
}
.result-btn:hover { border-color: var(--teal); color: var(--teal); }

/* ── EMPTY / LOADING ──────────────────────────────────────────── */
.empty { padding: 40px; text-align: center; color: var(--text-mute); }
.empty-icon  { font-size: 32px; opacity: .3; margin-bottom: 12px; }
.empty-title { font-family: var(--display); font-size: 16px; color: var(--text-dim); margin-bottom: 6px; }
.empty-desc  { font-size: 11px; line-height: 1.6; max-width: 300px; margin: 0 auto; }
.loading-row { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 11px; color: var(--text-mute); }

/* ── TOAST ────────────────────────────────────────────────────── */
#toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 200;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  padding: 10px 14px;
  font-size: 11px;
  max-width: 300px;
  border-radius: var(--r);
  animation: toastIn .2s ease;
  color: var(--text);
}
.toast.ok  { border-color: rgba(29,184,122,.3); }
.toast.err { border-color: rgba(217,79,79,.3); }
@keyframes toastIn {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
