/* Portal Developer TAG — dashboard PRETO E BRANCO, profissional (Linear/
   Vercel/GitHub). Zero azul na UI: o único ponto de cor é a logo da marca.
   Status por peso/traço (nunca bolinha colorida). */

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-hover: #f2f3f5;
  --text: #0e0f12;
  --text-2: #383b42;
  --text-muted: #656b76;
  --text-faint: #9aa0ab;
  --hairline: #e8eaed;
  --hairline-strong: #d8dbe0;
  --ink: #0e0f12;              /* "accent" = preto */
  --ink-soft: #f2f3f5;
  --danger: #8a2018;
  --radius: 10px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* ============ shell ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--bg); border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.sidebar-brand { padding: 2px 8px 0; display: flex; flex-direction: column; gap: 7px; }
.sidebar-brand a { display: inline-flex; }
.brand-logo { width: 128px; height: auto; display: block; }
.brand-sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-faint); padding-left: 2px;
}

.sidebar-nav { margin-top: 28px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-group { display: flex; flex-direction: column; gap: 2px; }
.sidebar-group-label {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); padding: 0 8px; margin-bottom: 6px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  padding: 8px; border-radius: 8px; transition: background .12s, color .12s;
}
.sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-nav a.active { background: var(--ink); color: #fff; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-user { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-email { font-family: var(--font-mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-perfil { font-size: 11px; color: var(--text-faint); text-transform: capitalize; }

.link-button {
  background: none; border: none; color: var(--text-muted);
  font-family: var(--font-sans); font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.link-button:hover { color: var(--text); background: var(--bg-hover); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ topbar / search ============ */
.topbar {
  border-bottom: 1px solid var(--hairline); padding: 14px 40px;
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
}
.topbar::before {
  content: ""; position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; pointer-events: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23656b76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}
.topbar-search {
  width: 100%; max-width: 440px;
  border: 1px solid var(--hairline-strong); border-radius: var(--radius);
  padding: 9px 12px 9px 34px; font-family: var(--font-sans); font-size: 13.5px; color: var(--text); background: var(--bg);
  transition: border-color .12s, box-shadow .12s;
}
.topbar-search::placeholder { color: var(--text-faint); }
.topbar-search:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14,15,18,.10); }

.search-results {
  position: absolute; top: 54px; left: 40px; width: 440px;
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(16,24,40,.10); max-height: 320px; overflow-y: auto; z-index: 30;
}
.search-results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--hairline); color: var(--text); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg-subtle); }
.search-results-empty { padding: 14px; color: var(--text-muted); font-size: 13px; }

/* ============ content ============ */
.content { padding: 34px 40px 56px; max-width: 1180px; width: 100%; }
.content-narrow { max-width: 800px; }
.content-header { margin-bottom: 26px; }
.content-header h1 { margin: 0 0 5px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.content-subtitle { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.page-crumb { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.page-crumb a { color: var(--text-muted); }
.page-crumb a:hover { color: var(--text); }
.page-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 5px; }
.page-title-row h1 { margin: 0; }

/* ============ systems grid ============ */
.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.system-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: 18px; transition: border-color .14s, background .14s;
}
.system-card:hover { border-color: var(--hairline-strong); background: var(--bg-subtle); }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 9px;
  background: var(--ink-soft); color: var(--text-2); border: 1px solid var(--hairline);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.card-title-wrap { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -.01em; line-height: 1.25; }
.card-cat { font-size: 12px; color: var(--text-faint); text-transform: capitalize; }
.card-desc {
  margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px;
}
.card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px;
  border-top: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 12px; color: var(--text-faint);
}
.card-meta .dot { color: var(--hairline-strong); }

