@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800&display=swap');

/* Extra CSS vars not in style.css */
:root {
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
}

/* ── Docs content layout ── */
.docs-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 28px 80px;
}
h1 { color: var(--purple); font-size: 2em; margin-bottom: 4px; }
h2 { color: var(--purple-dark); border-bottom: 2px solid var(--purple-light); padding-bottom: 6px; margin-top: 36px; }
h3 { color: var(--purple); margin-top: 24px; }
.subtitle { color: var(--muted); font-size: 1.05em; margin-bottom: 24px; }

/* Tabs */
button.tab-btn {
  border: none; background: none; cursor: pointer;
  font-family: inherit; margin: 0; padding: 0 18px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Cards */
.card {
  background: white; border-radius: 12px; padding: 20px 24px;
  border: 1px solid var(--border); margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(60,14,107,.04);
}
.card-title { font-weight: 700; font-size: 1.05em; margin-bottom: 8px; color: var(--purple); }

/* Summary card */
.summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-top: 16px;
}
.summary-item {
  background: white; border-radius: 10px; padding: 16px 20px;
  border: 1px solid var(--border); text-align: center;
}
.summary-item .value { font-size: 1.5em; font-weight: 800; color: var(--purple); }
.summary-item .label { font-size: 0.82em; color: var(--muted); margin-top: 2px; }

