/* Sprint 18/19 — Central de Processos, Pendências & Follow-up */

.service-backoffice-head{align-items:flex-start}
.service-backoffice-kpis{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:14px;
  margin-bottom:16px;
}
.service-backoffice-panel{padding:18px}
.service-backoffice-panel-head{margin-bottom:14px}
.service-backoffice-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.service-backoffice-filters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.service-backoffice-filters button{
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  border-radius:999px;
  min-height:38px;
  padding:0 14px;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
.service-backoffice-filters button:hover,
.service-backoffice-filters button.active{
  border-color:var(--green);
  background:color-mix(in srgb,var(--green) 9%,var(--surface));
}
.service-backoffice-search{
  width:min(360px,100%);
  flex:0 1 360px;
}
.service-backoffice-list{
  display:grid;
  gap:10px;
}
.service-backoffice-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  background:color-mix(in srgb,var(--surface) 94%,var(--green) 6%);
  position:relative;
  overflow:hidden;
}
.service-backoffice-row::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  background:var(--border);
}
.service-backoffice-row.severity-critical::before{background:#d53b3b}
.service-backoffice-row.severity-high::before{background:#d27b24}
.service-backoffice-row.severity-attention::before{background:#caa52b}
.service-backoffice-row.severity-normal::before{background:var(--green)}
.service-backoffice-icon{
  width:38px;
  height:38px;
  border-radius:11px;
  border:1px solid var(--border);
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:16px;
  background:var(--surface);
}
.service-backoffice-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.service-backoffice-title>div>span{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:3px;
}
.service-backoffice-title h4{
  margin:0;
  font-size:15px;
}
.service-backoffice-main>p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
}
.service-backoffice-meta{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:9px;
}
.service-backoffice-meta span{
  background:color-mix(in srgb,var(--green) 7%,var(--surface));
  border-radius:8px;
  padding:4px 8px;
  font-size:11px;
  color:var(--muted);
}
.service-backoffice-severity{
  border-radius:999px;
  padding:5px 9px;
  font-size:10px;
  white-space:nowrap;
  border:1px solid var(--border);
  background:var(--surface);
}
.service-backoffice-severity.critical{color:#a82424;background:rgba(213,59,59,.08);border-color:rgba(213,59,59,.25)}
.service-backoffice-severity.high{color:#9a5518;background:rgba(210,123,36,.09);border-color:rgba(210,123,36,.25)}
.service-backoffice-severity.attention{color:#806715;background:rgba(202,165,43,.10);border-color:rgba(202,165,43,.25)}
.service-backoffice-severity.normal{color:var(--green);background:color-mix(in srgb,var(--green) 8%,var(--surface));border-color:color-mix(in srgb,var(--green) 28%,var(--border))}
.service-backoffice-actions{
  display:flex;
  align-items:center;
}
.service-backoffice-empty{padding:42px 12px}


.service-backoffice-followup-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:-4px 0 16px;
}
.service-backoffice-followup-summary>div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:48px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 13px;
  background:color-mix(in srgb,var(--surface) 96%,var(--green) 4%);
}
.service-backoffice-followup-summary span{font-size:12px;color:var(--muted)}
.service-backoffice-followup-summary b{font-size:17px}
.service-backoffice-followup-summary .danger b{color:#b92f2f}
.service-backoffice-scope{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}
.service-backoffice-scope>span{
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-right:3px;
}
.service-backoffice-scope button{
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  border-radius:999px;
  min-height:34px;
  padding:0 12px;
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.service-backoffice-scope button:hover,
.service-backoffice-scope button.active{
  border-color:var(--green);
  background:color-mix(in srgb,var(--green) 9%,var(--surface));
}
.service-backoffice-followup{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 9px;
  margin-top:10px;
  border-top:1px dashed var(--border);
  padding-top:9px;
}
.service-backoffice-followup>span{
  font-size:10px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
}
.service-backoffice-followup>b{font-size:12px}
.service-backoffice-followup>small{font-size:11px;color:var(--muted)}
.service-backoffice-followup.overdue>small{color:#b92f2f;font-weight:800}
.service-backoffice-followup.risk>small{color:#9a5518;font-weight:800}
.service-backoffice-followup.done{opacity:.72}
.service-backoffice-actions{gap:8px;flex-wrap:wrap;justify-content:flex-end}
.service-followup-dialog{width:min(720px,calc(100vw - 28px))}
.service-followup-history{
  margin:16px 0 0;
  border-top:1px solid var(--border);
  padding-top:14px;
}
.service-followup-history h3{margin:0 0 10px}
.service-followup-history>div{
  display:grid;
  grid-template-columns:12px minmax(0,1fr);
  gap:9px;
  align-items:start;
  padding:7px 0;
}
.service-followup-history i{
  width:8px;height:8px;border-radius:50%;
  background:var(--green);margin-top:5px;
}
.service-followup-history span{display:grid;gap:2px}
.service-followup-history small{color:var(--muted)}


.service-backoffice-automation{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 16px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:color-mix(in srgb,var(--surface) 96%,var(--green) 4%);
}
.service-backoffice-automation>div:first-child{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.service-backoffice-automation-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 5px color-mix(in srgb,var(--green) 13%,transparent);
  flex:0 0 auto;
}
.service-backoffice-automation b{font-size:13px}
.service-backoffice-automation small{
  display:block;
  color:var(--muted);
  margin-top:2px;
  font-size:11px;
}
.service-backoffice-automation-stats{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
}
.service-backoffice-automation-stats>span{
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 9px;
  font-size:11px;
  color:var(--muted);
  background:var(--surface);
}
.service-backoffice-automation-stats>span b{color:var(--text)}
.service-followup-alert-history{
  margin:16px 0 0;
  border-top:1px solid var(--border);
  padding-top:14px;
}
.service-followup-alert-history h3{margin:0 0 10px}
.service-followup-alert-history>div{
  display:grid;
  grid-template-columns:12px minmax(0,1fr);
  gap:9px;
  align-items:start;
  padding:7px 0;
}
.service-followup-alert-history i{
  width:8px;height:8px;border-radius:50%;
  background:var(--green);margin-top:5px;
}
.service-followup-alert-history .alert-overdue i{background:#d53b3b}
.service-followup-alert-history .alert-escalation i{background:#d27b24}
.service-followup-alert-history span{display:grid;gap:2px}
.service-followup-alert-history small{color:var(--muted)}

@media (max-width:1440px){
  .service-backoffice-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .service-backoffice-followup-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .service-backoffice-automation{align-items:flex-start;flex-direction:column}
  .service-backoffice-automation-stats{justify-content:flex-start}
  .service-backoffice-toolbar{align-items:stretch;flex-direction:column}
  .service-backoffice-search{width:100%;max-width:none;flex-basis:auto}
}
@media (max-width:860px){
  .service-backoffice-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .service-backoffice-followup-summary{grid-template-columns:1fr}
  .service-backoffice-toolbar{align-items:stretch;flex-direction:column}
  .service-backoffice-search{width:100%;flex-basis:auto}
  .service-backoffice-row{grid-template-columns:38px minmax(0,1fr)}
  .service-backoffice-actions{grid-column:2}
}
@media (max-width:560px){
  .service-backoffice-kpis{grid-template-columns:1fr}
  .service-backoffice-row{grid-template-columns:1fr}
  .service-backoffice-icon{display:none}
  .service-backoffice-actions{grid-column:1}
  .service-backoffice-actions .btn{width:100%}
}
