/* Fluxo sequencial do Ponto. Escopo isolado para nao alterar os demais modulos. */
.ponto-flow {
  --ponto-navy: #0b2f67;
  --ponto-blue: #1769e0;
  --ponto-text: #14233b;
  --ponto-muted: #52637a;
  --ponto-line: #d8e1eb;
  --ponto-canvas: #f3f6f9;
  --ponto-surface: #ffffff;
  --ponto-soft: #f8fafc;
  --ponto-green: #15803d;
  --ponto-green-soft: #eaf7ee;
  --ponto-yellow: #704100;
  --ponto-yellow-soft: #fff2c2;
  --ponto-red: #c62828;
  --ponto-red-soft: #fff0f0;
  display: grid;
  gap: 18px;
  color: var(--ponto-text);
}

.ponto-flow *,
.ponto-flow *::before,
.ponto-flow *::after {
  box-sizing: border-box;
}

.ponto-flow h1,
.ponto-flow h2,
.ponto-flow h3,
.ponto-flow p {
  margin-top: 0;
}

.ponto-flow__breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: -4px;
  font-size: 13px;
}

.ponto-flow__breadcrumb a {
  color: var(--ponto-blue);
  text-decoration: none;
}

.ponto-flow__hero,
.ponto-flow__start-card,
.ponto-flow__stage-map,
.ponto-flow__work-card,
.ponto-flow__side-card,
.ponto-flow__audit,
.ponto-flow__derived {
  border: 1px solid var(--ponto-line);
  border-radius: 14px;
  background: var(--ponto-surface);
  box-shadow: 0 8px 24px rgba(15, 39, 74, 0.05);
}

.ponto-flow__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border-left: 5px solid var(--ponto-blue);
}

.ponto-flow__hero h1 {
  margin: 4px 0 6px;
  color: var(--ponto-navy);
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.12;
}

.ponto-flow__hero p,
.ponto-flow__section-head p,
.ponto-flow__start-card p,
.ponto-flow__clinic p,
.ponto-flow__certificate > p,
.ponto-flow__generated-actions > p {
  margin-bottom: 0;
  color: var(--ponto-muted);
}

.ponto-flow__hero-actions,
.ponto-flow__form-actions,
.ponto-flow__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ponto-flow__eyebrow {
  display: block;
  color: var(--ponto-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.ponto-flow__case-status,
.ponto-flow__status-chip,
.ponto-flow__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid #cbd7e5;
  border-radius: 999px;
  background: #edf3fb;
  color: var(--ponto-navy);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ponto-flow__case-status--concluido,
.ponto-flow__status-chip--concluida {
  border-color: #acd8b9;
  background: var(--ponto-green-soft);
  color: var(--ponto-green);
}

.ponto-flow__case-status--aguardando_fechamento,
.ponto-flow__case-status--em_verificacao,
.ponto-flow__case-status--reconciliacao,
.ponto-flow__status-chip--disponivel,
.ponto-flow__status-chip--em_andamento {
  border-color: #f1cb71;
  background: var(--ponto-yellow-soft);
  color: var(--ponto-yellow);
}

.ponto-flow__case-status--cancelado {
  border-color: #e6a7a7;
  background: var(--ponto-red-soft);
  color: var(--ponto-red);
}

.ponto-flow__status-chip--reaberta {
  border-color: #eab1b1;
  background: var(--ponto-red-soft);
  color: var(--ponto-red);
}

.ponto-flow__start-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.ponto-flow__start-card h2,
.ponto-flow__section-head h2,
.ponto-flow__certificate h3,
.ponto-flow__generated-actions h3 {
  margin: 4px 0 5px;
  color: var(--ponto-navy);
}

.ponto-flow__summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ponto-line);
  border-radius: 14px;
  background: var(--ponto-surface);
}

.ponto-flow__summary article {
  display: grid;
  gap: 4px;
  min-height: 108px;
  padding: 18px 20px;
  border-top: 4px solid var(--ponto-blue);
}

