/* Acompanhamentos › Contratos. Usa os tokens de acompanhamentos.css. */

.ac-toolbar.is-minimal { display: none !important; }

.t-wait   { --ct: var(--ac-amber); }
.t-bad    { --ct: var(--danger, #c0492f); }
.t-violet { --ct: var(--ac-violet); }
.t-info   { --ct: var(--ac-a); }
.t-teal   { --ct: var(--ac-a-2); }
.t-ok     { --ct: var(--ac-green); }
.t-muted  { --ct: var(--muted-soft, var(--muted)); }

.ac-stat.ct-stat-ok { --sc: var(--ac-green); }
.ac-stat.ct-stat-ok b { color: var(--sc); }

/* Busca, filtros e carimbo */
.ct-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 18px; }
.ct-bar .ac-search { flex: 0 1 280px; min-width: 200px; }
.ct-bar .ac-seg { flex-wrap: wrap; }
.ct-bar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ct-stamp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-soft); }
.ct-stamp.is-partial { color: var(--ac-amber); }

/* Grade de cards */
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ct-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--ac-card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  animation: acFadeUp .35s ease-out both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ct-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ct); opacity: .85; }
.ct-card:hover { border-color: color-mix(in srgb, var(--ct) 40%, var(--hairline)); transform: translateY(-2px); box-shadow: 0 18px 34px -26px rgba(0, 0, 0, .6); }
.ct-card:focus-visible { outline: 2px solid color-mix(in srgb, var(--ct) 60%, transparent); outline-offset: 2px; }
.ct-card.is-active { border-color: color-mix(in srgb, var(--ct) 60%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ct) 30%, transparent); }
.ct-card.t-wait { background: linear-gradient(180deg, color-mix(in srgb, var(--ac-amber) 7%, var(--ac-card)), var(--ac-card) 60%); }
.ct-card.t-muted { opacity: .72; }

.ct-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ct-card-top time { margin-left: auto; font-size: 11.5px; color: var(--muted-soft); white-space: nowrap; }
.ct-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ct) 14%, transparent);
  color: var(--ct);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ct-pill i { font-size: .8rem; }
.ct-model { font-size: 11.5px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--hairline); border-radius: 999px; white-space: nowrap; }

