/* Automações do quadro (fase A) */
.btn-auto-col { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.2rem 0.4rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 0.72rem; font-weight: 800; cursor: pointer; opacity: 0.55; }
.btn-auto-col:hover, .btn-auto-col.has-rules { opacity: 1; }
.btn-auto-col.has-rules { color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 12%, transparent); }
.btn-auto-col.has-error { color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
.btn-auto-col:hover { border-color: var(--border-color); }
.auto-modal-overlay { position: fixed; inset: 0; z-index: 2400; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auto-modal { background: var(--bg-surface); color: var(--text-primary); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 3rem); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35); overflow: hidden; }
.auto-modal.is-wide { width: min(1120px, calc(100vw - 3rem)); }
.auto-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); }
.auto-head h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); }
.auto-head h2 i { color: var(--accent-primary); }
.auto-x { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--text-secondary); cursor: pointer; padding: 0 0.3rem; }
.auto-body { padding: 1rem 1.25rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.8rem; }
.auto-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; padding: 0.8rem 1.25rem; border-top: 1px solid var(--border-color); }
.auto-help { margin: 0; font-size: 0.82rem; color: var(--text-secondary); }
.auto-empty { text-align: center; color: var(--text-secondary); padding: 1.5rem 1rem; }
.auto-empty i { color: var(--accent-primary); opacity: 0.7; }
.auto-empty p { margin: 0.3rem 0; }
.auto-list { display: flex; flex-direction: column; gap: 0.6rem; }
.auto-rule { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.8rem 0.9rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-surface); }
.auto-rule.is-off { opacity: 0.6; }
.auto-rule-main { flex: 1; min-width: 0; }
.auto-rule-name { font-size: 0.92rem; }
.auto-rule-sentence { font-size: 0.86rem; margin-top: 0.15rem; }
.auto-rule-meta { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.78rem; color: var(--text-secondary); }
.auto-rule-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.auto-chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--bg-surface-elevated); color: var(--text-secondary); }
.auto-chip.is-ok { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.auto-chip.is-error { background: color-mix(in srgb, #dc2626 14%, transparent); color: #b91c1c; }
.auto-rule-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.auto-danger { color: #dc2626; }
.auto-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; margin-top: 0.15rem; cursor: pointer; }
.auto-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.auto-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--border-color); transition: background 0.15s; }
.auto-switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.auto-switch input:checked + i { background: var(--accent-primary); }
.auto-switch input:checked + i::after { transform: translateX(16px); }
.auto-switch input:focus-visible + i { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
/* construtor: a frase */
.auto-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.5rem; padding: 0.9rem; border-radius: 12px; background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--accent-primary) 25%, transparent); font-size: 0.92rem; }
.auto-sentence b { color: var(--accent-primary); }
.auto-then { font-weight: 800; color: var(--accent-primary); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; padding: 0 0.2rem; }
.auto-sentence select, .auto-lbl select, .auto-lbl input { font-family: inherit; font-size: 0.88rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); max-width: 100%; }
.auto-sentence select[hidden], .auto-rr[hidden] { display: none; }
.auto-lbl { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 700; }
.auto-lbl small { font-weight: 500; color: var(--text-secondary); }
.auto-fs { border: 1px solid var(--border-color); border-radius: 12px; padding: 0.6rem 0.9rem 0.8rem; margin: 0; }
.auto-fs legend { font-size: 0.8rem; font-weight: 800; padding: 0 0.4rem; color: var(--text-secondary); }
.auto-radio { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.3rem 0; font-size: 0.86rem; cursor: pointer; }
.auto-radio input { margin-top: 0.25rem; }
.auto-rr { border: 1px dashed var(--border-color); border-radius: 10px; padding: 0.6rem 0.8rem; }
.auto-rr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.2rem 0.8rem; margin-top: 0.4rem; max-height: 160px; overflow-y: auto; font-size: 0.85rem; }
.auto-rr-list label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.auto-preview { padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--bg-surface-elevated); font-size: 0.85rem; }
.auto-err { padding: 0.6rem 0.8rem; border-radius: 10px; background: color-mix(in srgb, #dc2626 12%, transparent); color: #b91c1c; font-size: 0.85rem; font-weight: 600; }
.auto-err[hidden] { display: none; }
/* registro */
.auto-runs { display: flex; flex-direction: column; gap: 0.4rem; }
.auto-run { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
.auto-run > div { flex: 1; min-width: 0; }
.auto-run b { display: block; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-run small { color: var(--text-secondary); font-size: 0.74rem; }
.auto-run-msg { font-size: 0.8rem; margin-top: 0.15rem; }
.auto-run-ic { display: inline-flex; flex: none; }
.auto-run.is-ok .auto-run-ic { color: #16a34a; }
.auto-run.is-skip .auto-run-ic { color: var(--text-secondary); }
.auto-run.is-error { border-color: color-mix(in srgb, #dc2626 40%, transparent); }
.auto-run.is-error .auto-run-ic { color: #dc2626; }
@media (max-width: 800px) { .auto-modal-overlay { padding: 0; align-items: flex-end; } .auto-modal, .auto-modal.is-wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; } .auto-rule { flex-wrap: wrap; } .auto-rule-actions { width: 100%; justify-content: flex-start; } }
/* etapa do fluxo */
.stage-chip { color: var(--accent-primary) !important; background: color-mix(in srgb, var(--accent-primary) 12%, transparent) !important; font-weight: 700; }
.stage-chip.is-late { color: #b91c1c !important; background: color-mix(in srgb, #dc2626 12%, transparent) !important; }
.stage-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 1rem; background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface)); border-bottom: 1px solid color-mix(in srgb, var(--accent-primary) 25%, transparent); font-size: 0.85rem; }
.stage-band-text { display: inline-flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 200px; color: var(--accent-primary); }
.stage-band-text em { font-style: normal; font-weight: 800; }
.stage-band-text em.is-late { color: #b91c1c; }
.stage-band-actions { display: inline-flex; gap: 0.4rem; }
.auto-type { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.auto-type button { text-align: left; font-family: inherit; padding: 0.6rem 0.8rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); cursor: pointer; display: flex; flex-direction: column; gap: 0.1rem; }
.auto-type button small { color: var(--text-secondary); font-size: 0.74rem; }
.auto-type button.on { border-color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface)); }
.auto-type button:disabled { cursor: default; opacity: 0.8; }
.auto-type button:disabled:not(.on) { display: none; }
.auto-type:has(button:disabled) { grid-template-columns: 1fr; }
.auto-due { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.auto-due input[type=number] { width: 5.5rem; font-family: inherit; font-size: 0.88rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); }
.auto-due select { font-family: inherit; font-size: 0.88rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); }
.auto-due [hidden] { display: none; }
.auto-kind { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.1rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--accent-primary) 14%, transparent); color: var(--accent-primary); margin-left: 0.3rem; vertical-align: middle; }
.auto-kind.is-adv { background: color-mix(in srgb, #0891b2 14%, transparent); color: #0e7490; }
.st-line { margin: 0; font-size: 0.95rem; }
.auto-foot .st-left { margin-right: auto; }
.auto-lbl textarea { font-family: inherit; font-size: 0.9rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); resize: vertical; }
/* montar fluxo */
.fl-switch { padding: 0.7rem 0.9rem; border: 1px solid color-mix(in srgb, var(--accent-primary) 25%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-surface)); }
.fl-table { display: flex; flex-direction: column; gap: 0.4rem; }
.fl-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(210px, 1.7fr) minmax(230px, 1.8fr) 7.5rem 9.5rem; gap: 0.5rem 0.7rem; align-items: center; padding: 0.55rem 0.7rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
.fl-row.fl-head { border: 0; padding-top: 0; padding-bottom: 0; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.fl-row.is-out { opacity: 0.6; border-style: dashed; }
.fl-row.is-done { grid-template-columns: 1fr; background: var(--bg-surface-elevated); }
.fl-col { display: flex; flex-direction: column; min-width: 0; }
.fl-col small { color: var(--text-secondary); font-size: 0.74rem; }
.fl-who, .fl-due { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.fl-row select, .fl-row input[type=number] { font-family: inherit; font-size: 0.84rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); max-width: 100%; }
.fl-row input[type=number] { width: 4.5rem; }
.fl-row [hidden] { display: none; }
.fl-chk { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; white-space: nowrap; cursor: pointer; }
@media (max-width: 800px) { .fl-row { grid-template-columns: 1fr 1fr; } .fl-row.fl-head { display: none; } .fl-col, .fl-who, .fl-due { grid-column: 1 / -1; } }
.col-flow-summary { margin: 0.25rem 0.1rem 0.1rem; padding: 0.15rem 0.5rem; font-size: 0.72rem; font-weight: 700; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 10%, transparent); border-radius: 999px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fl-table { min-width: 0; } .fl-row > * { min-width: 0; } .fl-row.fl-head { background: transparent; }
.auto-modal, .auto-rule, .auto-sentence, .auto-fs, .auto-type button { border-radius: var(--radius-lg); } .auto-rule, .auto-fs, .auto-type button, .fl-row, .fl-switch { border-radius: var(--radius-md); }
.fl-name { display: inline-flex; align-items: center; gap: 0.45rem; }
.fl-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; border-radius: var(--radius-full); background: var(--accent-primary); color: #fff; font-style: normal; font-size: 0.74rem; font-weight: 800; flex: none; }
.fl-num[hidden] { display: none; }
.fl-next { font-size: 0.72rem; color: var(--accent-primary); font-weight: 600; }
.fl-keep { font-size: 0.78rem; color: var(--text-secondary); font-style: italic; }
.fl-keep[hidden] { display: none; }
.fl-row.is-keep { background: color-mix(in srgb, #f59e0b 8%, var(--bg-surface)); border-color: color-mix(in srgb, #f59e0b 40%, transparent); }
.fl-copy { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.5rem; border: 1px dashed var(--border-color); border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.fl-copy:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.fl-summary { padding: 0.65rem 0.9rem; border-radius: var(--radius-md); background: var(--bg-surface-elevated); font-size: 0.86rem; line-height: 1.5; }
.fl-summary[hidden] { display: none; }
.fl-summary small { color: var(--text-secondary); font-size: 0.78rem; }
.stage-band-actions .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.project-auto { display: inline-flex; align-items: center; margin-left: 5px; color: var(--accent-primary); opacity: 0.85; vertical-align: middle; }
.project-auto.is-manage { cursor: pointer; }
.project-auto.is-manage:hover { opacity: 1; }
.m-auto { display: inline-flex; align-items: center; margin-left: 6px; color: var(--accent-primary); }
.fl-apply { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.4rem 0.2rem; }
.fl-warn { padding: 0.6rem 0.9rem; border-radius: var(--radius-md); background: color-mix(in srgb, #f59e0b 12%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); font-size: 0.84rem; }
.fl-warn[hidden] { display: none; }
/* evolucao da tarefa no fluxo */
.sp-pct { font-weight: 700; color: var(--accent-primary); }
.sp-total { color: var(--text-secondary); } .sp-total em { font-style: normal; font-size: 0.74rem; }
.sp-toggle { margin-left: auto; display: inline-flex; border: 1px solid var(--border-color); border-radius: var(--radius-full); overflow: hidden; }
.sp-toggle button { border: 0; background: transparent; padding: 0.15rem 0.7rem; font-family: inherit; font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.sp-toggle button[aria-pressed="true"] { background: var(--accent-primary); color: #fff; }
.sp-late { font-style: normal; font-size: 0.7rem; font-weight: 800; color: #dc2626; }
.sp-back { font-size: 0.68rem; font-weight: 800; color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); border-radius: 99px; padding: 0 0.4rem; }
.sp-detail-title { font-weight: 800; margin-bottom: 0.3rem; }
.sp-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.2rem 1rem; } .sp-detail-grid span { color: var(--text-secondary); font-size: 0.74rem; display: block; }
.sp-detail ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.sp-nohist { display: block; margin-top: 0.4rem; color: var(--text-secondary); }

/* gaveta: evolucao (resumo + lista) */
.stage-progress { padding: 0.55rem 1rem; background: var(--bg-surface); border-bottom: 1px solid var(--border-color); font-size: 0.82rem; }
.sp-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; }
.sp-title { font-size: 0.86rem; }
.sp-segbar { display: inline-flex; gap: 2px; flex: 0 1 220px; min-width: 90px; height: 6px; }
.sp-segbar i { flex: 1; border-radius: 99px; background: color-mix(in srgb, var(--accent-primary) 18%, transparent); }
.sp-segbar i.is-done { background: var(--accent-primary); }
.sp-segbar i.is-current { background: color-mix(in srgb, var(--accent-primary) 55%, #fff); box-shadow: 0 0 0 1px var(--accent-primary); }
.sp-now { color: var(--text-primary); } .sp-now em { font-style: normal; font-weight: 700; color: var(--accent-primary); } .sp-now em.is-late { color: #dc2626; }
.sp-more { margin-left: 0.2rem; display: inline-flex; align-items: center; gap: 0.2rem; border: 0; background: transparent; color: var(--accent-primary); font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; padding: 0.1rem 0.2rem; }
.sp-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.sp-row { border-radius: var(--radius-sm); }
.sp-row.is-current { background: color-mix(in srgb, var(--accent-primary) 8%, transparent); }
.sp-row-main { width: 100%; display: grid; grid-template-columns: 12px minmax(90px, 1.2fr) minmax(70px, 1fr) minmax(60px, 1.4fr) auto auto auto; align-items: center; gap: 0.5rem; padding: 0.3rem 0.45rem; border: 0; background: transparent; color: var(--text-primary); font-family: inherit; font-size: 0.8rem; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.sp-row-main:hover { background: color-mix(in srgb, var(--accent-primary) 6%, transparent); }
.sp-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-surface); box-sizing: border-box; }
.sp-dot.is-done { background: var(--accent-primary); border-color: var(--accent-primary); }
.sp-dot.is-current { border-color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 40%, #fff); }
.sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-who { color: var(--text-secondary); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meter { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent-primary) 10%, transparent); overflow: hidden; }
.sp-meter i { display: block; height: 100%; background: var(--accent-primary); border-radius: 99px; }
.sp-time { font-weight: 700; font-size: 0.78rem; min-width: 56px; text-align: right; }
.sp-future { padding: 0.35rem 0.45rem; color: var(--text-secondary); font-size: 0.78rem; }
.sp-detail { margin: 0.1rem 0.45rem 0.4rem 1.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface-elevated); font-size: 0.78rem; }
@media (max-width: 800px) { .sp-row-main { grid-template-columns: 12px 1fr auto auto; } .sp-who, .sp-meter { display: none; } .sp-segbar { flex-basis: 100%; } .sp-toggle { margin-left: 0; } }
/* cartao: uma linha so + barra fina na base */
.stage-chip { display: flex !important; align-items: center; gap: 0.3rem; width: 100%; max-width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-transform: none !important; letter-spacing: 0 !important; font-size: 0.74rem !important; font-weight: 700; position: static; }
.stage-chip-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stage-chip-due { flex: none; font-weight: 600; opacity: 0.85; }
.stage-bar { position: absolute; left: 0; bottom: 0; right: 0; height: 3px; background: color-mix(in srgb, var(--accent-primary) 14%, transparent); pointer-events: none; border-radius: 0 0 var(--radius-md) var(--radius-md); overflow: hidden; }
.stage-bar i { display: block; height: 100%; background: var(--accent-primary); }
.today-task-card, .task-card { position: relative; }
/* dica ao passar o mouse */
.sp-pop { position: fixed; z-index: 3000; width: 300px; max-width: calc(100vw - 16px); padding: 0.7rem 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22); font-size: 0.78rem; pointer-events: none; }
.sp-pop-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; } .sp-pop-head span:first-of-type { color: var(--accent-primary); font-weight: 700; } .sp-pop-mode { margin-left: auto; color: var(--text-secondary); font-size: 0.72rem; }
.sp-pop .sp-segbar { display: flex; width: 100%; flex: none; margin-bottom: 0.4rem; }
.sp-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-pop li { display: grid; grid-template-columns: 10px 1fr auto auto auto; gap: 0.4rem; align-items: center; } .sp-pop li.is-current { color: var(--accent-primary); }
.sp-pop li em { font-style: normal; font-weight: 700; } .sp-pop li span { color: var(--text-secondary); font-size: 0.72rem; }
.sp-pop-fut, .sp-pop-total { margin-top: 0.4rem; color: var(--text-secondary); font-size: 0.74rem; }
.sp-pop-total { font-weight: 700; color: var(--text-primary); }

/* barra grande da evolucao (largura proporcional ao tempo) */
.sp-timeline { display: flex; align-items: stretch; gap: 3px; margin-top: 0.5rem; min-height: 28px; }
.sp-tl-seg { position: relative; min-width: 56px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; padding: 0.15rem 0.5rem; border: 0; border-radius: var(--radius-sm); background: var(--accent-primary); color: #fff; font-family: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.sp-tl-seg b { max-width: 100%; font-size: 0.72rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-tl-seg small { font-size: 0.74rem; font-weight: 800; line-height: 1.15; opacity: 0.95; white-space: nowrap; }
.sp-tl-seg.is-narrow b { display: none; }
.sp-tl-seg:hover { filter: brightness(1.08); }
.sp-tl-seg.is-current { background: repeating-linear-gradient(45deg, var(--accent-primary), var(--accent-primary) 8px, color-mix(in srgb, var(--accent-primary) 70%, #fff) 8px, color-mix(in srgb, var(--accent-primary) 70%, #fff) 16px); background-size: 22px 22px; animation: sp-stripes 1.2s linear infinite; }
@keyframes sp-stripes { to { background-position: 22px 0; } }
.sp-tl-seg.is-late { box-shadow: inset 0 0 0 2px #dc2626; }
.sp-tl-seg.is-nodata { background: color-mix(in srgb, var(--accent-primary) 35%, var(--bg-surface)); color: var(--text-primary); border: 1px dashed var(--accent-primary); }
.sp-tl-fut { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; padding: 0 0.3rem; } .sp-tl-fut i { width: 6px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--accent-primary) 20%, transparent); } .sp-tl-fut em { font-style: normal; font-size: 0.72rem; font-weight: 800; color: var(--text-secondary); margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .sp-tl-seg.is-current { animation: none; } }
@media (max-width: 800px) { .sp-timeline { overflow-x: auto; } }

/* faixa de etapas em setas */
.sp-chev { display: flex; margin-top: 0.5rem; padding-right: 8px; min-height: 30px; overflow-x: auto; }
.sp-chev-seg { position: relative; flex: 1 1 0; min-width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; margin-right: -6px; padding: 0.15rem 12px 0.15rem 14px; border: 0; background: var(--accent-primary); color: #fff; font-family: inherit; cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.sp-chev-seg:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: 8px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.sp-chev-seg:hover { filter: brightness(1.08); }
.sp-chev-t, .sp-chev-n { font-size: 0.72rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.sp-chev-ic { position: absolute; left: 14px; font-size: 0.7rem; opacity: 0.85; }
.sp-chev-name { display: none; max-width: 100%; font-size: 0.64rem; font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.92; }
.sp-chev-seg.show-name .sp-chev-name { display: block; }
.sp-chev-seg.is-current { background: repeating-linear-gradient(45deg, var(--accent-primary), var(--accent-primary) 7px, color-mix(in srgb, var(--accent-primary) 72%, #fff) 7px, color-mix(in srgb, var(--accent-primary) 72%, #fff) 14px); box-shadow: inset 0 -3px 0 rgba(255,255,255,0.45); }
.sp-chev-seg.is-future { background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface)); color: color-mix(in srgb, var(--text-secondary) 70%, transparent); cursor: default; }
.sp-chev-seg.has-late::after { content: ''; position: absolute; top: 3px; right: 16px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }
.sp-chev-back { position: absolute; top: 1px; left: 15px; font-size: 0.66rem; font-weight: 800; }
.sp-prop { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.sp-prop-cap { flex: none; font-size: 0.68rem; color: var(--text-secondary); }
.sp-prop-bar { flex: 1; display: flex; gap: 2px; height: 7px; }
.sp-prop-bar i { border-radius: 99px; background: var(--accent-primary); } .sp-prop-bar i.alt { background: color-mix(in srgb, var(--accent-primary) 55%, #fff); }
.sp-totalbox { display: inline-flex; flex-direction: column; line-height: 1.15; padding: 0.1rem 0.6rem; border-left: 2px solid var(--border-color); font-size: 0.74rem; color: var(--text-secondary); }
.sp-totalbox em { font-style: normal; font-size: 0.68rem; } .sp-totalbox .is-main { color: var(--text-primary); font-weight: 800; font-size: 0.84rem; }
@media (max-width: 800px) { .sp-chev-seg { min-width: 44px; } .sp-chev-seg:not(.show-name) .sp-chev-name { display: none; } }

/* mapa de calor: etapas que gastaram mais tempo ficam mais largas e mais escuras */
.sp-chev-seg.is-done.heat-1 { background: color-mix(in srgb, var(--accent-primary) 62%, #fff); }
.sp-chev-seg.is-done.heat-2 { background: var(--accent-primary); }
.sp-chev-seg.is-done.heat-3 { background: color-mix(in srgb, var(--accent-primary) 80%, #000); }
.sp-chev-seg.is-current.heat-3 { filter: brightness(0.9); }
.sp-chev-seg.is-bottleneck { background: #d97706 !important; color: #fff; }
.sp-chev-seg.is-bottleneck.is-current { background: repeating-linear-gradient(45deg, #d97706, #d97706 7px, #f59e0b 7px, #f59e0b 14px) !important; }
.sp-chev-seg.is-bottleneck .sp-chev-name { display: block; }

.fl-type { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; }
.fl-type span { color: var(--text-secondary); }
.auto-warn { padding: 0.55rem 0.8rem; border-radius: var(--radius-md); background: color-mix(in srgb, #f59e0b 12%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); font-size: 0.82rem; }
.pt-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tb-proj-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.3rem 0; }
.tb-proj-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.3rem 0.15rem 0.6rem; border-radius: 99px; background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-surface)); color: var(--accent-primary); font-size: 0.8rem; font-weight: 700; }
.tb-proj-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.3rem; }
.tb-proj-any { color: var(--text-secondary); font-size: 0.82rem; }

/* Montar fluxo: decisoes obrigatorias, explicacoes e colunas que faltam */
.fl-card { padding: 0.8rem 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); display: flex; flex-direction: column; gap: 0.35rem; }
.fl-card.is-missing { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 6%, var(--bg-surface)); }
.fl-card header { display: flex; align-items: center; gap: 0.6rem; } .fl-card h3 { margin: 0; font-size: 0.98rem; flex: 1; }
.fl-step { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-primary); color: #fff; font-size: 0.8rem; font-weight: 800; flex: none; }
.fl-state { font-size: 0.74rem; font-weight: 800; padding: 0.1rem 0.55rem; border-radius: 99px; } .fl-state.is-ok { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; } .fl-state.is-bad { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #b45309; }
.fl-why { margin: 0 0 0.2rem; font-size: 0.82rem; color: var(--text-secondary); }
.fl-opt { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.35rem 0.4rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.86rem; } .fl-opt:hover { background: var(--bg-surface-elevated); } .fl-opt input { margin-top: 0.2rem; } .fl-opt em { display: block; font-style: normal; color: var(--text-secondary); font-size: 0.78rem; }
.fl-type-pick { margin-left: 1.6rem; display: flex; flex-direction: column; gap: 0.4rem; } .fl-type-pick[hidden], #fl-apply-row[hidden], #fl-table-wrap[hidden], .fl-card[hidden] { display: none; }
.fl-h3 { margin: 0.4rem 0 0; font-size: 0.98rem; } .fl-h3 small { font-weight: 600; color: var(--text-secondary); }
.fl-row.fl-head span { display: flex; flex-direction: column; gap: 0.1rem; text-transform: none; letter-spacing: 0; } .fl-row.fl-head b { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; } .fl-row.fl-head small { font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); line-height: 1.25; }
.fl-row.is-missing { border-color: #f59e0b; box-shadow: inset 3px 0 0 #f59e0b; } .fl-miss { color: #b45309; font-weight: 700; } .fl-miss[hidden] { display: none; }
.fl-row select:disabled { opacity: 0.45; }
.fl-status { margin-right: auto; margin-left: 0.8rem; font-size: 0.8rem; font-weight: 700; color: #b45309; } .fl-status.is-ok { color: #15803d; }
.auto-foot { flex-wrap: wrap; } .fl-acc select { max-width: 100%; }

.fl-type-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0; } .fl-type-lock { margin-top: 0.3rem; padding-top: 0.4rem; border-top: 1px dashed var(--border-color); } .fl-type-lock[hidden], #fl-apply-row[hidden] { display: none; }
.fl-sub { margin: 0 0 0.2rem; font-size: 0.82rem; font-weight: 700; }
.fl-type-lock.is-off { opacity: 0.55; } .fl-sub small { font-weight: 500; color: var(--text-secondary); }
.fl-opt-sel { margin: 0.2rem 0 0.4rem 1.6rem; } .fl-opt-sel[hidden] { display: none; } .fl-opt-sel select { min-width: 14rem; }

.fl-grp { flex: 1 1 100%; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 0.6rem; border: 1px dashed var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
.fl-grp[hidden] { display: none; }
.fl-grp-top { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fl-grp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.fl-grp-list li { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; }
.fl-grp-list li b { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--accent-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; flex: none; }
.fl-grp-list li span { flex: 1; }
.fl-grp-mv, .fl-grp-x { border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-secondary); border-radius: 6px; width: 1.6rem; height: 1.6rem; cursor: pointer; line-height: 1; }
.fl-grp-mv:disabled { opacity: 0.35; cursor: default; }
.fl-grp-add { align-self: flex-start; }
.fl-grp-hint { color: var(--text-secondary); font-size: 0.74rem; line-height: 1.35; }
.grp-members { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.grp-members li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.35rem 0.6rem; border-radius: var(--radius-md); background: var(--bg-surface-elevated, var(--bg-surface)); border: 1px solid var(--border-color); }
.grp-members li.is-done { border-color: #86efac; } .grp-members li.is-returned { border-color: #fca5a5; } .grp-members li.is-pending { border-color: var(--accent-primary); }
.grp-members .grp-ic { width: 1.2rem; text-align: center; }
.grp-members small { color: var(--text-secondary); }

.fl-flags { display: flex; flex-direction: column; gap: 0.3rem; } .fl-flag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; cursor: pointer; line-height: 1.2; } .fl-flag.is-off { opacity: 0.45; }

.ph-body { display: flex; flex-direction: column; gap: 0.6rem; }
.ph-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ph-chip { border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-secondary); border-radius: 999px; padding: 0.2rem 0.7rem; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.ph-chip.on { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.ph-date { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); }
.ph-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 60vh; overflow-y: auto; padding-right: 0.2rem; }
.ph-day { margin: 0.6rem 0 0.1rem; font-size: 0.78rem; text-transform: capitalize; color: var(--text-secondary); position: sticky; top: 0; background: var(--bg-surface); padding: 0.2rem 0; }
.ph-item { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.45rem 0.6rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
.ph-ic { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-surface)); color: var(--accent-primary); }
.ph-ic.ph-automacoes { background: #fef3c7; color: #b45309; } .ph-ic.ph-pessoas { background: #dcfce7; color: #15803d; } .ph-ic.ph-colunas { background: #e0f2fe; color: #0369a1; }
.ph-text { font-size: 0.86rem; line-height: 1.35; overflow-wrap: anywhere; } .ph-main small { color: var(--text-secondary); font-size: 0.74rem; }
.ph-empty { color: var(--text-secondary); font-size: 0.88rem; padding: 1rem 0; text-align: center; }

.fl-extra { margin: 0.2rem 0 0.6rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
.fl-grp-out { color: #b45309; font-size: 0.7rem; font-weight: 700; }
.guest-note { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: #fffbeb; border-bottom: 1px solid #fcd34d; color: #92400e; font-size: 0.82rem; }

/* caminhos (desvio) do "ao concluir a etapa" */
.au-route { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0; }
.au-route input[type=text] { flex: 1; min-width: 0; padding: 0.4rem 0.55rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); font-family: inherit; }
.au-route select { flex: 1; min-width: 0; padding: 0.4rem 0.5rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); font-family: inherit; }
.au-arrow { color: var(--text-muted); }
.au-rx { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.au-rx:hover { color: #b91c1c; }
.st-routes { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }

/* aviso de aniversários (cartão no topo das automações do projeto) */
.auto-aniv { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.8rem 0.9rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-surface); margin-bottom: 0.9rem; }
.auto-aniv.is-off { opacity: 0.6; }
.auto-aniv-warn { color: var(--accent-amber, #b45309); }
.auto-aniv-main { flex: 1; min-width: 0; }
.auto-aniv-name { font-size: 0.92rem; }
.auto-aniv-text { font-size: 0.86rem; margin-top: 0.15rem; }
.auto-aniv-meta { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.78rem; color: var(--text-secondary); }
.auto-aniv-sent { color: #15803d; }

/* painel de automações em blocos: Fluxo das etapas / Avisos / Regras avançadas */
.auto-sec { margin-bottom: 1.1rem; }
.auto-sec > h3 { margin: 0 0 0.45rem; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.auto-sec-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-surface); font-size: 0.86rem; }
.auto-sec-row .btn { flex: none; }
/* bloco do aviso de aniversários: uma linha fechada; detalhes abrem ali mesmo */
.auto-aniv { display: block; padding: 0; }
.auto-aniv-top { display: flex; align-items: flex-start; gap: 0.8rem; padding: 0.75rem 0.9rem; }
.auto-aniv-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.6rem; }
.auto-aniv-name { font-size: 0.92rem; }
.auto-aniv-state { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.auto-aniv-state.is-on { color: #15803d; }
.auto-aniv-line { flex-basis: 100%; font-size: 0.8rem; color: var(--text-secondary); }
.auto-aniv-warn { color: #b45309; }
.auto-aniv-details { border-top: 1px solid var(--border-color); padding: 0.6rem 0.9rem 0.8rem; }
.auto-aniv-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.auto-aniv-tab { border: 1px solid var(--border-color); background: var(--bg-surface-elevated, transparent); color: var(--text-secondary); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.auto-aniv-tab.is-active { background: var(--accent-primary, #4f46e5); border-color: var(--accent-primary, #4f46e5); color: #fff; }
.auto-aniv-pane { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.3rem; }
.au-an-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0.55rem; border-radius: 8px; background: var(--bg-surface-elevated, rgba(0,0,0,0.03)); font-size: 0.82rem; }
.au-an-row > span { min-width: 0; display: flex; flex-direction: column; }
.au-an-row small { color: var(--text-secondary); font-size: 0.74rem; }
.au-an-row.is-warn small { color: #b45309; }
.au-an-row .btn { flex: none; }
.au-an-empty { margin: 0.4rem 0; font-size: 0.82rem; color: var(--text-secondary); }
.auto-aniv-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 0.6rem; }
.auto-aniv-foot small { font-size: 0.76rem; color: var(--text-secondary); }
.auto-aniv-foot .btn { flex: none; }
@media (max-width: 600px) { .auto-aniv-foot, .auto-sec-row { flex-direction: column; align-items: stretch; } }
