/* Calendarq · tela "projetos" (frente F1). Carregado depois do legado: sobrescreva aqui.
   Só tokens var(--…), nunca cor escrita à mão (o verificar.mjs recusa). Classes com prefixo próprio da tela.
   Desenho: esboço 2.1 da reestruturação. O cartão do projeto (cq-pj-card) também
   aparece no Painel ("Projetos em andamento"). */

/* ---------- Selo da fase e régua de etapas (Painel e Projetos) ---------- */
.cq-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 22px; padding: 0 9px;
  overflow: hidden; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.cq-pill::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cq-pill.is-ok { background: var(--ok-s); color: var(--ok); }
.cq-pill.is-warn { background: var(--warn-s); color: var(--warn); }
.cq-pill.is-bad { background: var(--bad-s); color: var(--bad); }
.cq-pill.is-info { background: var(--info-s); color: var(--info); }
.cq-pill.is-n { background: var(--sunk); color: var(--ink-3); }
.cq-segs { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 4px; }
.cq-segs i { height: 4px; border-radius: 4px; background: var(--sunk-2); }
.cq-segs i.is-done { background: var(--ink); }
.cq-segs i.is-now { background: repeating-linear-gradient(-45deg, var(--ink) 0 2.5px, transparent 2.5px 6px); opacity: .75; }

/* ---------- O cartão do projeto ---------- */
.cq-pj-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cq-pj-grade.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cq-pj-card {
  position: relative; min-width: 0; display: flex; overflow: hidden; border-radius: var(--r-lg);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cq-pj-card:hover { transform: translateY(-3px); box-shadow: var(--g-hl), var(--g-sh-3); }
.cq-pj-card-a { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); text-align: left; }
.cq-pj-card-a:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: var(--r-lg); }
.cq-pj-capa { position: relative; display: block; }
.cq-pj-capa .capa { width: 100%; height: 96px; border-radius: 0; }
/* A capa padrão do esboço 2.1: a grade fina da prancha, a casa ao centro e as
   iniciais do cliente no canto (a imagem enviada continua como está). */
.cq-pj-capa:not(.has-img) .capa, .cq-pj-mini .capa:not(.has-img), .cq-pj-pronto .capa:not(.has-img) { background-color: var(--surface-2); color: var(--ink-3); filter: none; }
.cq-pj-capa:not(.has-img) .capa-quadricula, .cq-pj-mini .capa-quadricula:not(.has-img), .cq-pj-pronto .capa-quadricula:not(.has-img) { background-image: linear-gradient(to right, var(--hair) 1px, transparent 1px), linear-gradient(to bottom, var(--hair) 1px, transparent 1px); background-size: 14px 14px; }
.cq-pj-capa:not(.has-img) .capa-linhas, .cq-pj-mini .capa-linhas:not(.has-img), .cq-pj-pronto .capa-linhas:not(.has-img) { background-image: repeating-linear-gradient(-45deg, var(--hair) 0 1px, transparent 1px 9px); }
.cq-pj-capa:not(.has-img) .capa-liso, .cq-pj-mini .capa-liso, .cq-pj-pronto .capa-liso { background-image: none; }
.cq-pj-mini .capa-ini, .cq-pj-pronto .capa-ini { font-family: var(--mono); font-weight: 400; letter-spacing: .1em; }
.cq-pj-capa:not(.has-img) .capa-ini { position: absolute; left: 12px; bottom: 10px; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .16em; }
.cq-pj-casa { position: absolute; left: 50%; top: 50%; color: var(--ink-3); font-size: 40px; transform: translate(-50%, -50%); pointer-events: none; }
.cq-pj-casa .ic { stroke-width: 1.2; }
.cq-pj-pin, .cq-pj-ex {
  position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--g3); color: var(--ink-2); font-size: 10.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.cq-pj-pin { top: 10px; left: 10px; width: 22px; padding: 0; justify-content: center; font-size: 12px; }