.ct-card-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ct-card-title strong { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.ct-card-title small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Trilha compacta: pedido → jurídico → aprovação → assinatura */
.ct-track { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ct-track li { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ct-track li i { display: block; height: 4px; border-radius: 4px; background: var(--surface-2); }
.ct-track li span { font-size: 11px; color: var(--muted-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-track li.is-done i { background: color-mix(in srgb, var(--ac-green) 70%, transparent); }
.ct-track li.is-cur i { background: linear-gradient(90deg, var(--ct) 50%, var(--surface-2) 50%); }
.ct-track li.is-wait i { background: var(--ac-amber); }
.ct-track li.is-fail i { background: var(--danger, #c0492f); }
.ct-track li.is-cur span, .ct-track li.is-wait span, .ct-track li.is-fail span { color: var(--ink-2); font-weight: 600; }
.ct-track li.is-off i { background: repeating-linear-gradient(90deg, var(--surface-2) 0 4px, transparent 4px 8px); }

.ct-callout { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 11px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.ct-callout i { margin-top: 1px; color: var(--muted); }
.ct-callout.is-wait { background: color-mix(in srgb, var(--ac-amber) 12%, transparent); }
.ct-callout.is-wait i { color: var(--ac-amber); }
.ct-callout.is-bad { background: color-mix(in srgb, var(--danger, #c0492f) 10%, transparent); }
.ct-callout.is-bad i { color: var(--danger, #c0492f); }

.ct-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; font-size: 12px; color: var(--muted); }
.ct-card-foot:empty { display: none; }
.ct-who { display: inline-flex; align-items: center; gap: 5px; }
.ct-who.is-you { color: var(--ac-amber); font-weight: 600; }
.ct-meta { margin-left: auto; }
.ct-sig { display: inline-flex; align-items: center; gap: 8px; }
.ct-sig b { color: var(--ink-2); font-weight: 600; }
.ct-sig-bar { width: 72px; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.ct-sig-bar i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--ac-green); }

.ct-card.is-skel { min-height: 190px; cursor: default; }
.ct-card.is-skel::before { display: none; }
.ct-card.is-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--bg-sunken, var(--surface)), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.ct-card.is-skel i:nth-child(1) { width: 40%; }
.ct-card.is-skel i:nth-child(2) { width: 75%; height: 18px; }
.ct-card.is-skel i:nth-child(3) { width: 100%; height: 5px; margin-top: auto; }

/* Lista */
.ct-tr {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 190px minmax(110px, 1fr) 120px 100px 88px 76px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 11px 18px;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: transparent;
  color: inherit;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background .15s;
  animation: acFadeUp .25s ease-out both;
  animation-delay: calc(var(--i, 0) * 15ms);
}
.ct-tr:hover { background: var(--surface-2); }
.ct-tr:focus-visible { outline: 2px solid var(--ac-a-line); outline-offset: -2px; }
.ct-tr.is-active { background: var(--surface-2); }
.ct-tr.is-head { border-top: 0; background: color-mix(in srgb, var(--bg-sunken, var(--surface-2)) 50%, transparent); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; cursor: default; animation: none; }
.ct-tr.is-head span:last-child { text-align: right; }
.ct-tr .ct-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ct-tr:not(.is-head)::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ct); opacity: .8; }
.ct-tr.is-active { box-shadow: inset 3px 0 0 var(--ct); }
.ct-tr .ac-td-name strong { font-family: var(--font-display); font-weight: 500; font-size: 13.5px; }
.ct-tr .ct-track { width: 100%; }
.ct-tr .ct-track li span { display: none; }
.ct-tr.t-muted:not(.is-head) { opacity: .72; }
.ct-tr .ct-sig-bar { width: 56px; }

/* ── Gaveta ─────────────────────────────────────────────────── */
.ct-head { padding-bottom: 18px; }
.ct-head h2 { margin: 6px 0 10px; font-family: var(--ac-serif); font-size: 2rem; font-weight: 400; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.ct-body { display: flex; flex-direction: column; gap: 26px; padding: 4px 36px 40px; }

.ct-now {
  display: flex; gap: 16px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--ct) 35%, var(--hairline));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--ct) 7%, var(--surface));
}
.ct-now-ico { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--ct) 16%, transparent); color: var(--ct); font-size: 1.2rem; }
.ct-now-text { min-width: 0; flex: 1; }
.ct-now-label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ct-now-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--ct); }
.ct-now h3 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; color: var(--ink); }
.ct-now p { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 1.55; }
.ct-now-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ct-quote { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--ct); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); color: var(--ink-2); font-size: .88rem; line-height: 1.5; white-space: pre-line; }
.ct-quote b { display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }

.ct-sec .ac-section-title { display: flex; align-items: center; gap: 8px; }
.ct-sec .ac-section-title b { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; }

