/* =====================================================
   PORTAL REDE — Esteira (processos / workflows)
   ===================================================== */

/* ---------- Hub de processos ---------- */
.est-pipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.est-pipe-card {
  display: flex; flex-direction: column; gap: 9px; padding: 16px;
  border: 1px solid var(--line); border-left: 4px solid var(--accent, var(--pine));
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink);
  transition: transform .15s var(--ease), border-color .15s var(--ease);
}
.est-pipe-card { position: relative; }
.est-pipe-card:hover { transform: translateY(-2px); border-color: var(--accent, var(--pine)); }
.est-pipe-card__hit { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.est-pipe-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.est-pipe-card h3 { font-size: 15.5px; line-height: 1.3; }
.est-pipe-card__edit { position: relative; z-index: 2; color: var(--ink-faint); display: inline-flex; padding: 2px; border-radius: 6px; }
.est-pipe-card__edit:hover { color: var(--pine); background: var(--pine-soft); }
.est-pipe-card .desc { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; flex: 1; }
.est-pipe-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); }
.est-pipe-card .meta strong { color: var(--pine); }

/* ---------- Quadro Kanban ---------- */
.est-board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.est-board {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start;
  scrollbar-width: thin;
}
.est-col {
  flex: 0 0 296px; max-width: 296px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column;
  max-height: calc(100vh - 235px);
}
.est-col__head {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); border-top: 3px solid var(--phase, var(--pine));
  border-radius: var(--radius) var(--radius) 0 0; background: var(--surface);
}
.est-col__name { font-weight: 700; font-size: 13.5px; flex: 1; }
.est-col__count { font-size: 12px; font-weight: 700; color: var(--ink-faint); background: var(--paper); padding: 1px 8px; border-radius: var(--radius-pill); }
.est-col__appr { font-size: 10px; font-weight: 700; color: var(--warn); text-transform: uppercase; letter-spacing: .03em; background: var(--warn-soft); padding: 1px 6px; border-radius: var(--radius-pill); }
.est-col__body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 9px; min-height: 80px; transition: background-color .12s var(--ease); }
.est-col__empty { font-size: 12px; color: var(--ink-faint); text-align: center; padding: 14px 6px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.est-drop-over { background: var(--pine-soft); border-radius: 0 0 var(--radius) var(--radius); }

.est-tile {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 12px; text-decoration: none; color: var(--ink); cursor: grab;
  transition: border-color .12s var(--ease), transform .12s var(--ease);
}
.est-tile:hover { border-color: var(--pine); text-decoration: none; transform: translateY(-1px); }
.est-tile:active { cursor: grabbing; }
.est-tile.est-dragging { opacity: .45; }
.est-tile.is-over { border-left: 3px solid var(--danger); }
.est-tile__top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.est-tile__code { font-size: 11px; font-weight: 700; color: var(--ink-faint); }
.est-tile__title { font-size: 13.8px; font-weight: 600; line-height: 1.35; }
.est-tile__unit { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 11.5px; color: var(--ink-faint); }
.est-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.est-tile__who { font-size: 11.5px; font-weight: 600; color: var(--pine); background: var(--pine-soft); padding: 2px 8px; border-radius: var(--radius-pill); }
.est-tile__who--none { color: var(--ink-faint); background: var(--paper); font-weight: 500; }

.est-prio { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); }
.est-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); }
.est-due.over { color: var(--danger); }
.est-due.soon { color: var(--warn); }

/* ---------- Builder (configuração do processo) ---------- */
.est-subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; position: sticky; top: 0; z-index: 5; }
.est-subnav a {
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 6px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
}
.est-subnav a:hover { border-color: var(--pine); color: var(--pine); text-decoration: none; }

.est-builder { display: flex; flex-direction: column; gap: 16px; }
.est-sec { scroll-margin-top: 70px; }
.est-sec__title { font-size: 15px; margin-bottom: 4px; }
.est-sec__desc { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 14px; line-height: 1.5; }

.est-builder-fields { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.est-builder-fields:empty { display: none; }
.est-builder-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; background: var(--surface); }
.est-builder-field + .est-builder-field { border-top: 1px solid var(--line); }
.est-builder-field__main { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.est-builder-field__label { font-weight: 600; font-size: 13.5px; }
.est-builder-field__type { font-size: 11.5px; color: var(--ink-faint); }
.est-builder-field__acts { display: flex; gap: 4px; flex-shrink: 0; }

.est-builder-phases { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.est-builder-phase { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 72px; }
.est-builder-phase__head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; background: var(--paper); border-radius: var(--radius) var(--radius) 0 0; border-left: 4px solid var(--phase, var(--pine)); }
.est-builder-phase__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--phase, var(--pine)); flex-shrink: 0; }
.est-builder-phase__sla { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-faint); }
.est-builder-phase__fields { padding: 4px 6px 8px; }
.est-builder-phase__fields .est-builder-field { border-radius: var(--radius-sm); }

