/* ============================================================
   wo-rdo.css — Estilos da aba RDO integrada à OS
   Precifika — Etapa 4
   ============================================================ */

/* ── Wrapper da aba ── */
.rdo-tab-wrap { padding: 0 0 32px 0; }

/* ── Loading ── */
.rdo-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
  justify-content: center;
}

/* ── KPIs ── */
.rdo-kpi-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.rdo-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  flex: 1;
  min-width: 90px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rdo-kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.rdo-kpi-lbl {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
}

/* ── Ações ── */
.rdo-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Seções ── */
.rdo-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.rdo-section-title i { color: #6366f1; }

/* ── Empty states ── */
.rdo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
.rdo-empty i { font-size: 32px; }
.rdo-empty-sm {
  padding: 16px;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

/* ── Grupos por etapa ── */
.rdo-stage-group {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.rdo-stage-label {
  padding: 8px 14px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rdo-stage-label i { color: #6366f1; }

/* ── Linha de item de serviço ── */
.rdo-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.rdo-item-row:last-child { border-bottom: none; }
.rdo-item-row:hover { background: #fafbfc; }

.rdo-item-info {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rdo-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.rdo-item-meta {
  font-size: 11px;
  color: #64748b;
}
.rdo-item-loc {
  font-size: 11px;
  color: #6366f1;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rdo-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.rdo-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.rdo-progress-wrap {
  width: 80px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}
.rdo-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.rdo-pct-label {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  min-width: 32px;
  text-align: right;
}
.rdo-exec-label {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ── Cards de entradas diárias ── */
.rdo-entries-list { display: flex; flex-direction: column; gap: 8px; }

.rdo-entry-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.rdo-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.rdo-entry-date {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.rdo-entry-date i { color: #6366f1; }
.rdo-entry-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rdo-entry-actions {
  display: flex;
  gap: 4px;
}
.rdo-entry-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}
.rdo-entry-resp, .rdo-entry-svc, .rdo-entry-occ {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Badges ── */
.rdo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}
.rdo-badge--imped { background: #fee2e2; color: #dc2626; }
.rdo-badge--photo { background: #e0e7ff; color: #4338ca; }

/* ── Botões de ícone ── */
.rdo-btn-icon {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.rdo-btn-icon:hover { background: #f1f5f9; color: #0f172a; }
.rdo-btn-remove:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.rdo-btn-approve { border-color: #bbf7d0; color: #16a34a; }
.rdo-btn-approve:hover { background: #dcfce7; }

/* ── Formulário modal RDO ── */
.rdo-modal-box { max-width: 820px; }
.rdo-form-body { padding: 16px 20px; }

.rdo-form-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.rdo-form-section:last-child { border-bottom: none; margin-bottom: 0; }

.rdo-form-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rdo-form-title i { color: #6366f1; }

.rdo-head-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ── Tabela de serviços no formulário ── */
.rdo-svc-table-wrap { overflow-x: auto; }
.rdo-svc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rdo-svc-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.rdo-svc-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.rdo-svc-table tr:last-child td { border-bottom: none; }
.rdo-svc-table tr:hover td { background: #fafbfc; }
.rdo-td-stage { color: #6366f1; font-weight: 600; white-space: nowrap; }
.rdo-td-svc   { font-weight: 600; color: #0f172a; }
.rdo-td-unit  { color: #64748b; text-align: center; }
.rdo-td-num   { text-align: right; font-weight: 600; }

/* ── Linhas de equipe e ocorrências ── */
.rdo-team-row, .rdo-occ-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.rdo-imped-chk {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Fotos ── */
.rdo-photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 48px;
}
.rdo-photo-thumb {
  position: relative;
  width: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.rdo-photo-thumb img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
}
.rdo-photo-thumb span {
  display: block;
  font-size: 9px;
  color: #64748b;
  padding: 2px 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.rdo-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  line-height: 16px;
  text-align: center;
  display: none;
}
.rdo-photo-thumb:hover .rdo-photo-remove { display: block; }

.rdo-photo-add-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.rdo-photo-add-row .wo-field-input { flex: 1; min-width: 160px; }

/* ── Visualização ── */
.rdo-view-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
  font-size: 13px;
  color: #374151;
}
.rdo-view-meta span { display: flex; align-items: center; gap: 5px; }
.rdo-view-section {
  font-size: 13px;
  color: #374151;
  margin-bottom: 14px;
}
.rdo-view-section b { display: block; font-weight: 700; margin-bottom: 6px; color: #0f172a; }
.rdo-occ-list { margin: 6px 0 0 0; padding-left: 18px; }
.rdo-occ-list li { font-size: 12px; margin-bottom: 3px; }
.rdo-occ-list .rdo-imped { color: #dc2626; font-weight: 600; }

/* ── Botão secundário ── */
.wo-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.wo-btn-secondary:hover { background: #e2e8f0; color: #0f172a; }

/* ── Responsividade ── */
@media (max-width: 768px) {
  .rdo-kpi-row    { gap: 6px; }
  .rdo-kpi        { min-width: 70px; padding: 10px 12px; }
  .rdo-kpi-val    { font-size: 18px; }
  .rdo-item-row   { flex-direction: column; align-items: flex-start; }
  .rdo-item-right { width: 100%; justify-content: space-between; }
  .rdo-modal-box  { max-width: 100%; border-radius: 12px 12px 0 0; }
  .rdo-head-grid  { grid-template-columns: 1fr; }
  .rdo-svc-table  { min-width: 580px; }
  .rdo-team-row, .rdo-occ-row { flex-direction: column; align-items: stretch; }
  .rdo-progress-wrap { width: 100%; }
}

@media (max-width: 480px) {
  .rdo-entry-header { flex-direction: column; align-items: flex-start; }
  .rdo-actions-row  { flex-direction: column; }
  .rdo-actions-row .wo-btn-primary,
  .rdo-actions-row .wo-btn-secondary { width: 100%; justify-content: center; }
}