/* ============ pílula de status — monocromática (peso/traço, sem cor) ============ */
.pill {
  flex-shrink: 0; align-self: flex-start;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-hover); color: var(--text-muted); border: 1px solid transparent;
}
.pill-producao      { background: var(--ink); color: #fff; }
.pill-construcao    { background: var(--bg); color: var(--text-2); border: 1px dashed var(--hairline-strong); }
.pill-descontinuado { background: var(--bg-hover); color: var(--text-faint); }

/* ============ editorial table ============ */
.editorial-table { width: 100%; border-collapse: collapse; }
.editorial-table th {
  text-align: left; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--hairline);
}
.editorial-table td { padding: 13px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.editorial-table tbody tr { transition: background .1s; }
.editorial-table tbody tr:hover { background: var(--bg-subtle); }
.editorial-table tr:last-child td { border-bottom: none; }
.editorial-table a { color: var(--text); font-weight: 500; border-bottom: 1px solid var(--hairline-strong); }
.editorial-table a:hover { border-bottom-color: var(--ink); }

/* ============ editorial list (specs) ============ */
.editorial-list { margin: 0; }
.editorial-row { display: flex; justify-content: space-between; gap: 24px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.editorial-row:last-child { border-bottom: none; }
.editorial-row dt { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.editorial-row dd { margin: 0; text-align: right; word-break: break-word; }
.editorial-row dd a { border-bottom: 1px solid var(--hairline-strong); }
.editorial-row dd a:hover { border-bottom-color: var(--ink); }

/* status-label (compat) — monocromático */
.status-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; background: var(--bg-hover); color: var(--text-muted);
}
.status-producao { background: var(--ink); color: #fff; }
.status-construcao { background: var(--bg); color: var(--text-2); border: 1px dashed var(--hairline-strong); }
.status-descontinuado { background: var(--bg-hover); color: var(--text-faint); }

/* ============ doc sections / markdown ============ */
.doc-section { margin-bottom: 34px; }
.doc-section h2 { font-size: 13px; font-weight: 600; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-family: var(--font-mono); }
.lead { font-size: 15px; line-height: 1.6; color: var(--text-2); margin: 0 0 8px; }
.markdown-body { font-size: 14px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body code { font-family: var(--font-mono); background: var(--bg-subtle); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.markdown-body pre { background: #0e0f12; color: #e6e8eb; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; }
.markdown-body pre code { background: none; padding: 0; color: inherit; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; }
.markdown-body a { border-bottom: 1px solid var(--hairline-strong); }
.markdown-body a:hover { border-bottom-color: var(--ink); }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.tag { border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 3px 9px; font-size: 12px; color: var(--text-muted); }

.link-list, .plain-list { margin: 0; padding-left: 0; list-style: none; }
.link-list li, .plain-list li { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.link-list li:last-child, .plain-list li:last-child { border-bottom: none; }
.link-list a { border-bottom: 1px solid var(--hairline-strong); }
.link-list a:hover { border-bottom-color: var(--ink); }

/* ============ notices / empty ============ */
.notice { border: 1px solid var(--hairline); border-left: 3px solid var(--text-muted); padding: 12px 16px; font-size: 13px; margin-bottom: 24px; background: var(--bg-subtle); border-radius: 8px; }
.notice-warning { border-left-color: var(--text); }
.empty-state { padding: 72px 20px; text-align: center; color: var(--text-muted); }
.empty-state p:first-child { color: var(--text); font-size: 15px; margin: 0 0 6px; }
.empty-state-sub { font-size: 13px; margin: 0; }

/* ============ keys reveal / vault ============ */
.reveal-btn {
  font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--hairline-strong); background: var(--bg);
  padding: 6px 11px; border-radius: 7px; cursor: pointer; color: var(--text); transition: border-color .12s, background .12s;
}
.reveal-btn:hover { border-color: var(--ink); background: var(--bg-hover); }
.reveal-btn:disabled { color: var(--text-faint); cursor: not-allowed; }
.key-value { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
.key-value.revealed {
  display: block; color: var(--text); background: var(--bg-hover);
  white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto;
  padding: 8px 10px; border-radius: 6px; line-height: 1.45;
}
.keys-note { margin: 0 0 14px; font-size: 12.5px; color: var(--text-muted); }

/* ============ conectar no claude ============ */
.btn-solid { height: 38px; padding: 0 16px; font-size: 14px; font-weight: 600; color: #fff; background: var(--ink); border: none; border-radius: 8px; cursor: pointer; }
.btn-solid:hover { background: #000; }
.btn-solid:disabled { opacity: .55; cursor: default; }
.text-input { height: 38px; padding: 0 12px; font-size: 14px; font-family: var(--font-sans); color: var(--text); background: var(--bg); border: 1px solid var(--hairline-strong); border-radius: 8px; outline: none; }
.text-input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(14,15,18,.10); }
.gen-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#result { margin-top: 18px; }
.agent-blob {
  background: #0e0f12; color: #e6e8eb; padding: 16px; border-radius: 10px;
  white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.55; margin: 14px 0 12px; max-height: 360px; overflow: auto;
}

/* código copiável (ssh/chaves) */
.code-line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 13px; background: #0e0f12; color: #e6e8eb;
  padding: 11px 14px; border-radius: var(--radius); overflow-x: auto;
}
.code-line .copy-btn {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; color: #b9bec6; background: rgba(255,255,255,.08);
  border: none; border-radius: 6px; padding: 4px 9px; cursor: pointer;
}
.code-line .copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ============ auth fallback ============ */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-box { width: 360px; text-align: center; }
.auth-box h1 { font-size: 18px; margin-bottom: 8px; }

/* ============ responsivo ============ */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; gap: 8px; border-right: none; border-bottom: 1px solid var(--hairline); padding: 12px 16px; overflow-x: auto; }
  .sidebar-brand { padding: 0; }
  .brand-sub { display: none; }
  .sidebar-nav { margin-top: 0; flex-direction: row; gap: 12px; }
  .sidebar-group { flex-direction: row; align-items: center; gap: 4px; }
  .sidebar-group-label { display: none; }
  .sidebar-footer { margin-top: 0; margin-left: auto; border-top: none; padding: 0; }
  .sidebar-user { display: none; }
  .topbar { padding: 12px 20px; }
  .topbar::before { left: 32px; }
  .search-results { left: 20px; width: calc(100% - 40px); }
  .content { padding: 24px 20px 48px; }
}
