/* ============================================================
   LAPA — Board (Kanban interno)
   Design premium: dark topbar, colunas com gradiente sutil,
   cards com avatar, badge de urgência, micro-animações.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --ink:     #0a0a0a;
  --paper:   #f2f2f3;
  --paper-2: #e8e8ea;
  --paper-3: #dededf;
  --white:   #ffffff;
  --gray-0:  #b0b0b5;
  --gray-1:  #8a8a8f;
  --gray-2:  #5a5a5f;
  --green:        #1fd65f;
  --green-dim:    rgba(31,214,95,0.13);
  --green-glow:   rgba(31,214,95,0.22);
  --amber:        #f59e0b;
  --red:          #e0473a;
  --violet:       #7c6af0;
  --line:   rgba(10,10,10,0.11);
  --line-2: rgba(10,10,10,0.06);
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.10);
  --shadow-drag: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  --display: "Space Grotesk","Helvetica Neue",Arial,sans-serif;
  --mono:    "Space Mono",ui-monospace,Menlo,monospace;
  --radius-card: 14px;
  --radius-col:  18px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: var(--paper); font-family: var(--display); color: var(--ink); -webkit-font-smoothing: antialiased; overflow: hidden; }
::selection { background: var(--green); color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; }

/* ================================================================
   TOPBAR
   ================================================================ */
.bd-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px,2.5vw,36px);
  height: 58px;
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.bd-top-left  { display: flex; align-items: center; gap: 14px; }
.bd-top-right { display: flex; align-items: center; gap: 8px; }

.bd-logo { height: 21px; filter: invert(1); opacity: 0.9; }
.bd-top-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.12); }
.bd-top-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(244,244,245,0.42);
}

/* Filtros de responsável */
.bd-filter-pill {
  display: flex; gap: 4px; align-items: center;
  background: rgba(255,255,255,0.07); border-radius: 100px; padding: 3px 4px;
}
.bd-filter-btn {
  font-size: 11px; font-family: var(--mono); padding: 5px 11px; border-radius: 100px;
  border: none; background: transparent; color: rgba(244,244,245,0.55);
  transition: all .18s; letter-spacing: 0.05em;
}
.bd-filter-btn.active { background: rgba(255,255,255,0.14); color: var(--paper); }
.bd-filter-btn:hover:not(.active) { color: var(--paper); }

/* Search */
.bd-search-wrap {
  position: relative; display: flex; align-items: center;
}
.bd-search-wrap svg { position: absolute; left: 11px; width: 14px; height: 14px; color: rgba(255,255,255,0.3); pointer-events: none; }
#bd-search {
  font-family: var(--display); font-size: 13px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px; color: var(--paper);
  padding: 7px 14px 7px 32px; width: 180px;
  transition: all .2s; outline: none;
}
#bd-search::placeholder { color: rgba(255,255,255,0.3); }
#bd-search:focus { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.22); width: 220px; }

/* Buttons */
.bd-btn {
  font-size: 13px; font-weight: 500; border-radius: 100px;
  padding: 8px 18px; border: 1px solid rgba(244,244,245,0.25);
  background: transparent; color: var(--paper);
  transition: all .18s; display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; line-height: 1;
}
.bd-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }
.bd-btn.primary {
  background: var(--paper); color: var(--ink); border-color: var(--paper);
  font-weight: 600;
}
.bd-btn.primary:hover { background: var(--green); border-color: var(--green); color: var(--ink); }
.bd-btn.sm { padding: 6px 14px; font-size: 12px; }
.bd-btn svg { width: 14px; height: 14px; }

/* Contagem */
#bd-proj-count {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: rgba(244,244,245,0.3); white-space: nowrap;
}

/* ================================================================
   LAYOUT PRINCIPAL
   ================================================================ */