.ponto-flow__summary article + article {
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--ponto-line);
}

.ponto-flow__summary article.is-alert {
  border-top-color: #e3a617;
  background: var(--ponto-yellow-soft);
}

.ponto-flow__summary article.is-success {
  border-top-color: var(--ponto-green);
  background: var(--ponto-green-soft);
}

.ponto-flow__summary span,
.ponto-flow__summary small {
  color: var(--ponto-muted);
}

.ponto-flow__summary span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ponto-flow__summary strong {
  color: var(--ponto-navy);
  font-size: 21px;
}

.ponto-flow__stage-map,
.ponto-flow__work-card,
.ponto-flow__side-card,
.ponto-flow__audit,
.ponto-flow__derived {
  padding: 22px;
}

.ponto-flow__section-head {
  margin-bottom: 16px;
}

.ponto-flow__legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ponto-muted);
  font-size: 12px;
  white-space: nowrap;
}

.ponto-flow__legend i,
.ponto-flow__legend b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ponto-flow__legend i { background: var(--ponto-yellow); }
.ponto-flow__legend b { background: var(--ponto-green); }

.ponto-flow__stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ponto-flow__stage {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 90px;
  padding: 13px;
  border: 1px solid var(--ponto-line);
  border-radius: 10px;
  background: var(--ponto-soft);
}

.ponto-flow__stage.is-current {
  border-color: #e3a617;
  background: var(--ponto-yellow-soft);
  box-shadow: inset 0 -3px 0 #e3a617;
}

.ponto-flow__stage--concluida {
  border-color: #b9ddc3;
  background: var(--ponto-green-soft);
}

.ponto-flow__stage--reaberta {
  border-color: #e8adad;
  background: var(--ponto-red-soft);
}

.ponto-flow__stage--bloqueada,
.ponto-flow__stage--nao_aplicavel {
  color: #4f5f73;
  background: #f4f6f8;
}

.ponto-flow__stage-number {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ponto-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ponto-flow__stage--concluida .ponto-flow__stage-number { background: var(--ponto-green); }
.ponto-flow__stage--bloqueada .ponto-flow__stage-number,
.ponto-flow__stage--nao_aplicavel .ponto-flow__stage-number { background: #59697b; }
.ponto-flow__stage--reaberta .ponto-flow__stage-number { background: var(--ponto-red); }

.ponto-flow__stage-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ponto-flow__stage-copy strong {
  color: inherit;
  font-size: 12px;
  line-height: 1.3;
}

.ponto-flow__stage-copy span,
.ponto-flow__stage-copy small {
  color: var(--ponto-muted);
  font-size: 11px;
}

.ponto-flow__workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.8fr);
  align-items: start;
  gap: 18px;
}

.ponto-flow__section-head--work {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ponto-line);
}

.ponto-flow__work-status {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.ponto-flow__sla {
  display: inline-grid;
  gap: 2px;
  min-width: 128px;
  padding: 7px 10px;
  border: 1px solid #cbd7e5;
  border-left: 4px solid var(--ponto-blue);
  border-radius: 8px;
  background: #edf3fb;
  color: var(--ponto-navy);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.ponto-flow__sla small {
  color: inherit;
  font-size: 10px;
  font-weight: 600;
}

.ponto-flow__sla--alerta {
  border-color: #e3a617;
  background: var(--ponto-yellow-soft);
  color: var(--ponto-yellow);
}

.ponto-flow__sla--vencido {
  border-color: #d84a4a;
  background: var(--ponto-red-soft);
  color: var(--ponto-red);
}

.ponto-flow__sla--no_prazo {
  border-color: #45a562;
  background: var(--ponto-green-soft);
  color: var(--ponto-green);
}

.ponto-flow__clinic,
.ponto-flow__completed-state,
.ponto-flow__locked,
.ponto-flow__empty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #cfddeb;
  border-radius: 10px;
  background: #eef5fc;
}

.ponto-flow__clinic-icon,
.ponto-flow__completed-state > span {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--ponto-navy);
  color: #fff;
  font-weight: 800;
}