.est-builder-autos { display: flex; flex-direction: column; margin-bottom: 12px; }
.est-auto-row { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.est-auto-row:last-child { border-bottom: none; }
.est-auto-row__icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--pine-soft); color: var(--pine); flex-shrink: 0; }
.est-auto-row__name { font-weight: 600; font-size: 13.5px; }
.est-auto-row__meta { font-size: 11.5px; color: var(--ink-faint); }

.est-add summary { display: inline-flex; }
.est-add__link { font-size: 12.5px; font-weight: 600; color: var(--pine); cursor: pointer; padding: 7px 4px; display: inline-block; list-style: none; }
.est-add__link::-webkit-details-marker { display: none; }
.est-add__link:hover { text-decoration: underline; }
.est-fieldform, .est-autoform { font-size: 13px; }

/* ---------- Detalhe do card ---------- */
.est-code-chip { font-size: 13px; font-weight: 700; color: var(--ink-faint); background: var(--paper); border: 1px solid var(--line); padding: 1px 9px; border-radius: var(--radius-pill); }

.est-stage-bar { display: flex; gap: 6px; margin: 6px 0 16px; flex-wrap: wrap; }
.est-stage { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink-faint); }
.est-stage__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.est-stage.done { color: var(--success); border-color: var(--success-soft); background: var(--success-soft); }
.est-stage.now { color: #fff; background: var(--phase, var(--pine)); border-color: var(--phase, var(--pine)); }
.est-stage.now .est-stage__dot { background: #fff; }
.est-stage.todo { color: var(--ink-faint); }

.est-card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.est-card-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.est-card-side { display: flex; flex-direction: column; gap: 14px; }

.est-field-block { border-left: 3px solid var(--phase, var(--line)); }
.est-block-title { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px; }
.est-readval { font-size: 14px; padding: 6px 0; color: var(--ink); }

.est-actions { background: var(--paper); }
.est-actions__row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.est-actions__row .btn span { font-weight: 500; }
.est-moveto { margin-top: 10px; }
.est-moveto summary { font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.est-moveto summary:hover { color: var(--pine); }

.est-timeline-wrap { }
.est-comment-form { margin-bottom: 16px; }
.est-file-mini { font-size: 12px; }
.est-timeline { list-style: none; display: flex; flex-direction: column; }
.est-event { display: flex; gap: 11px; padding: 10px 0; }
.est-event:not(:last-child) { border-bottom: 1px solid var(--line); }
.est-event__icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.est-event__icon--criado, .est-event__icon--movido { background: var(--pine-soft); color: var(--pine); border-color: transparent; }
.est-event__icon--aprovado, .est-event__icon--concluido { background: var(--success-soft); color: var(--success); border-color: transparent; }
.est-event__icon--reprovado, .est-event__icon--cancelado { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.est-event__icon--comentario { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.est-event__body { flex: 1; min-width: 0; }
.est-event__head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.est-event__verb { color: var(--ink-soft); }
.est-event__time { font-size: 11.5px; color: var(--ink-faint); margin-left: auto; }
.est-event__text { font-size: 13.5px; line-height: 1.5; margin-top: 4px; background: var(--paper); border-radius: var(--radius-sm); padding: 8px 11px; }
.est-event__text p { margin: 0; }

.est-side-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.est-side-row:last-child { border-bottom: none; }
.est-side-row__k { font-size: 12.5px; color: var(--ink-faint); flex-shrink: 0; }
.est-side-row__v { font-size: 13px; font-weight: 500; text-align: right; }
.est-inline { margin: 0; min-width: 150px; }
.est-inline .select { font-size: 12.5px; padding: 5px 8px; }

.est-attachments { display: flex; flex-direction: column; gap: 6px; }
.est-attach { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--pine); padding: 5px 0; }
.est-cancel { color: var(--danger); }
.est-cancel:hover { background: var(--danger-soft); }

@media (max-width: 860px) {
  .est-card-layout { grid-template-columns: 1fr; }
}