.bd-wrap {
  display: flex;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* ================================================================
   KANBAN
   ================================================================ */
.bd-kanban {
  flex: 1; display: flex; gap: 10px;
  padding: 18px 16px 24px;
  overflow-x: auto; overflow-y: hidden;
  align-items: flex-start;
  scroll-snap-type: x proximity;
}
.bd-kanban::-webkit-scrollbar { height: 5px; }
.bd-kanban::-webkit-scrollbar-track { background: transparent; }
.bd-kanban::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ================================================================
   COLUNAS
   ================================================================ */
.bd-col {
  flex: 0 0 280px;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border-radius: var(--radius-col);
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: 100%;
  scroll-snap-align: start;
  transition: border-color .2s, box-shadow .2s;
}
.bd-col.drag-over {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-glow), var(--shadow-md);
}

/* Cabeçalho da coluna */
.bd-col-head {
  padding: 14px 14px 11px;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--line-2);
  flex: 0 0 auto;
}
.bd-col-accent {
  width: 3px; height: 20px; border-radius: 100px; flex: 0 0 auto;
}
.bd-col-label {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; flex: 1;
  color: var(--gray-2);
}
.bd-col-count {
  font-family: var(--mono); font-size: 11px;
  background: var(--paper-3); color: var(--gray-1);
  padding: 2px 7px; border-radius: 100px; letter-spacing: 0.04em;
  min-width: 24px; text-align: center;
}

/* Lista de cards */
.bd-cards {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 10px; overflow-y: auto;
  min-height: 60px;
}
.bd-cards::-webkit-scrollbar { width: 3px; }
.bd-cards::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* Botão adicionar */
.bd-col-add { padding: 8px 10px 10px; flex: 0 0 auto; }
.bd-col-add-btn {
  width: 100%; padding: 9px;
  border: 1.5px dashed var(--line); background: transparent;
  border-radius: 10px; font-size: 12px; color: var(--gray-1);
  transition: all .18s; letter-spacing: 0.02em;
}
.bd-col-add-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--white); }

/* ================================================================
   CARDS
   ================================================================ */
.bd-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 13px 13px 11px;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s, border-color .18s, opacity .15s;
  position: relative;
  user-select: none;
  animation: card-in .22s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bd-card:hover {
  border-color: rgba(10,10,10,0.22);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.bd-card.dragging {
  opacity: 0.35;
  border-style: dashed;
  transform: scale(0.98);
}
.bd-card.drag-ghost {
  opacity: 1;
  box-shadow: var(--shadow-drag);
  transform: rotate(1.5deg) scale(1.02);
}

/* Número */
.bd-card-num {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--gray-0); margin-bottom: 6px; text-transform: uppercase;
}

/* Nome */
.bd-card-name {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.3; margin-bottom: 4px;
}

/* Empresa */
.bd-card-co {
  font-size: 12.5px; color: var(--gray-2); margin-bottom: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Serviços */
.bd-card-svcs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.bd-chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 100px;
  background: var(--paper-2); color: var(--gray-2);
  white-space: nowrap;
}

/* Rodapé */
.bd-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px;
}
.bd-card-owner {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; color: var(--gray-1);
}
.bd-card-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex: 0 0 auto;
}
.bd-card-avatar.vitor    { background: #e8f5e0; }
.bd-card-avatar.fernando { background: #e8edf8; }

.bd-card-due {
  font-family: var(--mono); font-size: 10px;
  display: flex; align-items: center; gap: 4px;
  color: var(--gray-1); white-space: nowrap;
}
.bd-card-due.overdue {
  color: var(--red);
  background: rgba(224,71,58,0.08); padding: 2px 7px; border-radius: 100px;
}
.bd-card-due.soon {
  color: var(--amber);
  background: rgba(245,158,11,0.1); padding: 2px 7px; border-radius: 100px;
}

/* Barra de progresso */
.bd-progress-bar {
  height: 3px; background: var(--paper-2); border-radius: 100px;
  overflow: hidden; margin-top: 10px;
}
.bd-progress-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--green) 0%, #0fa843 100%);
  transition: width .5s cubic-bezier(0.16,1,0.3,1);
}
.bd-card[data-progress="100"] .bd-progress-fill {
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}