.ponto-flow__completed-state {
  border-color: #b9ddc3;
  background: var(--ponto-green-soft);
}

.ponto-flow__completed-state > span { background: var(--ponto-green); }
.ponto-flow__completed-state p { margin: 2px 0 0; color: #456151; }

.ponto-flow__form,
.ponto-flow__compact-form {
  display: grid;
  gap: 16px;
}

.ponto-flow__contact-grid,
.ponto-flow__notes-grid,
.ponto-flow__compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ponto-flow__field,
.ponto-flow__compact-form label {
  display: grid;
  gap: 7px;
  color: var(--ponto-text);
  font-size: 12px;
  font-weight: 700;
}

.ponto-flow__field input,
.ponto-flow__field select,
.ponto-flow__field textarea,
.ponto-flow__compact-form input,
.ponto-flow__compact-form select,
.ponto-flow__compact-form textarea,
.ponto-flow__reopen input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #c7d4e2;
  border-radius: 8px;
  background: #fff;
  color: var(--ponto-text);
  font: inherit;
  font-weight: 500;
}

.ponto-flow__field textarea,
.ponto-flow__compact-form textarea {
  min-height: 94px;
  resize: vertical;
}

.ponto-flow__field input:focus,
.ponto-flow__field select:focus,
.ponto-flow__field textarea:focus,
.ponto-flow__compact-form input:focus,
.ponto-flow__compact-form select:focus,
.ponto-flow__compact-form textarea:focus,
.ponto-flow__reopen input:focus {
  border-color: var(--ponto-blue);
  outline: 3px solid rgba(23, 105, 224, 0.16);
}

.ponto-flow__field--wide,
.ponto-flow__compact-form .is-wide {
  grid-column: 1 / -1;
}

.ponto-flow__check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  background: var(--ponto-yellow-soft);
  color: #76500a;
  font-size: 12px;
  font-weight: 700;
}

.ponto-flow__override {
  padding: 13px;
  border: 1px solid #e6caca;
  border-radius: 10px;
  background: #fff8f8;
}

.ponto-flow__override summary {
  cursor: pointer;
  color: var(--ponto-red);
  font-weight: 800;
}

.ponto-flow__override[open] {
  display: grid;
  gap: 12px;
}

.ponto-flow__form-actions {
  padding-top: 14px;
  border-top: 1px solid var(--ponto-line);
}

.ponto-flow__form-actions > span {
  max-width: 58ch;
  color: var(--ponto-muted);
  font-size: 11px;
}

.ponto-flow__side-stack {
  display: grid;
  gap: 18px;
}

.ponto-flow__documents,
.ponto-flow__generated-actions ul {
  display: grid;
  gap: 9px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.ponto-flow__documents li,
.ponto-flow__generated-actions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--ponto-line);
  border-radius: 8px;
  background: var(--ponto-soft);
}

.ponto-flow__documents li {
  display: grid;
}

.ponto-flow__documents a,
.ponto-flow__generated-actions a {
  color: var(--ponto-blue);
  font-weight: 800;
  text-decoration: none;
}

.ponto-flow__documents a,
.ponto-flow__documents span,
.ponto-flow__audit-documents a,
.ponto-flow__audit-documents small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ponto-flow__documents span,
.ponto-flow__generated-actions span {
  color: var(--ponto-muted);
  font-size: 11px;
}

.ponto-flow__upload {
  display: grid;
  gap: 11px;
  padding-top: 14px;
  border-top: 1px solid var(--ponto-line);
}

.ponto-flow__file {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px dashed #9eb3ca;
  border-radius: 9px;
  background: #f7fbff;
  cursor: pointer;
}

.ponto-flow__file span { color: var(--ponto-blue); font-weight: 800; }
.ponto-flow__file small { color: var(--ponto-muted); }

