/* ══════════════════════════════════════════════════════
   Portal BKon — Módulo Operação (BKon OS)
   Visão interna do trabalho do time, vinda da Bancada.
   Reusa os tokens de portal.css — dual-theme automático,
   sem cor nova.
══════════════════════════════════════════════════════ */

/* ─── Cabeçalho de totais ────────────────────────────── */
.op-totais {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.op-totais__item {
  background: var(--bg-raised);
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.op-totais__valor {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.op-totais__item--destaque .op-totais__valor { color: var(--accent-text); }
.op-totais__item--alerta .op-totais__valor    { color: var(--warning); }
.op-totais__label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Card por projeto ───────────────────────────────── */
.op-projetos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.op-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: border-color var(--duration-normal) var(--easing);
}
.op-card:hover { border-color: var(--border-strong); }
.op-card--parado { border-left: 3px solid var(--warning); }

.op-card__topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.op-card__titulos { min-width: 0; flex: 1; }
.op-card__nome {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.op-card__cliente {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}
.op-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.op-card__pct {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.op-card__pct span { font-size: 12px; margin-left: 1px; color: var(--text-muted); }

.op-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}
.op-card__link:hover { opacity: 0.8; text-decoration: underline; }
.op-card__link svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }

.op-barra {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
  margin: 10px 0 12px;
}
.op-barra > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent-text);
  transition: width 520ms cubic-bezier(.4,0,.2,1);
}

/* Contagem por fase — pills compactas */
.op-fases {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.op-fase-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.op-fase-pill__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.op-fase-pill__dot--triagem   { background: var(--text-disabled); }
.op-fase-pill__dot--pendente  { background: var(--info); }
.op-fase-pill__dot--iniciado  { background: var(--accent); }
.op-fase-pill__dot--concluido { background: var(--success); }
.op-fase-pill__dot--cancelado { background: var(--text-muted); }
.op-fase-pill__n {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

/* Listas de itens (em andamento / parados) dentro do card */
.op-lista-titulo {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 12px 0 6px;
}
.op-lista {
  display: flex;
  flex-direction: column;
}
.op-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.op-item:first-child { border-top: none; }
.op-item__chave {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-disabled);
  flex-shrink: 0;
}
.op-item__titulo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.op-item__resp {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Parados — destaque de aviso, com o motivo visível (visão interna) */
.op-item--parado { color: var(--text-primary); }
.op-item--parado .op-item__titulo { color: var(--text-primary); }
.op-item__motivo {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  white-space: nowrap;
}

.op-vazio {
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 0 0;
}

/* ─── Estado "Bancada não conectada" / indisponível ─── */
.op-aviso {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.op-aviso--indisponivel { border-left-color: var(--warning); }
.op-aviso__icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.op-aviso--indisponivel .op-aviso__icon { background: var(--warning-soft); color: var(--warning); }
.op-aviso__icon svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.75; fill: none; }
.op-aviso__titulo { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.op-aviso__texto { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }
.op-aviso__texto code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

@media (max-width: 640px) {
  .op-card__topo { flex-direction: column; align-items: flex-start; }
  .op-item { flex-wrap: wrap; }
  .op-item__titulo { flex-basis: 100%; white-space: normal; }
}