/* Badge de urgência (canto superior direito) */
.bd-card-badge {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
}
.bd-card-badge.urgent { background: var(--red); box-shadow: 0 0 0 2px rgba(224,71,58,0.2); }
.bd-card-badge.soon   { background: var(--amber); }

/* Estado vazio de coluna */
.bd-col-empty {
  font-size: 12px; color: var(--gray-0); text-align: center;
  padding: 16px 12px; font-family: var(--mono); letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ================================================================
   PAINEL LATERAL (EDITOR)
   ================================================================ */
.bd-panel {
  width: 0; overflow: hidden;
  background: var(--white);
  border-left: 1px solid var(--line);
  transition: width .32s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
  flex: 0 0 auto;
  box-shadow: -8px 0 28px rgba(10,10,10,0.03), -2px 0 8px rgba(10,10,10,0.01);
}
.bd-panel.open { width: 480px; }
.bd-panel-inner {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 480px;
}

/* Cabeçalho do painel */
.bd-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto; gap: 12px;
}
.bd-panel-head-left { flex: 1; min-width: 0; }
.bd-panel-head-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gray-1); margin-bottom: 5px;
}
.bd-panel-head h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-panel-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.bd-panel-close {
  background: none; border: 0; font-size: 18px; color: var(--gray-1);
  padding: 6px; line-height: 1; border-radius: 8px; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.bd-panel-close:hover { background: var(--paper-2); color: var(--ink); }

/* Abas do painel */
.bd-panel-tabs {
  display: flex; border-bottom: 1px solid var(--line);
  padding: 0 24px; gap: 16px; flex: 0 0 auto;
  background: #fafafa;
}
.bd-tab {
  font-size: 13px; font-weight: 500; padding: 14px 4px 12px;
  border: none; background: none; color: var(--gray-1);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s ease; letter-spacing: 0.01em;
}
.bd-tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.bd-tab:hover:not(.active) { color: var(--gray-2); }

/* Corpo do painel */
.bd-panel-body {
  flex: 1; overflow-y: auto; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.bd-panel-body::-webkit-scrollbar { width: 4px; }
.bd-panel-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* Tab pages */
.bd-tab-page { display: none; flex-direction: column; gap: 20px; }
.bd-tab-page.active { display: flex; }

/* Campos */
.bd-field label {
  font-size: 11px; font-weight: 600; display: block;
  margin-bottom: 6px; color: var(--gray-2);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.bd-input {
  width: 100%; font-family: var(--display); font-size: 14px;
  border: 1px solid rgba(10,10,10,0.12); border-radius: 8px;
  padding: 10px 14px; color: var(--ink); background: #fafafa;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; outline: none;
}
.bd-input::placeholder { color: var(--gray-0); }
.bd-input:focus { background: var(--white); border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,0.04); }
.bd-textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.bd-select {
  appearance: none;
  background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a5f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  background-size: 10px 6px;
  padding-right: 38px;
}
.bd-select:focus { background-color: var(--white); }
.bd-input[type="date"] {
  font-family: var(--mono);
  font-size: 13px;
}
.bd-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bd-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Seções do painel */
.bd-section { border-top: 1px solid var(--line-2); padding-top: 20px; }
.bd-section-title {
  font-size: 11px; font-weight: 600; color: var(--gray-1);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Progress slider */
.bd-progress-wrap { display: flex; align-items: center; gap: 14px; }
.bd-progress-wrap input[type=range] {
  flex: 1; appearance: none; height: 6px;
  background: var(--paper-2); border-radius: 100px; outline: none;
}
.bd-progress-wrap input[type=range]::-webkit-slider-runnable-track {
  width: 100%; height: 6px; cursor: pointer; background: var(--paper-2); border-radius: 100px;
}
.bd-progress-wrap input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--ink); cursor: pointer;
  margin-top: -5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border: 2px solid var(--white);
  transition: transform .15s, background .15s;
}
.bd-progress-wrap input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); background: var(--green); }
.bd-progress-num {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  min-width: 40px; text-align: right;
}