.ponto-flow__side-card--rules {
  border-left: 4px solid #e3a617;
  background: var(--ponto-yellow-soft);
}

.ponto-flow__side-card--rules p { margin-bottom: 0; color: #6d541b; }

.ponto-flow__audit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ponto-flow__audit-item {
  padding: 15px;
  border: 1px solid var(--ponto-line);
  border-radius: 10px;
  background: var(--ponto-soft);
}

.ponto-flow__audit-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ponto-flow__audit-heading > span {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ponto-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.ponto-flow__audit-heading div {
  display: grid;
  gap: 2px;
}

.ponto-flow__audit-heading small,
.ponto-flow__audit-item p,
.ponto-flow__audit-item li {
  color: var(--ponto-muted);
  font-size: 11px;
}

.ponto-flow__audit-item details { margin-top: 9px; }
.ponto-flow__audit-item summary { cursor: pointer; color: var(--ponto-blue); font-weight: 700; }
.ponto-flow__audit-item ul { padding-left: 18px; }

.ponto-flow__audit-documents {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.ponto-flow__audit-documents li {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid var(--ponto-blue);
  border-radius: 6px;
  background: #eef5fc;
}

.ponto-flow__audit-documents a {
  color: var(--ponto-blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.ponto-flow__audit-documents small { color: var(--ponto-muted); }

.ponto-flow__reopen {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.ponto-flow__reopen label {
  grid-column: 1 / -1;
  color: var(--ponto-text);
  font-size: 11px;
  font-weight: 800;
}

.ponto-flow__derived-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
}

.ponto-flow__certificate,
.ponto-flow__generated-actions {
  padding: 18px;
  border: 1px solid var(--ponto-line);
  border-radius: 10px;
  background: var(--ponto-soft);
}

.ponto-flow__generated-action {
  border-left: 4px solid var(--ponto-blue) !important;
}

.ponto-flow__generated-action--alerta {
  border-left-color: #e3a617 !important;
  background: var(--ponto-yellow-soft) !important;
}

.ponto-flow__generated-action--vencido {
  border-left-color: var(--ponto-red) !important;
  background: var(--ponto-red-soft) !important;
}

.ponto-flow__generated-action--no_prazo {
  border-left-color: var(--ponto-green) !important;
  background: var(--ponto-green-soft) !important;
}

.ponto-flow__compact-form button { justify-self: end; }

.ponto-flow .meca-btn {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .ponto-flow__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ponto-flow__summary article:nth-child(3),
  .ponto-flow__summary article:nth-child(4) { border-top-width: 4px; }
  .ponto-flow__workspace,
  .ponto-flow__derived-grid { grid-template-columns: 1fr; }
  .ponto-flow__side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ponto-flow { gap: 13px; }
  .ponto-flow__hero,
  .ponto-flow__start-card,
  .ponto-flow__hero-actions,
  .ponto-flow__section-head,
  .ponto-flow__form-actions { align-items: stretch; flex-direction: column; }
  .ponto-flow__hero-actions { width: 100%; }
  .ponto-flow__summary,
  .ponto-flow__contact-grid,
  .ponto-flow__notes-grid,
  .ponto-flow__compact-form,
  .ponto-flow__audit-list,
  .ponto-flow__side-stack { grid-template-columns: 1fr; }
  .ponto-flow__summary article,
  .ponto-flow__summary article + article,
  .ponto-flow__summary article:nth-child(3) {
    min-height: 88px;
    border-top-width: 4px;
    border-left: 0;
  }
  .ponto-flow__work-status { width: 100%; justify-items: stretch; }
  .ponto-flow__sla { text-align: left; }
  .ponto-flow__stages { grid-template-columns: 1fr; }
  .ponto-flow__stage { min-height: auto; }
  .ponto-flow__reopen { grid-template-columns: 1fr; }
  .ponto-flow__compact-form button,
  .ponto-flow .meca-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ponto-flow * { scroll-behavior: auto !important; }
}
