/* ==========================================================================
   Painel de Medições de Obra - Horas de Equipe e Avanço Contratual
   Construtec Centro de Custos v3
   ========================================================================== */

.budget-measurements-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 16px;
  overflow-y: auto;
}

.budget-measurements-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  overflow: hidden;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  border: 1px solid #cbd5e1;
}

html.dark .budget-measurements-modal {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

/* Barra Superior */
.measurements-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #021d26;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.measurements-toolbar .toolbar-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.measurements-toolbar .toolbar-info p {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.measurements-toolbar .btn-close-measurements {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
}

.measurements-toolbar .btn-close-measurements:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Abas de Navegação */
.measurements-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  gap: 8px;
}

html.dark .measurements-tabs {
  background: #1e293b;
  border-color: #334155;
}

.measurements-tab-btn {
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.measurements-tab-btn:hover {
  color: #0284c7;
}

.measurements-tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

html.dark .measurements-tab-btn {
  color: #94a3b8;
}

html.dark .measurements-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

/* KPIs de Cabeçalho das Medições */
.measurements-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px 24px 10px 24px;
}

.measurements-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

html.dark .measurements-kpi-card {
  background: #1e293b;
  border-color: #334155;
}

.measurements-kpi-card span {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

html.dark .measurements-kpi-card span {
  color: #94a3b8;
}

.measurements-kpi-card strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

html.dark .measurements-kpi-card strong {
  color: #f8fafc;
}

.measurements-kpi-card.highlight strong {
  color: #0284c7;
}

html.dark .measurements-kpi-card.highlight strong {
  color: #38bdf8;
}

/* Painel de Conteúdo e Formulários */
.measurements-body {
  padding: 10px 24px 24px 24px;
}

.measurement-form-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

html.dark .measurement-form-card {
  background: #1e293b;
  border-color: #334155;
}

.measurement-form-card h4 {
  margin: 0 0 12px 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

html.dark .measurement-form-card h4 {
  color: #f8fafc;
}

.measurement-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.measurement-field-full {
  grid-column: 1 / -1;
}

.measurement-form-card label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 4px;
}

html.dark .measurement-form-card label {
  color: #cbd5e1;
}

.measurement-form-card input,
.measurement-form-card select,
.measurement-form-card textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.85rem;
  color: #0f172a;
  box-sizing: border-box;
}

html.dark .measurement-form-card input,
html.dark .measurement-form-card select,
html.dark .measurement-form-card textarea {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

.measurement-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Tabela de Histórico de Medições */
.measurements-table-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

html.dark .measurements-table-card {
  border-color: #334155;
}

.measurements-table-title {
  padding: 12px 16px;
  background: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

html.dark .measurements-table-title {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

.measurements-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.measurements-table th {
  background: #f8fafc;
  color: #475569;
  padding: 8px 12px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.74rem;
  text-transform: uppercase;
}

html.dark .measurements-table th {
  background: #0f172a;
  color: #94a3b8;
  border-color: #334155;
}

.measurements-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

html.dark .measurements-table td {
  border-color: #1e293b;
  color: #cbd5e1;
}

.measurements-table tr:last-child td {
  border-bottom: none;
}