/* Stage visual no painel */
.bd-stage-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-stage-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em; padding: 5px 12px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--gray-2); background: transparent;
  transition: all .18s ease; cursor: pointer;
}
.bd-stage-pill.current {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(10,10,10,0.12);
}
.bd-stage-pill.done {
  border-color: var(--green); color: #0fa843; background: rgba(31,214,95,0.06);
}
.bd-stage-pill:hover:not(.current) {
  border-color: var(--gray-2); color: var(--ink);
}

/* Links */
.bd-links { display: flex; flex-direction: column; gap: 7px; }
.bd-link-row {
  display: flex; gap: 10px; align-items: center;
  background: #fdfdfd; border: 1px solid rgba(10,10,10,0.08); border-radius: 8px;
  padding: 10px 12px; transition: border-color .18s, box-shadow .18s;
}
.bd-link-row:hover { border-color: rgba(10,10,10,0.15); }
.bd-link-row:focus-within { border-color: var(--ink); box-shadow: 0 2px 8px rgba(10,10,10,0.02); }
.bd-link-ico {
  font-size: 16px; width: 28px; height: 28px; background: #f1f1f2;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.bd-link-inputs { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bd-link-inputs input {
  border: none; background: transparent; font-family: var(--display);
  font-size: 13px; color: var(--ink); outline: none; width: 100%;
}
.bd-link-inputs input::placeholder { color: var(--gray-1); }
.bd-link-inputs .bd-link-url-input { font-size: 11px; color: var(--gray-2); }
.bd-link-del {
  background: none; border: 0; color: var(--gray-0); font-size: 16px;
  padding: 3px; display: flex; align-items: center; flex: 0 0 auto;
  border-radius: 6px; transition: all .15s;
}
.bd-link-del:hover { color: var(--red); background: rgba(224,71,58,0.08); }
.bd-link-add {
  font-size: 12px; font-weight: 500; color: var(--gray-2); background: transparent;
  border: 1px dashed rgba(10,10,10,0.15); border-radius: 8px; padding: 10px;
  width: 100%; transition: all .18s; display: flex; align-items: center;
  justify-content: center; gap: 6px;
}
.bd-link-add:hover { border-color: var(--ink); color: var(--ink); background: #fdfdfd; }


/* Imagens */
.bd-images { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.bd-img-thumb {
  position: relative; aspect-ratio: 1; border-radius: 9px;
  overflow: hidden; background: var(--paper-2);
}
.bd-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-img-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(10,10,10,0.72); color: #fff; border: 0;
  border-radius: 50%; width: 22px; height: 22px; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.bd-img-thumb:hover .bd-img-del { opacity: 1; }
.bd-img-add {
  aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--gray-1); transition: all .15s;
}
.bd-img-add:hover { border-color: var(--ink); color: var(--ink); }

/* Histórico */
.bd-history { display: flex; flex-direction: column; }
.bd-hist-row {
  display: flex; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  animation: card-in .2s ease both;
}
.bd-hist-row:last-child { border-bottom: none; }
.bd-hist-line { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.bd-hist-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); margin-top: 5px; flex: 0 0 auto;
  box-shadow: 0 0 0 3px var(--green-dim);
}
.bd-hist-vl { flex: 1; width: 1px; background: var(--line-2); margin-top: 6px; }
.bd-hist-body { flex: 1; }
.bd-hist-msg { font-size: 13.5px; line-height: 1.45; }
.bd-hist-meta { font-family: var(--mono); font-size: 10.5px; color: var(--gray-1); margin-top: 4px; }
.bd-hist-input-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }

/* Portal do cliente — preview do link */
.bd-portal-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.bd-portal-url {
  font-family: var(--mono); font-size: 10px; color: var(--gray-1);
  word-break: break-all; line-height: 1.6; margin-top: 10px;
}
.bd-portal-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

