/* Direção → Controle de OS — mesma lista clara da solicitação de compras */
#direcaoOsPane {
  color: #273142;
  text-transform: none;
}

#direcaoOsPane input,
#direcaoOsPane select,
#direcaoOsPane button {
  color: #273142;
  -webkit-text-fill-color: #273142;
  text-transform: none;
  background: #fff;
}

#direcaoOsPane .dir-compras-visualizacao label {
  color: #667085;
}

#direcaoOsPane > .content-wrapper { padding: 0; }
#direcaoOsPane > .content-wrapper > .content-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#direcaoOsPane .content-section > .dir-compras-sheet { border: 0; box-shadow: none; }

#dirOsAjuda,
#dirOsMsg:not(.is-erro) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}

#dirOsMsg.is-erro {
  display: block;
  margin: 0;
  padding: 8px 12px;
  background: #fef2f2;
  color: #7f1d1d;
}

#dirOsAtualizar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  -webkit-text-fill-color: #334155;
  background: #fff;
  cursor: pointer;
}

#dirOsLista [data-tom] { --grupo-fundo: #e2e8f0; --grupo-texto: #334155; --linha-tinta: #eef2f6; }
#dirOsLista [data-tom="verde"] { --grupo-fundo: #86efac; --grupo-texto: #064e3b; --linha-tinta: #b7e8cd; }
#dirOsLista [data-tom="azul"] { --grupo-fundo: #dbeafe; --grupo-texto: #1e40af; --linha-tinta: #e5efff; }
#dirOsLista [data-tom="roxo"] { --grupo-fundo: #ede9fe; --grupo-texto: #5b21b6; --linha-tinta: #eee7fa; }
#dirOsLista [data-tom="amarelo"] { --grupo-fundo: #fef3c7; --grupo-texto: #92400e; --linha-tinta: #fff3cc; }
#dirOsLista [data-tom="laranja"] { --grupo-fundo: #ffedd5; --grupo-texto: #9a3412; --linha-tinta: #fff0df; }
#dirOsLista [data-tom="vermelho"] { --grupo-fundo: #fee2e2; --grupo-texto: #991b1b; --linha-tinta: #fdeaea; }

#dirOsNovo.dir-compras-solicitar {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: #2563eb;
  color: #fff;
  -webkit-text-fill-color: #fff;
}
#dirOsNovo.dir-compras-solicitar:hover { background: #1d4ed8; }
@media (max-width: 640px) {
  #dirOsNovo.dir-compras-solicitar { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); }
}

#dirOsModal[hidden] { display: none !important; }
#dirOsModal {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}
#dirOsModal .dir-compras-modal {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  background: #f1f5f9;
  color: #273142;
}
#dirOsModal .dir-compras-modal-body { background: #e5e7eb; }
#dirOsModal input,
#dirOsModal textarea,
#dirOsModal select {
  color: #273142;
  -webkit-text-fill-color: #273142;
  background: #fff;
}
#dirOsModal label { color: #667085; }
.dir-os-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dir-os-anexos { margin-top: 10px; font-size: 13px; color: #273142; }
.dir-os-anexos a { color: #1d4ed8; }
#dirComprasLista .dir-os-gerar,
#dirComprasLista .dir-os-numero {
  color: #1d4ed8;
  -webkit-text-fill-color: #1d4ed8;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
}
@media (max-width: 800px) {
  .dir-os-form-grid { grid-template-columns: 1fr; }
}

#dirOsAtualizar:hover { background: #e2e8f0; }
#dirOsAtualizar:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

@media (max-width: 1000px) {
  #dirOsLista, #dirOsLista tbody { display: block; }
  #dirOsLista thead { display: block; position: sticky; top: 0; background: #f8fafc; }
  #dirOsLista thead tr { display: flex; justify-content: flex-end; }
  #dirOsLista thead th { display: none; }
  #dirOsLista thead th:last-child { display: block; width: auto; }
  #dirOsLista thead th:last-child span { display: none; }
  #dirOsLista tr[data-idx] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid #94a3b8;
  }
  #dirOsLista tr[data-idx] td {
    width: auto;
    min-width: 0;
    white-space: normal;
    border: 0;
    overflow-wrap: anywhere;
    color: #273142;
    background: #fff;
  }
  #dirOsLista tr[data-idx] td[data-col="titulo"] { grid-column: 1 / -1; }
  #dirOsLista tr[data-idx] td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: #667085;
  }
  #dirOsLista .dir-compras-grupo { display: block; }
  #dirOsLista .dir-compras-grupo th { display: block; width: auto; }
}