.cq-pj-ex { bottom: 10px; left: 10px; }
.cq-pj-b { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.cq-pj-nome { padding-right: 26px; overflow-wrap: anywhere; font-size: 16px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.cq-pj-cli { margin-top: -4px; color: var(--ink-3); font-size: 12.5px; }
.cq-pj-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.cq-pj-row b { flex: none; color: var(--ink); font-weight: 600; }
.cq-pj-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; padding-top: 8px;
  border-top: 1px dashed var(--line-2); color: var(--ink-3); font-size: 12px;
}
.cq-pj-meta > span { flex: none; }
.cq-pj-meta b { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.cq-pj-meta.is-bad b { color: var(--bad); }
.cq-pj-meta.is-warn b { color: var(--warn); }
.cq-pj-meta.is-n b { color: var(--ink-3); font-weight: 500; }
/* O "⋯" no canto do cartão, sobre a capa. */
.cq-pj-mais {
  position: absolute; z-index: 2; top: 104px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; color: var(--ink-3); font-size: 16px;
}
.cq-pj-mais:hover, .cq-pj-mais:focus-visible { background: var(--sunk); color: var(--ink); }

/* "Novo projeto", tracejado, no fim da grade. */
.cq-pj-novo {
  min-height: 230px; display: grid; place-content: center; justify-items: center; gap: 2px; padding: 18px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); color: var(--ink-3); font-size: 13.5px; text-align: center;
  transition: border-color .35s var(--ease), color .35s var(--ease);
}
.cq-pj-novo:hover { border-color: var(--ink-3); color: var(--ink); }
.cq-pj-novo strong { color: var(--ink); font-weight: 500; }
.cq-pj-novo small { font-size: 12px; }
.cq-pj-novo-ic {
  width: 40px; height: 40px; margin-bottom: 8px; display: grid; place-items: center; border: 1px solid var(--g-edge);
  border-radius: 12px; background: var(--g-sheen), var(--g3); color: var(--ink); font-size: 18px; box-shadow: var(--g-hl);
}

/* ---------- A barra e as ferramentas ---------- */
.cq-pj-bar-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.cq-pj-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.cq-pj-busca {
  flex: 1 1 240px; max-width: 360px; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  border-radius: 12px; color: var(--ink-3); font-size: 13.5px; cursor: text;
}
.cq-pj-busca .ic { flex: none; font-size: 16px; }
.cq-pj-busca-in { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none; }
.cq-pj-busca-in::placeholder { color: var(--ink-3); }
.cq-pj-busca-in::-webkit-search-cancel-button { cursor: pointer; }
.cq-pj-busca:focus-within { box-shadow: var(--g-hl), 0 0 0 3px var(--sunk-2); }
.cq-pj-kbd { flex: none; padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--g1); color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.cq-pj-chips { display: inline-flex; gap: 3px; max-width: 100%; padding: 4px; overflow-x: auto; border-radius: 12px; scrollbar-width: none; }
.cq-pj-chips::-webkit-scrollbar { display: none; }
.cq-pj-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px;
  color: var(--ink-3); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.cq-pj-chip:hover { color: var(--ink); }
.cq-pj-chip .c { color: var(--ink-4); font-family: var(--mono); font-size: 10px; }
.cq-pj-chip .ic { font-size: 14px; }
.cq-pj-chip.on { background: var(--pri-bg); color: var(--pri-ink); box-shadow: var(--pri-sh); }
.cq-pj-chip.on .c { color: inherit; opacity: .6; }
.cq-pj-chips.is-claro .cq-pj-chip.on { background: var(--g3); color: var(--ink); box-shadow: var(--g-hl), var(--g-sh); }
.cq-pj-modo { margin-left: auto; }
.cq-pj-vez { width: 8px; height: 8px; border-radius: 50%; }
.cq-pj-vez.is-me { background: currentColor; }
.cq-pj-vez.is-cli { border: 1.5px solid currentColor; }

/* ---------- Pronto para entregar, exemplos, vazio ---------- */
.cq-pj-prontos { display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--r-lg); }
.cq-pj-pronto { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--g-edge-low); }
.cq-pj-prontos .mono-label + .cq-pj-pronto { border-top: 0; }
.cq-pj-pronto .capa-sm { width: 40px; height: 40px; border-radius: 10px; font-size: 13px; }
.cq-pj-pronto-t { flex: 1; min-width: 0; display: grid; }
.cq-pj-pronto-t strong { font-weight: 600; }
.cq-pj-pronto-t small { color: var(--ink-3); font-size: 12px; }
.cq-pj-exemplos { margin-bottom: 16px; }
.cq-pj-vazio { display: grid; justify-items: start; gap: 6px; padding: 22px 24px; border-radius: var(--r-lg); }
.cq-pj-vazio strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.cq-pj-vazio p { margin: 0 0 6px; color: var(--ink-3); font-size: 13.5px; }