/* Botões do painel — contexto claro */
.bd-pnl-btn {
  font-size: 12.5px; font-weight: 500; border-radius: 100px;
  padding: 7px 16px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink);
  transition: all .16s; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; white-space: nowrap;
}
.bd-pnl-btn:hover { border-color: var(--ink); }
.bd-pnl-btn.primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.bd-pnl-btn.primary:hover { background: #1a1a1a; }
.bd-pnl-btn.danger { color: var(--red); border-color: rgba(224,71,58,0.3); }
.bd-pnl-btn.danger:hover { background: rgba(224,71,58,0.06); border-color: var(--red); }
.bd-pnl-btn.green-solid {
  background: var(--green); color: var(--ink); border-color: var(--green); font-weight: 700;
}
.bd-pnl-btn.green-solid:hover { background: #17c050; }

/* Sticky footer do painel */
.bd-panel-foot {
  flex: 0 0 auto; padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center;
  background: var(--white);
}

/* ================================================================
   LOADING
   ================================================================ */
.bd-loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; height: 100%;
  color: var(--gray-1); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
}
@keyframes bd-spin { to { transform: rotate(360deg); } }
.bd-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: bd-spin .75s linear infinite; flex: 0 0 auto;
}

/* ================================================================
   PORTAL DO CLIENTE
   ================================================================ */
