/* ── OS Budget Global (listagem) ────────────────────────────────────────── */

#os-budget-global-page {
  padding: 0 0 48px;
}

/* ── Filtros ── */
#os-budget-global-page .os-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 20px;
}

#os-budget-global-page .os-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
}

#os-budget-global-page .os-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

#os-budget-global-page .os-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-light-mode);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--background-color-main-light);
  color: var(--text-primary);
  box-sizing: border-box;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#os-budget-global-page select.os-input {
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

#os-budget-global-page .os-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

html.dark-theme #os-budget-global-page .os-input {
  background-color: var(--background-main-dark-mode, #1e293b);
  border-color: var(--border-dark-mode, #334155);
  color: var(--text-primary);
}

/* ── Tabela — coluna Total orçado alinhada à direita ── */
#os-budget-global-page .os-table th:nth-child(6),
#os-budget-global-page .os-table td:nth-child(6) {
  text-align: right;
}

/* ── Paginação oculta inicialmente ── */
#os-bg-pagination {
  display: none;
  padding: 12px 0;
}

/* ── OS Budget (detalhe da OS) ───────────────────────────────────────────── */

#os-budget-page {
  padding: 0 0 48px;
}

/* ── Back link posicionado à esquerda do header ── */
#os-budget-page .page-header-wrapper .os-back-link {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

/* ── Status bar ── */
#os-budget-status-bar {
  margin-bottom: 16px;
}

#os-budget-status-bar .os-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

#os-budget-status-bar .os-label {
  margin: 0;
}

/* ── Tabela — alinhamento das colunas ── */
#os-budget-page .os-table th:nth-child(3),
#os-budget-page .os-table td:nth-child(3) {
  text-align: center;
}

#os-budget-page .os-table th:nth-child(4),
#os-budget-page .os-table th:nth-child(5),
#os-budget-page .os-table td:nth-child(4),
#os-budget-page .os-table td:nth-child(5) {
  text-align: right;
}

/* ── Rodapé da tabela (Total geral) ── */
#os-budget-tfoot td:nth-child(1) {
  text-align: right;
  font-weight: 700;
  padding: 12px 10px;
}

#os-budget-tfoot td:nth-child(2) {
  text-align: right;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 10px;
  color: var(--os-accent, #f97316);
}

/* ── Ações inline por linha ── */
.os-budget-actions {
  display: flex;
  gap: 6px;
}

/* ── Modal overlay ── */
#os-budget-item-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  width: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  overflow-y: visible;
}

#os-budget-item-modal.os-hidden {
  display: none;
}

/* ── Modal box ── */
#os-budget-item-modal .os-modal-box {
  background: var(--background-color-main-light);
  border-radius: 14px;
  width: 90vw;
  max-width: min(560px, 90vw);
  max-height: 98vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

#os-budget-item-modal .os-modal-header {
  justify-content: center;
}

#os-budget-item-modal .os-modal-title {
  text-align: center;
}

/* ── Inputs do modal ── */
#os-budget-page .os-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

#os-budget-page .os-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-light-mode);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--background-color-main-light);
  color: var(--text-primary);
  box-sizing: border-box;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#os-budget-page select.os-input {
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

#os-budget-page .os-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

html.dark-theme #os-budget-page .os-input {
  background-color: var(--background-main-dark-mode, #1e293b);
  border-color: var(--border-dark-mode, #334155);
  color: var(--text-primary);
}

/* ── Spinner oculto inicialmente ── */
#os-budget-item-spinner {
  display: none;
}