/* Lista e linha do tempo (peças do Painel de antes, dentro do vidro). */
.cq-pj-lista { padding: 6px 10px; border-radius: var(--r-lg); }
.cq-pj-lista .proj-list { margin: 0; }
@media (min-width: 641px) { .cq-pj-lista .proj-next small { display: none; } }
.cq-pj-linha { padding: 12px 14px 14px; border-radius: var(--r-lg); }
.cq-pj-linha-tools { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.cq-pj-linha .pn-cut { margin: 0; }

/* ---------- Concluídos e pausados ---------- */
.cq-pj-arq { margin-top: 34px; }
.cq-pj-tab { padding: 6px 10px 4px; overflow-x: auto; border-radius: var(--r-lg); }
.cq-pj-tab table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cq-pj-tab th {
  padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink-3); font-family: var(--mono); font-size: 10px;
  font-weight: 400; letter-spacing: .16em; text-align: left; text-transform: uppercase;
}
.cq-pj-tab td { padding: 11px 12px; border-bottom: 1px solid var(--g-edge-low); color: var(--ink-2); vertical-align: middle; }
.cq-pj-tab tr:last-child td { border-bottom: 0; }
.cq-pj-tab .r { text-align: right; }
.cq-pj-cel { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); font-weight: 500; text-align: left; }
.cq-pj-cel:hover b { text-decoration: underline; text-underline-offset: 3px; }
.cq-pj-mini .capa-sm { width: 44px; height: 32px; border-radius: 8px; font-size: 11px; }
.cq-pj-cel-t { display: grid; min-width: 0; }
.cq-pj-cel-t b { font-weight: 500; }
.cq-pj-cel-t small { display: none; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.cq-pj-tab .cq-pill { max-width: 280px; }
.cq-pj-acts { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* ---------- Telas menores ---------- */
@media (max-width: 1024px) {
  .cq-pj-grade.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-pj-modo { margin-left: 0; }
}
@media (max-width: 640px) {
  .cq-pj-grade, .cq-pj-grade.is-3 { grid-template-columns: minmax(0, 1fr); }
  .cq-pj-busca { flex-basis: 100%; max-width: none; }
  .cq-pj-kbd { display: none; }
  .cq-pj-novo { min-height: 120px; }
  .cq-pj-bar-acts { width: 100%; justify-content: flex-start; }
  /* A tabela vira linhas: o projeto e o cliente embaixo, a situação e as ações ao lado. */
  .cq-pj-tab { padding: 4px 6px; }
  .cq-pj-arq .cq-pn-sec-h .mono-label { display: none; }
  .cq-pj-td-cli, .cq-pj-td-desde { display: none; }
  .cq-pj-cel-t small { display: block; }
  .cq-pj-tab tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--g-edge-low); }
  .cq-pj-tab tr:last-child { border-bottom: 0; }
  .cq-pj-tab thead { display: none; }
  .cq-pj-tab td { padding: 8px 6px; border-bottom: 0; }
  .cq-pj-tab td:nth-child(3) { grid-column: 1; grid-row: 2; padding-top: 0; }
  .cq-pj-tab td.r { grid-column: 2; grid-row: 1 / span 2; }
  .cq-pj-acts { flex-direction: column; align-items: flex-end; }
  .cq-pj-tab .cq-pill { max-width: 100%; }
}