.pj-wrap { max-width: 800px; margin: 0 auto; padding: clamp(30px,5vw,70px) clamp(20px,5vw,50px) 100px; }
.pj-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 54px; }
.pj-logo { height: 26px; }
.pj-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-1); }
.pj-head { margin-bottom: 40px; }
.pj-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pj-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.pj-title { font-size: clamp(28px,4vw,50px); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.pj-sub { font-size: 17px; color: var(--gray-2); }
.pj-progress { margin-bottom: 40px; }
.pj-prog-label { display: flex; justify-content: space-between; font-size: 14px; color: var(--gray-2); margin-bottom: 10px; }
.pj-prog-track { height: 8px; background: var(--line-2); border-radius: 100px; overflow: hidden; }
.pj-prog-fill { height: 100%; background: var(--green); border-radius: 100px; transition: width .8s cubic-bezier(0.16,1,0.3,1); }
.pj-stage { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 44px; }
.pj-stage-step { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 14px; border-radius: 100px; border: 1px solid var(--line); color: var(--gray-2); }
.pj-stage-step.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pj-stage-step.done { border-color: var(--green); color: var(--green); }
.pj-stage-step .ck { font-size: 11px; }
.pj-note { border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--white); margin-bottom: 36px; }
.pj-note-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-1); margin-bottom: 12px; }
.pj-note-text { font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.pj-links { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.pj-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; transition: border-color .15s; }
.pj-link:hover { border-color: var(--ink); }
.pj-link-ico { font-size: 20px; width: 28px; text-align: center; }
.pj-link-arrow { margin-left: auto; color: var(--gray-1); }
.pj-images { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 12px; margin-bottom: 36px; }
.pj-image { border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.pj-image img { width: 100%; height: 200px; object-fit: cover; display: block; }
.pj-image .cap { font-size: 12.5px; color: var(--gray-2); padding: 10px 12px; }
.pj-history { display: flex; flex-direction: column; }
.pj-hist-row { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.pj-hist-row:last-child { border-bottom: none; }
.pj-hist-line { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.pj-hist-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 4px; flex: 0 0 auto; }
.pj-hist-vline { flex: 1; width: 2px; background: var(--line-2); margin-top: 6px; }
.pj-hist-msg { font-size: 15px; line-height: 1.45; }
.pj-hist-meta { font-family: var(--mono); font-size: 11.5px; color: var(--gray-1); margin-top: 5px; }
.pj-footer { margin-top: 60px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.pj-footer .pj-logo { height: 20px; opacity: 0.4; }
.pj-footer-txt { font-size: 13.5px; color: var(--gray-1); }
.pj-not-found { text-align: center; padding: 80px 20px; }
.pj-not-found h2 { font-size: 30px; font-weight: 700; margin-bottom: 14px; }
.pj-not-found p { color: var(--gray-2); font-size: 16px; }

.section-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-1); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-1); }

/* ---- Mobile Responsive for Client Portal ---- */
@media (max-width: 600px) {
  .pj-wrap {
    padding: 30px 16px 80px;
  }
  .pj-brand {
    margin-bottom: 36px;
    gap: 10px;
  }
  .pj-logo {
    height: 22px;
  }
  .pj-head {
    margin-bottom: 24px;
  }
  .pj-title {
    font-size: 28px;
    margin-bottom: 6px;
  }
  .pj-sub {
    font-size: 15px;
  }
  .pj-progress {
    margin-bottom: 28px;
  }
  /* Linha do tempo horizontal scrollável para as etapas do projeto no celular */
  .pj-stage {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px;
    padding-inline: 16px;
    margin-bottom: 28px;
    scroll-snap-type: x proximity;
  }
  .pj-stage::-webkit-scrollbar {
    display: none;
  }
  .pj-stage-step {
    flex: 0 0 auto;
    scroll-snap-align: start;
    font-size: 12px;
    padding: 6px 12px;
  }
  .pj-note {
    padding: 16px;
    margin-bottom: 24px;
  }
  .pj-note-text {
    font-size: 14px;
  }
  .pj-link {
    padding: 12px 14px;
    font-size: 14px;
  }
  .pj-link-ico {
    font-size: 18px;
    width: 24px;
  }
  .pj-images {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }
  .pj-image img {
    height: 220px;
  }
  .pj-hist-msg {
    font-size: 14px;
  }
  .pj-hist-meta {
    font-size: 11px;
  }
  .pj-footer {
    margin-top: 40px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ================================================================
   CONTEXT MENU (CLIQUE BOTÃO DIREITO) & COMENTÁRIOS INTERNOS
   ================================================================ */

/* Context Menu */
.bd-ctxmenu {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 6px 0;
  z-index: 10000;
  display: none;
  min-width: 190px;
  animation: bd-fade-in 0.12s ease-out;
}
.bd-ctxmenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
  font-family: inherit;
}
.bd-ctxmenu-item:hover {
  background: var(--paper-2);
}
.bd-ctxmenu-item.danger {
  color: var(--red);
}
.bd-ctxmenu-item.danger:hover {
  background: rgba(224, 71, 58, 0.08);
}
.bd-ctxmenu-divider {
  height: 1px;
  background: var(--line-2);
  margin: 6px 0;
}

/* Comentários */
.bd-comments-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bd-comment-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.bd-comment-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--gray-2);
}
.bd-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bd-comment-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--white);
  position: relative;
  transition: border-color 0.15s;
}
.bd-comment-card:hover {
  border-color: var(--gray-1);
}
.bd-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.bd-comment-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.bd-comment-avatar.vitor {
  background: rgba(31, 214, 95, 0.1);
}
.bd-comment-avatar.fernando {
  background: rgba(106, 106, 240, 0.1);
}
.bd-comment-author-name {
  color: var(--ink);
  font-weight: 600;
}
.bd-comment-date {
  color: var(--gray-1);
  font-size: 11.5px;
}
.bd-comment-del-btn {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--gray-1);
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.bd-comment-del-btn:hover {
  color: var(--red);
  background: rgba(224, 71, 58, 0.08);
}
.bd-comment-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-2);
  white-space: pre-wrap;
}

/* Destaque para link do Google Drive */
.pj-link-drive {
  border: 2.5px dashed rgba(31, 214, 95, 0.35);
  background: linear-gradient(135deg, var(--white) 0%, rgba(31, 214, 95, 0.02) 100%);
}
.pj-link-drive:hover {
  border-color: var(--green);
}
.pj-link-drive .pj-link-ico {
  font-size: 24px;
}

@keyframes bd-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