/* ── Kanban Board (Notion-style) ── */
.kb-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 1000px) { .kb-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kb-board { grid-template-columns: 1fr; } }
.kb-col { background: #F7F6F3; border-radius: 8px; padding: 10px; min-height: 200px; }
.kb-col.drag-over { background: #EDE9FE; }
.kb-col-header {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px;
  font-size: 0.82em; font-weight: 600; color: #91918E; text-transform: uppercase; letter-spacing: 0.3px;
}
.kb-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kb-col-dot.todo { background: #EB5757; }
.kb-col-dot.doing { background: #F2994A; }
.kb-col-dot.done { background: #27AE60; }
.kb-col-dot.insight { background: #2F80ED; }
.kb-col-count { font-weight: 400; color: #B4B4B0; }

.kb-card {
  background: white; border-radius: 6px; padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid transparent; font-size: 0.86em; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: box-shadow .12s, background .12s;
  user-select: none;
}
.kb-card:hover { background: #FAFAFA; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.kb-card.dragging { opacity: 0.35; transform: scale(0.97); }
.kb-card-title { font-weight: 600; color: var(--text); font-size: 0.92em; line-height: 1.35; margin-bottom: 4px; }
.kb-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.kb-tag {
  display: inline-block; font-size: 0.68em; font-weight: 600; padding: 1px 6px;
  border-radius: 3px;
}
.kb-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.kb-card-avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--purple-light);
  color: var(--purple); font-size: 0.62em; font-weight: 700; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.kb-card-subtask-indicator { font-size: 0.72em; color: #91918E; display: flex; align-items: center; gap: 3px; }
.kb-card-subtask-indicator svg { width: 12px; height: 12px; }
.kb-card-date { font-size: 0.7em; color: #B4B4B0; }

.kb-add-btn {
  width: 100%; padding: 6px; border: none; border-radius: 6px;
  background: transparent; color: #91918E; font-family: inherit; font-size: 0.82em;
  cursor: pointer; transition: background .12s; text-align: left; padding-left: 12px;
}
.kb-add-btn:hover { background: rgba(0,0,0,.04); color: var(--text); }

/* ── Kanban Filter Bar ── */
.kb-filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 8px 14px; background: white; border-radius: 8px;
  border: 1px solid var(--border); margin-bottom: 10px;
}
.kb-filters label { font-size: 0.8em; font-weight: 600; color: #91918E; }
.kb-filters select, .kb-filters input {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.82em; color: var(--text); background: white;
}
.kb-filters select:focus, .kb-filters input:focus { outline: none; border-color: var(--purple); }
.kb-filter-search { min-width: 180px; }
.kb-filter-reset {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: white; color: #91918E; font-family: inherit; font-size: 0.8em;
  cursor: pointer; transition: all .12s;
}
.kb-filter-reset:hover { color: var(--purple); border-color: var(--purple); }

/* ── Side Panel ── */
.kb-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.25); z-index: 9000; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.kb-overlay.open { opacity: 1; pointer-events: auto; }
.kb-side-panel {
  position: fixed; top: 0; right: 0; width: 460px; height: 100vh;
  background: white; z-index: 9001; transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.12); overflow-y: auto;
  display: flex; flex-direction: column;
}
.kb-side-panel.open { transform: translateX(0); }
@media (max-width: 560px) { .kb-side-panel { width: 100vw; } }
.kb-sp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #F0F0EE; flex-shrink: 0;
}
.kb-sp-header-actions { display: flex; gap: 6px; }
.kb-sp-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-family: inherit; font-size: 0.78em; color: #91918E;
  cursor: pointer; transition: all .12s;
}
.kb-sp-btn:hover { color: var(--purple); border-color: var(--purple); }
.kb-sp-btn-danger { color: #EB5757; }
.kb-sp-btn-danger:hover { background: #FEE2E2; border-color: #EB5757; color: #991B1B; }
.kb-sp-close {
  background: none; border: none; font-size: 1.4em; cursor: pointer; color: #91918E;
  line-height: 1; padding: 0 4px;
}
.kb-sp-close:hover { color: var(--text); }
.kb-sp-body { padding: 16px 20px; flex: 1; overflow-y: auto; }
.kb-sp-title-input {
  width: 100%; border: none; font-size: 1.2em; font-weight: 700; font-family: inherit;
  color: var(--text); padding: 4px 0; margin-bottom: 12px; outline: none;
  background: transparent; border-bottom: 2px solid transparent;
}
.kb-sp-title-input:focus { border-bottom-color: var(--purple); }
.kb-sp-field { margin-bottom: 12px; }
.kb-sp-field-label {
  font-size: 0.78em; font-weight: 600; color: #91918E; margin-bottom: 3px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.kb-sp-field select, .kb-sp-field input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.88em; color: var(--text); background: white;
}
.kb-sp-field select:focus, .kb-sp-field input:focus { outline: none; border-color: var(--purple); }
.kb-sp-desc {
  width: 100%; min-height: 80px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-family: inherit; font-size: 0.88em; color: var(--text);
  background: white; resize: vertical; line-height: 1.5;
}
.kb-sp-desc:focus { outline: none; border-color: var(--purple); }
.kb-sp-meta { font-size: 0.75em; color: #B4B4B0; margin-top: 14px; padding-top: 10px; border-top: 1px solid #F0F0EE; line-height: 1.7; }
.kb-sp-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Page View ── */
.kb-page {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9010;
  background: white; overflow-y: auto; display: none;
}
.kb-page.open { display: block; }
.kb-page-inner { max-width: 720px; margin: 0 auto; padding: 32px 40px 80px; }
@media (max-width: 800px) { .kb-page-inner { padding: 20px 16px 60px; } }
.kb-page-breadcrumb { font-size: 0.82em; color: #91918E; margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }
.kb-page-breadcrumb a { color: var(--purple); text-decoration: none; cursor: pointer; }
.kb-page-breadcrumb a:hover { text-decoration: underline; }
.kb-page-title {
  font-size: 2em; font-weight: 800; color: var(--text); margin-bottom: 16px;
  border: none; outline: none; width: 100%; background: transparent; font-family: inherit;
  padding: 0;
}
.kb-page-title:focus { }
.kb-page-meta-grid {
  display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px;
  font-size: 0.86em; color: var(--text); margin-bottom: 24px;
  padding: 16px; background: #FAFAFA; border-radius: 8px;
}
.kb-page-meta-label { color: #91918E; font-weight: 600; font-size: 0.85em; }
.kb-page-desc {
  width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.92em; color: var(--text);
  line-height: 1.6; resize: vertical; background: white;
}
.kb-page-desc:focus { outline: none; border-color: var(--purple); }
.kb-page-section { margin-top: 28px; }
.kb-page-section-title { font-size: 1.05em; font-weight: 700; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* Subtasks */
.kb-subtask-list { list-style: none; padding: 0; margin: 0; }
.kb-subtask-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  transition: background .1s; font-size: 0.9em;
}
.kb-subtask-item:hover { background: #F7F6F3; }
.kb-subtask-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--purple); cursor: pointer; flex-shrink: 0; }
.kb-subtask-item.done span { text-decoration: line-through; color: #B4B4B0; }
.kb-subtask-remove {
  background: none; border: none; color: #B4B4B0; font-size: 1.1em; cursor: pointer;
  opacity: 0; transition: opacity .12s; padding: 0 4px; margin-left: auto;
}
.kb-subtask-item:hover .kb-subtask-remove { opacity: 1; }
.kb-subtask-remove:hover { color: #EB5757; }
.kb-subtask-add {
  display: flex; gap: 8px; margin-top: 8px;
}
.kb-subtask-add input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.88em;
}
.kb-subtask-add input:focus { outline: none; border-color: var(--purple); }
.kb-subtask-add button {
  padding: 6px 14px; background: var(--purple); color: white; border: none;
  border-radius: 6px; font-family: inherit; font-size: 0.82em; font-weight: 600;
  cursor: pointer;
}
.kb-subtask-add button:hover { background: var(--purple-dark); }
.kb-subtask-progress {
  height: 4px; background: #F0F0EE; border-radius: 2px; margin-bottom: 10px; overflow: hidden;
}
.kb-subtask-progress-bar { height: 100%; background: var(--purple); border-radius: 2px; transition: width .3s; }

/* Comments */
.kb-comment {
  padding: 10px 12px; border-radius: 8px; background: #F7F6F3; margin-bottom: 8px;
  font-size: 0.88em;
}
.kb-comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kb-comment-author { font-weight: 700; color: var(--purple); font-size: 0.85em; }
.kb-comment-date { font-size: 0.75em; color: #B4B4B0; }
.kb-comment-text { color: var(--text); line-height: 1.5; }
.kb-comment-add {
  display: flex; gap: 8px; margin-top: 10px;
}
.kb-comment-add input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.88em;
}
.kb-comment-add input:focus { outline: none; border-color: var(--purple); }
.kb-comment-add button {
  padding: 6px 14px; background: var(--purple); color: white; border: none;
  border-radius: 6px; font-family: inherit; font-size: 0.82em; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.kb-comment-add button:hover { background: var(--purple-dark); }

/* ── KB Modal (for new cards only) ── */
.kb-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.35); z-index: 9020; display: none;
  align-items: center; justify-content: center;
}
.kb-modal-overlay.open { display: flex; }
.kb-modal {
  background: white; border-radius: 12px; width: 480px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 12px 48px rgba(0,0,0,.15);
}
.kb-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #F0F0EE;
}
.kb-modal-header h2 { margin: 0; font-size: 1.05em; font-weight: 700; color: var(--text); }
.kb-modal-close {
  background: none; border: none; font-size: 1.4em; cursor: pointer; color: #91918E;
  line-height: 1; padding: 0 4px;
}
.kb-modal-close:hover { color: var(--text); }
.kb-modal-body { padding: 14px 20px 20px; }
.kb-modal-field { margin-bottom: 12px; }
.kb-modal-field label {
  display: block; font-weight: 600; font-size: 0.78em; color: #91918E;
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.3px;
}
.kb-modal-field input, .kb-modal-field textarea, .kb-modal-field select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.88em; color: var(--text); background: white;
}
.kb-modal-field input:focus, .kb-modal-field textarea:focus, .kb-modal-field select:focus {
  outline: none; border-color: var(--purple);
}
.kb-modal-field textarea { min-height: 80px; resize: vertical; }
.kb-modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.kb-modal-actions button { flex: 1; padding: 8px; border-radius: 6px; font-family: inherit; font-weight: 600; font-size: 0.88em; cursor: pointer; transition: all .12s; }
.kb-btn-save { background: var(--purple); color: white; border: none; }
.kb-btn-save:hover { background: var(--purple-dark); }
.kb-btn-cancel { background: white; color: #91918E; border: 1px solid var(--border); }
.kb-btn-cancel:hover { color: var(--text); border-color: var(--text); }

/* Diagrams */
.diagram {
  background: white; border-radius: 12px; padding: 24px; margin: 20px 0;
  border: 1px solid var(--border); overflow-x: auto;
}
.diagram svg { max-width: 100%; height: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 16px 0; }
th {
  background: var(--purple); color: white; padding: 10px 14px;
  text-align: left; font-weight: 600; font-size: 0.88em;
  position: sticky; top: 0; z-index: 2;
}
td { padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 0.87em; }
tr:nth-child(even) td { background: #FAFAFE; }
tr:hover td { background: var(--purple-light); }

/* Code */
pre {
  background: #1a1a2e; color: #e2e8f0; border-radius: 10px;
  padding: 16px 20px; overflow-x: auto; font-size: 0.84em; line-height: 1.5;
}
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.inline-code {
  background: var(--purple-light); color: var(--purple); padding: 2px 6px;
  border-radius: 4px; font-size: 0.86em; font-family: 'JetBrains Mono', monospace;
}

/* Info box */
.info-box {
  border-left: 4px solid var(--blue); background: #EFF6FF;
  padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 16px 0;
  font-size: 0.9em;
}
.info-box a { color: var(--purple); font-weight: 600; }

/* File tree */
.file-tree {
  font-family: 'JetBrains Mono', monospace; font-size: 0.84em; line-height: 1.8;
  background: white; padding: 20px; border-radius: 10px; border: 1px solid var(--border);
}
.file-tree .dir { color: var(--purple); font-weight: 600; }
.file-tree .file { color: var(--text); }
.file-tree .desc { color: var(--muted); font-style: italic; }

/* Search input */
.search-box {
  width: 100%; padding: 10px 16px; border: 2px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 0.92em; margin-bottom: 16px; outline: none;
  transition: border-color .2s;
}
.search-box:focus { border-color: var(--purple); }

/* Null badges */
.null-green { background: #D1FAE5; color: #065F46; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85em; }
.null-yellow { background: #FEF3C7; color: #92400E; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85em; }
.null-red { background: #FEE2E2; color: #991B1B; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85em; }

/* Collapsible */
details { margin: 12px 0; }
details summary {
  cursor: pointer; font-weight: 600; color: var(--purple); padding: 8px 0;
  font-size: 0.95em;
}
details summary:hover { text-decoration: underline; }

/* Scrollable table container */
.table-scroll { overflow-x: auto; max-height: 70vh; overflow-y: auto; border-radius: 10px; border: 1px solid var(--border); }
.table-scroll table { margin: 0; }
.table-scroll th { position: sticky; top: 0; }

/* Origin tags */
.origin-prescricao { background: #DBEAFE; color: #1E40AF; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-conversao { background: #D1FAE5; color: #065F46; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-eventos { background: #FEF3C7; color: #92400E; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-funil { background: #FCE7F3; color: #9D174D; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-rfm { background: #F3E8FF; color: var(--purple); padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-ml { background: #E0E7FF; color: #3730A3; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }
.origin-derivada { background: #F1F5F9; color: #475569; padding: 2px 8px; border-radius: 4px; font-size: 0.78em; font-weight: 600; }

/* Counter */
.counter { font-size: 0.82em; color: var(--muted); margin-bottom: 8px; }

/* Column detail row */
.col-row { cursor: pointer; }
.col-row:hover td { background: var(--purple-light) !important; }
.col-detail-row td { background: #FAFAFF !important; padding: 0 !important; }
.col-detail-row.hidden { display: none; }
.col-detail {
  padding: 12px 20px; font-size: 0.86em; line-height: 1.7;
  border-left: 3px solid var(--purple); margin: 4px 14px 4px 0;
}
.col-detail strong { color: var(--purple-dark); }
.col-null-bar {
  display: inline-block; height: 6px; border-radius: 3px; vertical-align: middle;
  margin-left: 4px;
}

/* ── Project sub-tabs ── */
.pj-subtabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px;
}
.pj-subtab {
  padding: 10px 20px; font-weight: 700; font-size: 0.9em;
  color: var(--muted); background: none; border: none;
  border-bottom: 3px solid transparent; cursor: pointer;
  font-family: inherit; transition: all .15s; margin-bottom: -2px;
}
.pj-subtab:hover { color: var(--purple); }
.pj-subtab.active { color: var(--purple); border-bottom-color: var(--purple); }

/* ── Projects (Notion-style) ── */
.pj-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px;
}
@media (max-width: 1000px) { .pj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pj-grid { grid-template-columns: 1fr; } }

.pj-card {
  background: white; border-radius: 10px; padding: 18px 20px;
  border: 1px solid var(--border); cursor: pointer;
  box-shadow: 0 1px 3px rgba(60,14,107,.04);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.pj-card:hover {
  box-shadow: 0 4px 16px rgba(60,14,107,.1); transform: translateY(-2px);
  border-color: var(--purple);
}
.pj-card-name { font-weight: 700; font-size: 1em; color: var(--text); margin-bottom: 8px; }
.pj-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.pj-badge {
  display: inline-block; font-size: 0.7em; font-weight: 600; padding: 2px 8px;
  border-radius: 4px;
}
.pj-badge-planning { background: #FEF3C7; color: #92400E; }
.pj-badge-in_progress { background: #DBEAFE; color: #1E40AF; }
.pj-badge-done { background: #D1FAE5; color: #065F46; }
.pj-badge-farol {
  background: var(--purple-light); color: var(--purple);
}
.pj-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pj-card-assigned { font-size: 0.78em; color: var(--muted); }
.pj-card-count { font-size: 0.78em; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* ── Project Page (full overlay) ── */
.pj-page {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9010;
  background: white; overflow-y: auto; display: none;
}
.pj-page.open { display: block; }
.pj-page-inner { max-width: 900px; margin: 0 auto; padding: 32px 40px 80px; }
@media (max-width: 960px) { .pj-page-inner { padding: 20px 16px 60px; } }

.pj-page-breadcrumb {
  font-size: 0.82em; color: #91918E; margin-bottom: 20px;
  display: flex; align-items: center; gap: 6px;
}
.pj-page-breadcrumb a { color: var(--purple); text-decoration: none; cursor: pointer; }
.pj-page-breadcrumb a:hover { text-decoration: underline; }

.pj-page-title {
  font-size: 2em; font-weight: 800; color: var(--text); margin-bottom: 16px;
  border: none; outline: none; width: 100%; background: transparent; font-family: inherit;
  padding: 0;
}

.pj-page-meta-grid {
  display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px;
  font-size: 0.86em; color: var(--text); margin-bottom: 24px;
  padding: 16px; background: #FAFAFA; border-radius: 8px;
}
.pj-page-meta-label { color: #91918E; font-weight: 600; font-size: 0.85em; }

.pj-section { margin-top: 28px; }
.pj-section-title {
  font-size: 1.05em; font-weight: 700; color: var(--text); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

.pj-textarea {
  width: 100%; min-height: 100px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 0.92em; color: var(--text);
  line-height: 1.6; resize: vertical; background: white;
}
.pj-textarea:focus { outline: none; border-color: var(--purple); }
.pj-textarea:empty::before {
  content: attr(data-placeholder); color: #B4B4B0;
}

.pj-save-btn {
  padding: 8px 20px; background: var(--purple); color: white; border: none;
  border-radius: 6px; font-family: inherit; font-size: 0.88em; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.pj-save-btn:hover { background: var(--purple-dark); }

.pj-back-btn {
  padding: 8px 16px; background: white; color: var(--muted); border: 1px solid var(--border);
  border-radius: 6px; font-family: inherit; font-size: 0.82em; cursor: pointer;
  transition: all .12s;
}
.pj-back-btn:hover { color: var(--purple); border-color: var(--purple); }

/* ── Mini kanban inside project page ── */
.pj-mini-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 1000px) { .pj-mini-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .pj-mini-board { grid-template-columns: 1fr; } }
.pj-mini-col { background: #F7F6F3; border-radius: 8px; padding: 8px; min-height: 80px; }
.pj-mini-col-header {
  display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px;
  font-size: 0.78em; font-weight: 600; color: #91918E; text-transform: uppercase; letter-spacing: 0.3px;
}
.pj-mini-card {
  background: white; border-radius: 6px; padding: 8px 10px; margin-bottom: 5px;
  border: 1px solid transparent; font-size: 0.82em; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: box-shadow .12s;
}
.pj-mini-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pj-mini-card-title { font-weight: 600; color: var(--text); font-size: 0.88em; line-height: 1.3; }
.pj-mini-card-assigned { font-size: 0.72em; color: #91918E; margin-top: 4px; }

.pj-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.92em; }

/* ── Live Tab ── */
.lv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-top: 16px;
}
.lv-agent-card {
  background: white; border-radius: 10px; padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(60,14,107,.04);
  transition: box-shadow .15s, border-color .15s;
}
.lv-agent-card:hover {
  box-shadow: 0 4px 16px rgba(60,14,107,.1);
  border-color: var(--purple);
}
.lv-agent-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.lv-agent-card-name {
  font-weight: 700; font-size: 1.05em; color: var(--purple);
}
.lv-agent-card-role {
  font-size: 0.82em; color: var(--muted); margin-bottom: 8px;
}
.lv-agent-card-task {
  font-size: 0.86em; color: var(--text); background: var(--bg);
  padding: 8px 12px; border-radius: 6px; margin-bottom: 8px;
  border-left: 3px solid var(--purple);
}
.lv-agent-card-time {
  font-size: 0.78em; color: var(--muted); display: flex; align-items: center; gap: 6px;
}
.lv-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
  display: inline-block; flex-shrink: 0;
  animation: lv-pulse-anim 1.5s ease-in-out infinite;
}
@keyframes lv-pulse-anim {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.lv-empty {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.92em;
  background: white; border-radius: 10px; border: 1px solid var(--border);
}
.lv-empty svg { display: block; margin: 0 auto 12px; }

/* Timeline */
.lv-timeline {
  position: relative; margin-top: 16px; padding-left: 28px;
}
.lv-timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.lv-event {
  position: relative; padding: 10px 16px; margin-bottom: 8px;
  background: white; border-radius: 8px; border: 1px solid var(--border);
  font-size: 0.86em; box-shadow: 0 1px 2px rgba(60,14,107,.03);
}
.lv-event::before {
  content: ''; position: absolute; left: -23px; top: 14px;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid white;
}
.lv-event.lv-event-start::before { background: var(--green); }
.lv-event.lv-event-stop::before { background: var(--red); }
.lv-event-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.lv-event-type {
  font-size: 0.72em; font-weight: 600; padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.lv-event-type-start { background: #D1FAE5; color: #065F46; }
.lv-event-type-stop { background: #FEE2E2; color: #991B1B; }
.lv-event-agent { font-weight: 600; color: var(--text); }
.lv-event-time { font-size: 0.78em; color: var(--muted); }
.lv-event-duration {
  font-size: 0.78em; color: var(--purple); font-weight: 500;
  margin-left: auto;
}
.lv-event-desc { font-size: 0.78em; color: var(--muted); margin-bottom: 4px; font-style: italic; max-height: 40px; overflow: hidden; }
.lv-event-task { font-size: 0.8em; color: var(--purple); margin-bottom: 2px; }
.lv-task-link { color: var(--purple); text-decoration: none; }
.lv-task-link:hover { text-decoration: underline; }
.lv-event.lv-event-active { border-left: 3px solid var(--green); background: #F0FDF4; }
.lv-stop-btn {
  margin-left: auto; border: 1px solid #FCA5A5; background: #FEF2F2; color: #DC2626;
  border-radius: 4px; font-size: 0.75em; font-weight: 600; padding: 2px 10px;
  cursor: pointer; transition: all .15s;
}
.lv-stop-btn:hover { background: #FEE2E2; border-color: #EF4444; }

/* ── Chat Tab (.ct-) ── */
.ct-layout {
  display: flex; height: calc(100vh - 140px); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; background: white;
}
.ct-sidebar {
  width: 220px; min-width: 220px; background: white; border-right: 1px solid var(--border);
  overflow-y: auto; padding: 0;
}
.ct-sidebar-title {
  font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); padding: 14px 16px 8px;
}
.ct-session {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.ct-session:hover { background: #FAFAFA; }
.ct-session.active { background: var(--purple-light); }
.ct-session-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0;
  animation: ct-pulse 2s ease-in-out infinite;
}
@keyframes ct-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.ct-session-info { flex: 1; min-width: 0; }
.ct-session-name { font-size: 0.88em; font-weight: 600; color: var(--text); }
.ct-session-task {
  font-size: 0.74em; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ct-empty-sidebar {
  padding: 24px 16px; text-align: center; color: var(--muted); font-size: 0.84em;
}
.ct-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.ct-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.ct-header-name { font-weight: 700; font-size: 1.05em; color: var(--purple); }
.ct-header-role {
  font-size: 0.74em; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: var(--purple-light); color: var(--purple);
}
.ct-header-time { font-size: 0.78em; color: var(--muted); margin-left: auto; }
.ct-msg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ct-msg-img {
  max-width: 300px; max-height: 200px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); transition: transform .15s;
}
.ct-msg-img:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.ct-expand-btn {
  border: 1px solid var(--border); background: white; border-radius: 4px;
  font-size: 1em; padding: 2px 8px; cursor: pointer; color: var(--muted);
  margin-left: 8px; transition: all .15s;
}
.ct-expand-btn:hover { background: var(--purple-light); color: var(--purple); }

/* Fullscreen — keeps topbar visible */
.ct-layout.ct-fullscreen {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  z-index: 100; background: var(--bg);
  border: none; border-radius: 0; max-height: none; height: calc(100vh - 52px);
}
.ct-layout.ct-fullscreen .ct-sidebar { height: calc(100vh - 52px); }
.ct-layout.ct-fullscreen .ct-main { height: calc(100vh - 52px); }
.ct-layout.ct-fullscreen .ct-messages { max-height: none; height: calc(100vh - 162px); }
.ct-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.ct-msg { max-width: 75%; }
.ct-msg-user { align-self: flex-end; }
.ct-msg-agent { align-self: flex-start; }
.ct-msg-label {
  font-size: 0.68em; font-weight: 700; text-transform: uppercase; margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
}
.ct-msg-user .ct-msg-label { color: var(--purple); justify-content: flex-end; }
.ct-msg-agent .ct-msg-label { color: var(--muted); }
.ct-msg-time { font-weight: 400; font-size: 0.92em; color: var(--muted); }
.ct-msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 0.88em;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.ct-msg-user .ct-msg-bubble {
  background: var(--purple-light); border-bottom-right-radius: 4px;
}
.ct-msg-agent .ct-msg-bubble {
  background: white; border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.ct-msg-expand {
  border: none; background: none; color: var(--purple); font-size: 0.78em;
  font-weight: 600; cursor: pointer; padding: 4px 0; margin-top: 2px;
}
.ct-msg-expand:hover { text-decoration: underline; }
.ct-input {
  padding: 12px 20px; border-top: 1px solid var(--border); display: flex;
  align-items: center; gap: 10px; flex-shrink: 0;
}
.ct-input textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-family: inherit; font-size: 0.88em;
  min-height: 42px; max-height: 160px; overflow-y: auto;
  background: white; color: var(--text); line-height: 1.5;
}
.ct-input textarea:focus { outline: none; border-color: var(--purple); }
.ct-input button {
  border: none; background: var(--purple); color: white; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; font-size: 0.86em; cursor: pointer;
  transition: background .15s;
}
.ct-input button:hover { background: var(--purple-dark); }
.ct-no-selection {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.92em; flex-direction: column; gap: 8px;
}
.lv-agent-type-badge {
  font-size: 0.68em; font-weight: 600; padding: 1px 6px; border-radius: 3px;
  background: var(--purple-light); color: var(--purple); margin-left: 4px;
}
.lv-event-sid-row { display: flex; align-items: center; gap: 8px; }

/* Session ID display + copy button */
.lv-sid-code {
  font-family: 'SF Mono', Menlo, monospace; font-size: 0.75em;
  background: #F3F4F6; padding: 2px 6px; border-radius: 4px; color: var(--muted);
  user-select: all; word-break: break-all;
}
.lv-sid-small { font-size: 0.68em; }
.lv-copy-btn {
  border: 1px solid var(--border); background: white; border-radius: 4px;
  font-size: 0.72em; padding: 2px 8px; cursor: pointer; color: var(--muted);
  transition: all .15s; flex-shrink: 0;
}
.lv-copy-btn:hover { background: var(--purple-light); color: var(--purple); }
.lv-copy-sm { font-size: 0.8em; padding: 1px 5px; }
.lv-agent-card-sid { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.lv-since { color: var(--muted); font-size: 0.85em; }

/* Org (Live version) */
.lv-org {
  margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 0;
}
.lv-org-level {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.lv-org-connector {
  width: 2px; height: 20px; background: var(--border); margin: 0 auto;
}
.lv-org-node {
  width: 110px; text-align: center; padding: 10px 8px; border-radius: 10px;
  background: white; border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(60,14,107,.04); transition: all .15s;
  position: relative;
}
.lv-org-node.lv-org-active { border-color: var(--green); }
.lv-org-node .lv-org-name { font-weight: 700; color: var(--purple); font-size: 0.85em; }
.lv-org-node .lv-org-role { color: var(--muted); font-size: 0.68em; line-height: 1.3; }
.lv-org-status {
  width: 8px; height: 8px; border-radius: 50%; position: absolute;
  top: 8px; right: 8px;
}
.lv-org-status.active { background: var(--green); animation: lv-pulse-anim 1.5s ease-in-out infinite; }
.lv-org-status.idle { background: #D1D5DB; }
.lv-org-branches {
  display: flex; align-items: flex-start; justify-content: center; gap: 16px;
  position: relative; flex-wrap: wrap;
}
.lv-org-branches::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: calc(100% - 80px); height: 2px; background: var(--border);
}
.lv-org-branch {
  display: flex; flex-direction: column; align-items: center;
}
.lv-org-branch-line {
  width: 2px; height: 14px; background: var(--border);
}
.lv-section-title {
  font-size: 1.05em; font-weight: 700; color: var(--text); margin: 28px 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.lv-section-subtitle {
  font-size: 0.84em; color: var(--muted); margin-bottom: 4px;
}

/* === Kanban: full-width + cards maiores === */
.ds-content:has(.kb-board) { max-width: none; }
.kb-board { gap: 16px; margin-top: 16px; }
.kb-col { padding: 16px; min-height: 320px; }
.kb-col-header { font-size: 0.86em; padding: 6px 8px 14px; }
.kb-card { padding: 14px 16px; margin-bottom: 10px; font-size: 0.92em; border-radius: 8px; }
.kb-card-title { font-size: 0.98em; line-height: 1.4; margin-bottom: 8px; }
.kb-card-tags { gap: 6px; margin-bottom: 8px; }
.kb-tag { font-size: 0.72em; padding: 2px 8px; }
.kb-card-footer { margin-top: 10px; }
.kb-card-avatar { width: 24px; height: 24px; font-size: 0.66em; }
.kb-card-date { font-size: 0.75em; }
/* === Project Rich Page === */
.pj-page-rich { max-width: none; padding: 32px 48px 80px; }

.pj-hero { padding: 24px 0 18px; border-bottom: 1px solid #E5E7EB; margin-bottom: 28px; }
.pj-hero-title { font-size: 2.2em; font-weight: 800; color: var(--text); margin: 8px 0 8px; line-height: 1.1; }
.pj-hero-subtitle { color: var(--muted); font-size: 1em; margin: 0 0 16px; max-width: 800px; }
.pj-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pj-quick-action {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--purple-light); color: var(--purple); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; font-size: 0.82em; font-weight: 600;
  border: 1px solid transparent; transition: all .15s;
}
.pj-quick-action:hover { border-color: var(--purple); background: white; }
.pj-quick-action-static { background: #F3F4F6; color: #374151; cursor: default; }
.pj-quick-action-static:hover { border-color: transparent; background: #F3F4F6; }

.pj-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px;
}
@media (max-width: 900px) { .pj-info-grid { grid-template-columns: 1fr; } }

.pj-info-card {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px; padding: 18px 20px;
}
.pj-info-card-title {
  font-size: 0.86em; font-weight: 700; color: var(--text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.pj-info-card p { margin: 0; color: #374151; font-size: 0.92em; line-height: 1.55; }

.pj-kv-list { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: 0.88em; }
.pj-kv-list dt { color: var(--muted); font-weight: 600; }
.pj-kv-list dd { margin: 0; color: var(--text); word-break: break-word; }
.pj-kv-2col { grid-template-columns: 130px 1fr 130px 1fr; }
@media (max-width: 900px) { .pj-kv-2col { grid-template-columns: 130px 1fr; } }

.pj-section-block {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 22px 24px; margin-bottom: 18px;
}
.pj-section-h {
  font-size: 1.05em; font-weight: 700; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

.pj-tech-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-tech-badge {
  font-size: 0.78em; font-weight: 600; padding: 4px 10px;
  border: 1.5px solid; border-radius: 6px; background: white;
}

.pj-swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pj-swatch { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: #F9FAFB; }
.pj-swatch-color { width: 40px; height: 40px; border-radius: 8px; border: 1px solid #E5E7EB; flex-shrink: 0; }
.pj-swatch-meta { display: flex; flex-direction: column; }
.pj-swatch-label { font-size: 0.74em; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.3px; }
.pj-swatch-hex { font-family: ui-monospace, monospace; font-size: 0.85em; color: var(--text); }

.pj-features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .pj-features-grid { grid-template-columns: 1fr; } }
.pj-feature-card {
  border: 1px solid #E5E7EB; border-radius: 10px; padding: 14px 16px;
  background: linear-gradient(180deg, #FAFAFA, white);
}
.pj-feature-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pj-feature-icon { font-size: 1.2em; }
.pj-feature-title { font-weight: 700; color: var(--text); font-size: 0.96em; }
.pj-feature-path {
  margin-left: auto; font-size: 0.74em; color: var(--purple);
  background: var(--purple-light); padding: 2px 8px; border-radius: 4px;
}
.pj-bullets { margin: 0; padding-left: 18px; color: #374151; font-size: 0.86em; line-height: 1.65; }
.pj-bullets li { margin-bottom: 2px; }

.pj-code-block {
  background: #1F2937; color: #E5E7EB; border-radius: 8px;
  padding: 14px 18px; font-family: ui-monospace, monospace; font-size: 0.82em;
  line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0;
}

.pj-issues-list { display: flex; flex-direction: column; gap: 10px; }
.pj-issue {
  background: white; border: 1px solid #E5E7EB; border-left-width: 4px;
  border-radius: 8px; padding: 12px 16px;
}
.pj-issue-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pj-issue-sev {
  font-size: 0.7em; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pj-issue-title { font-weight: 700; color: var(--text); font-size: 0.92em; }
.pj-issue-since { font-size: 0.76em; color: var(--muted); margin-left: auto; }
.pj-issue-desc { margin: 0; color: #374151; font-size: 0.86em; line-height: 1.55; }

.pj-files-list { display: flex; flex-direction: column; gap: 4px; }
.pj-file-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: center;
  padding: 6px 10px; border-radius: 6px;
}
.pj-file-row:hover { background: #F9FAFB; }
.pj-file-path {
  font-family: ui-monospace, monospace; font-size: 0.84em; color: var(--purple);
  background: var(--purple-light); padding: 2px 8px; border-radius: 4px;
}
.pj-file-desc { color: #6B7280; font-size: 0.85em; }
@media (max-width: 700px) { .pj-file-row { grid-template-columns: 1fr; } }

.pj-pill {
  display: inline-block; font-size: 0.78em; padding: 2px 8px;
  background: #F3F4F6; color: #374151; border-radius: 4px;
  font-family: ui-monospace, monospace; margin: 1px;
}
/* === View Toggle === */
.pj-view-toggle { display: flex; gap: 4px; background: #F3F4F6; padding: 4px; border-radius: 8px; }
.pj-view-btn {
  background: transparent; border: none; padding: 6px 12px; border-radius: 6px;
  font-size: 0.82em; font-weight: 600; cursor: pointer; color: var(--muted);
  font-family: inherit; transition: all .15s;
}
.pj-view-btn.active { background: white; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pj-view-btn:hover:not(.active) { color: var(--text); }

/* === HUMAN VIEW: HERO === */
.pj-hv-hero {
  margin: 0 -48px 24px; padding: 56px 48px 48px; color: white; position: relative;
  border-radius: 0;
}
.pj-hv-hero-inner { max-width: 1000px; }
.pj-hv-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
  padding: 5px 12px; border-radius: 999px; font-size: 0.78em; font-weight: 600;
  margin-bottom: 14px;
}
.pj-hv-hero-title { font-size: 3em; font-weight: 800; margin: 0 0 8px; line-height: 1.05; color: white; letter-spacing: -1px; }
.pj-hv-hero-sub { font-size: 1.1em; margin: 0 0 16px; opacity: 0.92; max-width: 760px; }
.pj-hv-hero-objective { font-size: 0.95em; margin: 0 0 24px; opacity: 0.86; line-height: 1.55; max-width: 760px; }
.pj-hv-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.pj-hv-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 0.9em;
  text-decoration: none; transition: all .15s;
}
.pj-hv-cta.primary { background: white; color: #1F2937; }
.pj-hv-cta.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.pj-hv-cta.ghost { background: rgba(255,255,255,0.18); color: white; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.3); }
.pj-hv-cta.ghost:hover { background: rgba(255,255,255,0.28); }

/* === HUMAN VIEW: STATS === */
.pj-hv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 800px) { .pj-hv-stats { grid-template-columns: repeat(2, 1fr); } }
.pj-hv-stat {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 20px; text-align: center;
}
.pj-hv-stat.warn { background: #FEF3C7; border-color: #FDE68A; }
.pj-hv-stat-num { font-size: 2.4em; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; letter-spacing: -1px; }
.pj-hv-stat.warn .pj-hv-stat-num { color: #92400E; }
.pj-hv-stat-label { font-size: 0.78em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.pj-hv-stat.warn .pj-hv-stat-label { color: #92400E; }

/* === HUMAN VIEW: WARNING BANNER === */
.pj-hv-warn-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: #FEF3C7; border: 1px solid #FCD34D; border-left: 4px solid #D97706;
  padding: 16px 20px; border-radius: 10px; margin-bottom: 24px;
}
.pj-hv-warn-icon { font-size: 1.6em; line-height: 1; }
.pj-hv-warn-content { flex: 1; }
.pj-hv-warn-title { font-weight: 700; color: #92400E; margin-bottom: 6px; font-size: 0.95em; }
.pj-hv-warn-item { font-size: 0.86em; color: #78350F; margin-top: 3px; }

/* === HUMAN VIEW: SECTION === */
.pj-hv-section { margin-bottom: 32px; }
.pj-hv-section-title { font-size: 1.3em; font-weight: 800; color: var(--text); margin: 0 0 14px; letter-spacing: -0.3px; }

/* === HUMAN VIEW: FEATURES === */
.pj-hv-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pj-hv-feature {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 22px 20px; transition: all .15s;
}
.pj-hv-feature:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.pj-hv-feature-icon { font-size: 2.4em; margin-bottom: 10px; line-height: 1; }
.pj-hv-feature h3 { margin: 0 0 6px; font-size: 1em; color: var(--text); }
.pj-hv-feature p { margin: 0; color: var(--muted); font-size: 0.85em; line-height: 1.5; }

/* === HUMAN VIEW: STACK GROUPED === */
.pj-hv-stack-groups { display: flex; flex-direction: column; gap: 12px; }
.pj-hv-stack-group { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; }
.pj-hv-stack-label { font-size: 0.78em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding-top: 6px; }
.pj-hv-stack-items { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-hv-tech {
  font-size: 0.84em; font-weight: 600; padding: 4px 12px;
  border: 1.5px solid; border-radius: 999px;
}
@media (max-width: 700px) { .pj-hv-stack-group { grid-template-columns: 1fr; } }

/* === HUMAN VIEW: CLIENT === */
.pj-hv-client-card {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 24px; display: flex; gap: 22px; align-items: flex-start;
}
.pj-hv-client-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.6em; font-weight: 800; letter-spacing: -1px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.pj-hv-client-info { flex: 1; }
.pj-hv-client-info h3 { margin: 0 0 4px; font-size: 1.2em; color: var(--text); }
.pj-hv-client-sub { margin: 0 0 8px; color: var(--muted); font-size: 0.88em; font-weight: 600; }
.pj-hv-client-line { margin: 0 0 12px; font-size: 0.88em; color: #374151; }
.pj-hv-client-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pj-hv-pill-link {
  display: inline-flex; align-items: center; gap: 4px;
  background: #F3F4F6; color: #374151; text-decoration: none;
  padding: 6px 14px; border-radius: 999px; font-size: 0.82em; font-weight: 600;
  transition: all .15s;
}
.pj-hv-pill-link:hover { background: var(--purple-light); color: var(--purple); }

/* === HUMAN VIEW: DEPLOY FLOW === */
.pj-hv-deploy-flow {
  display: flex; gap: 8px; align-items: stretch; overflow-x: auto;
  padding: 18px; background: white; border: 1px solid #E5E7EB; border-radius: 12px;
}
.pj-hv-deploy-step {
  flex: 1; min-width: 140px; text-align: center; padding: 14px 12px;
  background: #F9FAFB; border-radius: 10px;
}
.pj-hv-deploy-icon { font-size: 2em; margin-bottom: 8px; line-height: 1; }
.pj-hv-deploy-name { font-weight: 700; font-size: 0.92em; color: var(--text); margin-bottom: 4px; }
.pj-hv-deploy-detail { font-size: 0.78em; color: var(--muted); word-break: break-word; }
.pj-hv-deploy-arrow { display: flex; align-items: center; color: #D1D5DB; font-size: 1.5em; font-weight: 700; }
.pj-hv-deploy-rebuild {
  margin-top: 12px; font-size: 0.84em; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pj-hv-deploy-rebuild code {
  background: #1F2937; color: #E5E7EB; padding: 4px 10px; border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 0.85em;
}

/* === HUMAN VIEW: FINAL CTA === */
.pj-hv-final-cta { padding: 32px 28px; border-radius: 14px; margin-top: 16px; }
.pj-hv-final-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pj-hv-final-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: 0.9em; text-decoration: none;
  border: 2px solid; transition: all .15s;
}
.pj-hv-final-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
/* === INFRA ROW (GitHub + VPS + Produção — both views) === */
.pj-hv-infra-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px;
}
@media (max-width: 800px) { .pj-hv-infra-row { grid-template-columns: 1fr; } }
.pj-hv-infra-card {
  display: flex; align-items: center; gap: 16px;
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 18px 20px; text-decoration: none; transition: all .15s;
}
a.pj-hv-infra-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); border-color: #D1D5DB; }
.pj-hv-infra-icon { font-size: 2.1em; line-height: 1; flex-shrink: 0; }
.pj-hv-infra-content { flex: 1; min-width: 0; }
.pj-hv-infra-label { font-size: 0.72em; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.pj-hv-infra-value { font-size: 1em; font-weight: 700; color: var(--text); margin-bottom: 4px; font-family: ui-monospace, monospace; word-break: break-all; }
.pj-hv-infra-meta { font-size: 0.78em; color: var(--muted); }
/* === TOP GRID: Cliente + Status + Pendências === */
.pj-hv-top-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 1000px) { .pj-hv-top-grid { grid-template-columns: 1fr; } }
.pj-hv-top-col { display: flex; flex-direction: column; }
.pj-hv-top-col .pj-hv-section-title { font-size: 1.1em; margin: 0 0 10px; }

.pj-hv-client-card-compact {
  flex-direction: column; gap: 12px; align-items: flex-start;
  padding: 18px; flex: 1;
}
.pj-hv-client-card-compact .pj-hv-client-avatar { width: 56px; height: 56px; font-size: 1.3em; }
.pj-hv-client-card-compact .pj-hv-client-info h3 { font-size: 1.05em; }

.pj-hv-flags-card {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 16px 20px; flex: 1; display: flex; flex-direction: column; gap: 0;
}
.pj-hv-flag {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #F3F4F6;
}
.pj-hv-flag:last-child { border-bottom: none; }
.pj-hv-flag-icon { font-size: 1.15em; flex-shrink: 0; }
.pj-hv-flag.done .pj-hv-flag-label { color: var(--text); font-weight: 600; font-size: 0.94em; }
.pj-hv-flag.pending .pj-hv-flag-label { color: var(--muted); font-size: 0.94em; }

.pj-hv-pending-card {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 18px 22px; flex: 1; display: flex; flex-direction: column;
  justify-content: center; gap: 18px;
}
.pj-hv-pending-row { display: flex; align-items: baseline; gap: 12px; }
.pj-hv-pending-num { font-size: 2.6em; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -1px; }
.pj-hv-pending-row.critical .pj-hv-pending-num { color: #DC2626; }
.pj-hv-pending-label { font-size: 0.88em; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.pj-hv-pending-row.critical .pj-hv-pending-label { color: #B91C1C; }
/* === Tech logos (Simple Icons CDN) === */
.pj-hv-tech-logo {
  width: 30px; height: 30px; object-fit: contain; margin-bottom: 10px;
  display: block;
}
/* === Cards vinculados toggle (human view) === */
.pj-linked-toggle {
  background: white; border: 1px solid #E5E7EB; border-radius: 12px;
  margin-bottom: 28px; overflow: hidden;
}
.pj-linked-summary {
  list-style: none;
  padding: 14px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text);
  font-size: 1em; user-select: none;
}
.pj-linked-summary::-webkit-details-marker { display: none; }
.pj-linked-summary::before {
  content: '▸'; color: var(--muted); font-size: 0.9em;
  display: inline-block; transition: transform .15s;
}
.pj-linked-toggle[open] .pj-linked-summary::before { transform: rotate(90deg); }
.pj-linked-summary:hover { background: #FAFAFA; }
.pj-linked-count {
  margin-left: auto;
  background: var(--purple-light); color: var(--purple);
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 700;
}
.pj-linked-body { padding: 0 20px 20px; border-top: 1px solid #F3F4F6; }
/* === Commits GitHub === */
.pj-commits-loading { padding: 20px; color: var(--muted); font-size: 0.88em; text-align: center; }
.pj-commits-error { padding: 14px 16px; background: #FEE2E2; color: #991B1B; border-radius: 8px; font-size: 0.86em; line-height: 1.45; }
.pj-commits-list { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.pj-commit-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border-radius: 8px; background: #FAFAFA;
  text-decoration: none; transition: background .15s;
}
.pj-commit-item:hover { background: #F3F4F6; }
.pj-commit-sha {
  font-family: ui-monospace, monospace; background: var(--purple-light);
  color: var(--purple); padding: 2px 8px; border-radius: 4px;
  font-size: 0.78em; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.pj-commit-msg { flex: 1; font-size: 0.88em; color: var(--text); font-weight: 500; line-height: 1.4; }
.pj-commit-meta { color: var(--muted); font-size: 0.76em; margin-top: 3px; font-weight: 400; }
/* === Commit detail (diff inline) === */
.pj-commit-row { background: #FAFAFA; border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.pj-commit-row[open] { background: white; border: 1px solid #E5E7EB; }
.pj-commit-summary {
  list-style: none; cursor: pointer; padding: 10px 12px;
  display: flex; gap: 12px; align-items: flex-start;
  transition: background .12s;
}
.pj-commit-summary::-webkit-details-marker { display: none; }
.pj-commit-summary:hover { background: #F3F4F6; }
.pj-commit-row[open] .pj-commit-summary { border-bottom: 1px solid #E5E7EB; background: #F9FAFB; }
.pj-commit-detail { padding: 12px 14px; }
.pj-commit-stats-bar {
  font-size: 0.84em; color: var(--muted); margin-bottom: 12px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.pj-commit-fullmsg {
  background: #F9FAFB; border-left: 3px solid #D1D5DB;
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 0.86em; color: #374151;
  white-space: pre-wrap; font-family: ui-monospace, monospace; line-height: 1.5;
  border-radius: 4px;
}
.pj-commit-files { display: flex; flex-direction: column; gap: 10px; }
.pj-commit-file { border: 1px solid #E5E7EB; border-radius: 6px; overflow: hidden; }
.pj-commit-file-head {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: #F9FAFB; border-bottom: 1px solid #E5E7EB;
  font-size: 0.82em; flex-wrap: wrap;
}
.pj-commit-filename {
  font-family: ui-monospace, monospace; font-size: 1em;
  color: var(--text); flex: 1; min-width: 0; word-break: break-all;
  background: transparent; padding: 0;
}
.pj-commit-file-status {
  font-size: 0.74em; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase;
}
.pj-status-added { background: #D1FAE5; color: #065F46; }
.pj-status-modified { background: #FEF3C7; color: #92400E; }
.pj-status-removed { background: #FEE2E2; color: #991B1B; }
.pj-status-renamed { background: #DBEAFE; color: #1E40AF; }
.pj-commit-file-stats { font-size: 0.84em; font-weight: 600; }
.pj-commit-patch {
  margin: 0; padding: 8px 12px;
  font-family: ui-monospace, monospace; font-size: 0.78em; line-height: 1.5;
  background: #FAFAFA; overflow-x: auto; max-height: 480px;
  white-space: pre;
}
.pj-commit-patch span { display: block; padding: 0 4px; }
.pj-commit-patch .diff-add { background: #DCFCE7; color: #14532D; }
.pj-commit-patch .diff-del { background: #FEE2E2; color: #7F1D1D; }
.pj-commit-patch .diff-hunk { background: #E0E7FF; color: #3730A3; font-weight: 600; }
.pj-commit-patch .diff-ctx { color: #4B5563; }
.pj-commit-no-patch { padding: 14px; color: var(--muted); font-size: 0.86em; text-align: center; }
/* === Collapsible sections (Cliente, Produção, O que tem, Stack) === */
.pj-hv-collapsible { margin-bottom: 28px; }
.pj-hv-collapsible-summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center;
  margin-bottom: 14px;
}
.pj-hv-collapsible-summary::-webkit-details-marker { display: none; }
.pj-hv-collapsible-summary::before {
  content: '▾'; color: var(--muted); font-size: 0.7em;
  margin-right: 8px; transition: transform .15s; line-height: 1; flex-shrink: 0;
}
.pj-hv-collapsible:not([open]) > .pj-hv-collapsible-summary::before {
  transform: rotate(-90deg);
}
.pj-hv-collapsible-summary .pj-hv-section-title { margin: 0; }
.pj-hv-collapsible:not([open]) > .pj-hv-collapsible-summary { margin-bottom: 0; }
/* === Mock up (iframe da produção) === */
.pj-mockup-wrap { padding-top: 8px; }
.pj-mockup-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; background: #F3F4F6; border: 1px solid #E5E7EB; border-bottom: none;
  border-radius: 8px 8px 0 0; font-size: 0.82em;
}
.pj-mockup-url { font-family: ui-monospace, monospace; color: var(--muted); word-break: break-all; }
.pj-mockup-open { color: var(--purple); text-decoration: none; font-weight: 600; white-space: nowrap; }
.pj-mockup-open:hover { text-decoration: underline; }
.pj-mockup-iframe {
  width: 100%; height: 70vh; min-height: 480px; border: 1px solid #E5E7EB; display: block;
  background: white; border-radius: 0;
}
.pj-mockup-warn {
  font-size: 0.76em; color: var(--muted); padding: 8px 12px;
  font-style: italic; background: #FAFAFA;
  border: 1px solid #E5E7EB; border-top: none;
  border-radius: 0 0 8px 8px;
}
/* === Mock up fullscreen === */
.pj-mockup-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.pj-mockup-fullscreen-btn {
  background: white; border: 1px solid #E5E7EB; border-radius: 6px;
  padding: 4px 10px; font-size: 0.86em; font-weight: 600; cursor: pointer;
  color: var(--text); font-family: inherit; transition: all .12s;
}
.pj-mockup-fullscreen-btn:hover { border-color: var(--purple); color: var(--purple); }

.pj-mockup-wrap.fullscreen {
  position: fixed; inset: 0; z-index: 9999;
  background: white; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.pj-mockup-wrap.fullscreen .pj-mockup-bar { border-radius: 0; border-bottom: 1px solid #E5E7EB; }
.pj-mockup-wrap.fullscreen .pj-mockup-iframe {
  flex: 1; height: auto; min-height: 0; border: none; border-radius: 0;
}
.pj-mockup-wrap.fullscreen .pj-mockup-warn { display: none; }
/* === Project card: status prod + categorias + quick links === */
.pj-badge-prod { background: #D1FAE5; color: #065F46; }
.pj-badge-cat-cliente { background: #DBEAFE; color: #1E40AF; }
.pj-badge-cat-interno { background: #FEF3C7; color: #92400E; }
.pj-card-links { display: flex; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
.pj-card-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78em; color: var(--purple); text-decoration: none;
  background: var(--purple-light); padding: 3px 10px; border-radius: 999px;
  font-weight: 600; transition: all .12s;
}
.pj-card-link:hover { background: var(--purple); color: white; }
/* === Drag & drop ordenação de project cards === */
.pj-card { cursor: grab; }
.pj-card:active { cursor: grabbing; }
.pj-card-dragging { opacity: 0.4; transform: scale(0.97); }
.pj-card-drop-before { box-shadow: -4px 0 0 var(--purple); }
.pj-card-drop-after  { box-shadow: 4px 0 0 var(--purple); }
/* === Sub-projects list (dentro de Gestão > Projetos) === */
.pj-subprojs-list { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.pj-subproj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #FAFAFA; border: 1px solid #E5E7EB;
  border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 0.92em; color: var(--text);
  width: 100%; text-align: left; transition: all .12s;
}
.pj-subproj-item:hover { background: var(--purple-light); border-color: var(--purple); transform: translateX(2px); }
.pj-subproj-name { font-weight: 700; flex: 1; }
.pj-subproj-arrow { color: var(--muted); font-size: 1.1em; transition: transform .12s; }
.pj-subproj-item:hover .pj-subproj-arrow { color: var(--purple); transform: translateX(3px); }
/* === Sub-project mini cards com preview iframe === */
.pj-subprojs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 12px;
  padding-top: 12px;
}
.pj-subproj-card {
  display: flex; align-items: stretch; gap: 0;
  background: white; border: 1px solid #E5E7EB;
  border-radius: 10px; overflow: hidden;
  cursor: pointer; font-family: inherit; text-align: left;
  padding: 0; width: 100%; transition: all .15s;
}
.pj-subproj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  border-color: var(--purple);
}
.pj-subproj-preview {
  width: 200px; height: 130px; flex-shrink: 0;
  overflow: hidden; position: relative;
  background: #F3F4F6;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid #E5E7EB;
}
.pj-subproj-preview iframe {
  flex-shrink: 0;
  width: 1280px; height: 832px;
  transform: scale(0.15625); transform-origin: 0 0;
  border: 0; pointer-events: none;
  position: absolute; top: 0; left: 0;
}
.pj-subproj-preview-empty { font-size: 2em; color: var(--muted); }
.pj-subproj-info {
  flex: 1; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 5px;
  min-width: 0;
}
.pj-subproj-title { font-weight: 700; font-size: 1em; color: var(--text); }
.pj-subproj-sub {
  font-size: 0.78em; color: var(--muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pj-subproj-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.pj-subproj-url {
  font-size: 0.74em; color: var(--muted);
  font-family: ui-monospace, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: auto;
}
.pj-subproj-arrow {
  display: flex; align-items: center; padding: 0 16px;
  color: var(--muted); font-size: 1.3em; transition: all .15s;
}
.pj-subproj-card:hover .pj-subproj-arrow {
  color: var(--purple); transform: translateX(3px);
}