/* Caminho do contrato */
.ct-steps { position: relative; display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.ct-steps li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.ct-steps li:last-child { padding-bottom: 0; }
.ct-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--hairline); }
.ct-steps li.is-done:not(:last-child)::after { background: color-mix(in srgb, var(--ac-green) 55%, transparent); }
.ct-step-dot { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--hairline); border-radius: 50%; background: var(--bg); color: var(--muted-soft); font-size: .8rem; }
.ct-steps li.is-done .ct-step-dot { border-color: var(--ac-green); background: var(--ac-green); color: var(--bg); }
.ct-steps li.is-cur .ct-step-dot { border-color: var(--ac-a); color: var(--ac-a); box-shadow: 0 0 0 4px var(--ac-a-soft); }
.ct-steps li.is-wait .ct-step-dot { border-color: var(--ac-amber); background: var(--ac-amber); color: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac-amber) 15%, transparent); }
.ct-steps li.is-fail .ct-step-dot { border-color: var(--danger, #c0492f); background: var(--danger, #c0492f); color: #fff; }
.ct-steps li.is-off .ct-step-dot { border-style: dashed; }
.ct-steps li > div { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; min-width: 0; }
.ct-steps b { font-size: .92rem; font-weight: 600; color: var(--ink); }
.ct-steps li.is-todo b, .ct-steps li.is-off b { color: var(--muted); font-weight: 500; }
.ct-steps small { font-size: 12.5px; color: var(--muted); }

/* Itens do jurídico */
.ct-round { margin: 14px 0 8px; font-size: 11.5px; font-weight: 600; color: var(--muted-soft); text-transform: uppercase; letter-spacing: .04em; }
.ct-round:first-of-type { margin-top: 0; }
.ct-items, .ct-signers, .ct-log { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ct-items { gap: 8px; }
.ct-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.ct-items li > i { margin-top: 2px; font-size: 1rem; }
.ct-items li.is-ok > i { color: var(--ac-green); }
.ct-items li.is-bad > i { color: var(--danger, #c0492f); }
.ct-items li.is-wait > i { color: var(--muted-soft); }
.ct-items p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.ct-items blockquote { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: .85rem; line-height: 1.5; white-space: pre-line; }
.ct-items cite { display: block; margin-top: 4px; font-size: 11.5px; font-style: normal; color: var(--muted); }
.ct-item-tag { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ct-items li.is-ok .ct-item-tag { color: var(--ac-green); }
.ct-items li.is-bad .ct-item-tag { color: var(--danger, #c0492f); }

.ct-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ct-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-file:hover { border-color: var(--ac-a-line); color: var(--ac-a); }
.ct-file:disabled { opacity: .6; cursor: progress; }

/* Assinaturas */
.ct-signers { border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.ct-signers li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.ct-signers li + li { border-top: 1px solid var(--hairline); }
.ct-signers li > i { font-size: 1rem; }
.ct-signers li.is-ok > i { color: var(--ac-green); }
.ct-signers li.is-bad > i { color: var(--danger, #c0492f); }
.ct-signers li.is-wait > i { color: var(--ac-amber); }
.ct-signers li > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ct-signers b { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-signers small { font-size: 12px; color: var(--muted); }
.ct-signers li > span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Dados do pedido */
.ct-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0; }
.ct-facts div { padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.ct-facts dt { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ct-facts dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }

/* Conversa com o jurídico */
.ct-log li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.ct-log li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--hairline); }
.ct-log-dot { flex-shrink: 0; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--muted-soft); }
.ct-log li.o-juridico .ct-log-dot { background: var(--ac-violet); }
.ct-log li.o-parceiro .ct-log-dot { background: var(--ac-a); }
.ct-log li > div { min-width: 0; flex: 1; }
.ct-log-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ct-log-head b { font-size: .86rem; font-weight: 600; }
.ct-log-head em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ct-log-head time { margin-left: auto; font-size: 11.5px; color: var(--muted-soft); }
.ct-log p { margin: 4px 0 0; font-size: .88rem; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.ct-log p.is-status { color: var(--muted); font-style: italic; }

.ct-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }

/* Colunas pela largura da própria tabela (a barra lateral muda o espaço útil). */
.ct-table { container-type: inline-size; }
@container (max-width: 1080px) {
  .ct-tr { grid-template-columns: minmax(180px, 2fr) 190px minmax(110px, 1fr) 120px 88px 76px; }
  .ct-tr > :nth-child(5) { display: none; }
}
@container (max-width: 900px) {
  .ct-tr { grid-template-columns: minmax(160px, 2fr) 190px minmax(100px, 1fr) 120px 76px; }
  .ct-tr > :nth-child(6) { display: none; }
}
@container (max-width: 740px) {
  .ct-tr { grid-template-columns: minmax(150px, 2fr) 180px 120px 70px; }
  .ct-tr > :nth-child(3) { display: none; }
}
@container (max-width: 540px) {
  .ct-tr { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .ct-tr.is-head { display: none; }
  .ct-tr > :nth-child(4), .ct-tr > :nth-child(7) { display: none; }
}

@media (max-width: 700px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ac-view span { display: none; }
  .ct-bar .ac-search { flex: 1 1 100%; }
  .ct-bar-end { margin-left: 0; }
  .ct-body { padding: 4px 18px 32px; }
  .ct-now { flex-direction: column; gap: 10px; }
  .ct-items li { grid-template-columns: auto minmax(0, 1fr); }
  .ct-item-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-card { animation: none; }
}
