/* ============================================================
   Precifika — Status de Execução da Obra
   CSS v1.0
   ============================================================ */

/* ── Badge de status da obra ── */
.os-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
  white-space: nowrap;
}
.os-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.os-badge--waiting  { background:#f1f5f9; color:#64748b; }
.os-badge--waiting  .os-badge-dot { background:#94a3b8; }
.os-badge--progress { background:#eff6ff; color:#1d4ed8; }
.os-badge--progress .os-badge-dot { background:#3b82f6; }
.os-badge--done      { background:#f0fdf4; color:#15803d; }
.os-badge--done      .os-badge-dot { background:#22c55e; }

.est-card-work-status { margin-top: 6px; }

/* ── Botões específicos (herdam .btn-ghost / .est-card-btn) ── */
.btn-obra-iniciar  i { color:#4338ca; }
.btn-obra-concluir i { color:#047857; }

/* ── Aba "Obras Concluídas" ── */
.est-tab-btn--concluidas i { color:#059669; }
.est-tab-btn--concluidas.active {
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}

/* ════════════════════════════════════════════════════════════
   MODAL: Concluir Obra
═══════════════════════════════════════════════════════════ */
.os-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.os-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

.os-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
}
.os-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.os-modal-header h3 i { color:#16a34a; }
.os-modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s;
}
.os-modal-close:hover { background:#f1f5f9; color:#475569; }

.os-modal-project-info {
  padding: 14px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.os-modal-code {
  background: #e0e7ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.os-modal-client {
  color: #64748b;
  font-size: 12px;
}

.os-modal-body { padding: 20px 22px; }
.os-modal-step {}
.os-modal-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 8px;
}
.os-modal-label i { color:#16a34a; }
.os-modal-date-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}
.os-modal-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
}
.os-modal-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.os-modal-subtitle i { color:#f59e0b; }

.os-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

/* ── Verificação de pendências ── */
.os-checking {
  text-align: center;
  padding: 24px 0;
  color: #64748b;
}
.os-spinner-sm {
  width: 28px; height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #16a34a;
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: os-spin 0.8s linear infinite;
}
.os-spinner {
  width: 36px; height: 36px;
  border: 4px solid #e2e8f0;
  border-top-color: #16a34a;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: os-spin 0.8s linear infinite;
}
@keyframes os-spin { to { transform: rotate(360deg); } }

.os-pending-ok {
  text-align: center;
  padding: 24px 12px;
  color: #15803d;
}
.os-pending-ok i { font-size: 34px; margin-bottom: 10px; display:block; }

.os-pending-list { display: flex; flex-direction: column; gap: 10px; }
.os-pend-item {
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
}
.os-pend-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.os-pend-icon-wrap {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.os-pend-title { font-size: 13px; font-weight: 600; color:#0f172a; flex: 1; }
.os-pend-value { font-size: 13px; font-weight: 700; }
.os-pend-details {
  margin: 8px 0 0 32px;
  padding: 0;
  font-size: 12px;
  color: #64748b;
  list-style: disc;
}
.os-pend-details li { margin-bottom: 2px; }

.os-pend--green  { background:#f0fdf4; border-color:#bbf7d0; }
.os-pend--green  .os-pend-icon-wrap { background:#dcfce7; color:#16a34a; }
.os-pend--green  .os-pend-value { color:#16a34a; }
.os-pend--red    { background:#fef2f2; border-color:#fecaca; }
.os-pend--red    .os-pend-icon-wrap { background:#fee2e2; color:#dc2626; }
.os-pend--red    .os-pend-value { color:#dc2626; }
.os-pend--blue   { background:#eff6ff; border-color:#bfdbfe; }
.os-pend--blue   .os-pend-icon-wrap { background:#dbeafe; color:#2563eb; }
.os-pend--yellow { background:#fffbeb; border-color:#fde68a; }
.os-pend--yellow .os-pend-icon-wrap { background:#fef3c7; color:#b45309; }
.os-pend--purple { background:#faf5ff; border-color:#e9d5ff; }
.os-pend--purple .os-pend-icon-wrap { background:#f3e8ff; color:#7e22ce; }

.os-pend-icon { color:#f59e0b; margin-left:6px; font-size:11px; }

.os-pending-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  font-size: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
}
.os-pending-warn i { margin-top: 1px; }

.os-pending-notes { margin-top: 14px; }
.os-pending-notes label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.os-pending-notes textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
}

.btn-concludir { }
.btn.btn-warning {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.btn.btn-warning:hover { background:#d97706; }
.btn.btn-outline {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

body.os-no-scroll { overflow: hidden; }

/* ════════════════════════════════════════════════════════════
   PAINEL: Obras Concluídas — Indicadores
═══════════════════════════════════════════════════════════ */
.os-loading, .os-error, .os-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}
.os-error { color:#dc2626; }
.os-empty i { font-size: 34px; color:#cbd5e1; margin-bottom: 10px; display:block; }

.os-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.os-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.os-kpi-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.os-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.os-kpi-value--sm { font-size: 16px; }
.os-kpi-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.os-kpi--blue    .os-kpi-icon { background:#eff6ff; color:#2563eb; }
.os-kpi--green   .os-kpi-icon { background:#f0fdf4; color:#16a34a; }
.os-kpi--teal    .os-kpi-icon { background:#f0fdfa; color:#0d9488; }
.os-kpi--indigo  .os-kpi-icon { background:#eef2ff; color:#4338ca; }
.os-kpi--red     .os-kpi-icon { background:#fef2f2; color:#dc2626; }
.os-kpi--gray    .os-kpi-icon { background:#f8fafc; color:#94a3b8; }
.os-kpi--emerald .os-kpi-icon { background:#ecfdf5; color:#059669; }
.os-kpi--orange  .os-kpi-icon { background:#fff7ed; color:#c2410c; }
.os-kpi--yellow  .os-kpi-icon { background:#fffbeb; color:#b45309; }
.os-kpi--amber   .os-kpi-icon { background:#fffbeb; color:#d97706; }

.os-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.os-section-title i { color:#059669; }

.os-table-project { font-weight: 600; color:#0f172a; font-size: 13px; }
.os-table-code {
  font-size: 10px;
  color: #64748b;
  background: #f1f5f9;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  margin-top: 2px;
}
.os-table-value { font-weight: 700; color:#0f172a; }

/* ── Responsivo mobile ── */
@media (max-width: 600px) {
  .os-modal-box { max-width: 100%; border-radius: 12px; }
  .os-modal-header, .os-modal-body, .os-modal-footer, .os-modal-project-info { padding-left: 16px; padding-right: 16px; }
  .os-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .os-kpi { padding: 12px; }
  .os-kpi-icon { width: 34px; height: 34px; font-size: 14px; }
  .os-kpi-value { font-size: 17px; }
  .os-modal-footer { flex-direction: column-reverse; }
  .os-modal-footer .btn { width: 100%; }
}
