:root { --pico-font-size: 100%; }
.topo { border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; }
.topo nav ul { flex-wrap: wrap; }
.marca { display: inline-flex; align-items: center; padding: 0; }
.logo-topo { height: 40px; width: auto; display: block; }
.login-cabecalho { text-align: center; }
.logo-login { width: 100%; max-width: 300px; height: auto; margin: 0 auto .5rem; display: block; }
.login-cabecalho p { margin: 0; color: var(--pico-muted-color); }
.btn-pequeno { padding: .35rem .8rem; margin: 0; font-size: .9rem; }
.form-sair { margin: 0; }
.obrigatorio, .erro { color: #c62828; }
small.erro { display: block; }

.aviso { padding: .75rem 1rem; margin-bottom: 1rem; border-left: 5px solid; }
.aviso-success { border-color: #2e7d32; background: rgba(46,125,50,.1); }
.aviso-error { border-color: #c62828; background: rgba(198,40,40,.1); }
.aviso-warning { border-color: #ef6c00; background: rgba(239,108,0,.1); }
.aviso-info { border-color: #1565c0; background: rgba(21,101,192,.1); }

.resumo { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-resumo { flex: 1; min-width: 140px; padding: .8rem 1rem; border: 1px solid var(--pico-muted-border-color); border-radius: .5rem; text-decoration: none; }
.card-resumo span { font-size: 1.8rem; font-weight: bold; margin-right: .3rem; }
.card-resumo.pronto span { color: #2e7d32; }
.card-resumo.recebido span { color: #0d47a1; }

.filtros { display: grid; grid-template-columns: 1fr 220px; gap: .75rem; }
@media (max-width: 600px) { .filtros { grid-template-columns: 1fr; } }
tr.parada td { background: rgba(239,108,0,.08); }
.paginacao { display: flex; gap: 1rem; justify-content: center; }

.status { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #e0e0e0; color: #333; vertical-align: middle; }
.status-recebido { background: #e3f2fd; color: #0d47a1; }
.status-analise { background: #ede7f6; color: #4527a0; }
.status-aprovacao { background: #fff3e0; color: #e65100; }
.status-conserto { background: #fffde7; color: #827717; }
.status-pronto { background: #e8f5e9; color: #1b5e20; }
.status-sem_conserto { background: #fce4ec; color: #880e4f; }
.status-entregue { background: #eceff1; color: #37474f; }
.status-cancelado { background: #ffebee; color: #b71c1c; text-decoration: line-through; }

.cabecalho-os { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.cabecalho-os h2 { margin-bottom: .25rem; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.dados dt { font-weight: 600; font-size: .85rem; color: var(--pico-muted-color); }
.dados dd { margin: 0 0 .5rem; }
.btn-whats { display: block; margin-bottom: .5rem; }

.fotos { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.fotos img { width: 130px; height: 130px; object-fit: cover; border-radius: .4rem; }
.fotos figure { margin: 0; }
.fotos figcaption { font-size: .75rem; }
.fotos figcaption form { display: inline; margin: 0; }
.link-excluir { background: none; border: 0; padding: 0; margin: 0; color: #c62828; font-size: .75rem; text-decoration: underline; width: auto; }

.login, .caixa-retirada { max-width: 460px; margin: 3rem auto; }

.busca-cliente { display: grid; grid-template-columns: 1fr auto; gap: .75rem; }
.busca-cliente button { width: auto; }
@media (max-width: 600px) { .busca-cliente { grid-template-columns: 1fr; } .busca-cliente button { width: 100%; } }
.lista-clientes { list-style: none; padding: 0; margin: 0 0 1rem; }
.lista-clientes li { list-style: none; margin-bottom: .4rem; }
.lista-clientes button { width: 100%; text-align: left; padding: .5rem .8rem; }
.lista-clientes small { float: right; color: var(--pico-muted-color); }
.historico-cliente { display: block; margin-top: .35rem; }
.bloco-orcamento { border: 1px solid var(--pico-muted-border-color); border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.bloco-orcamento summary { margin-bottom: 0; }
.bloco-orcamento[open] summary { margin-bottom: 1rem; }

.itens-orcamento td { vertical-align: top; }
.itens-orcamento input, .itens-orcamento select { margin-bottom: 0; }
.itens-orcamento .col-valor { width: 140px; }
.itens-orcamento .total-item { white-space: nowrap; padding-top: 1rem; }
.itens-orcamento tr.apagado td { opacity: .4; text-decoration: line-through; }
.itens-orcamento .remover { font-size: .8rem; white-space: nowrap; padding-top: .8rem; }
.total-orcamento { font-size: 1.2rem; text-align: right; }
form.inline { display: inline; margin: 0 0 0 1rem; }
form.inline button { width: auto; margin: 0; padding: .35rem .9rem; }
.resposta-orcamento form { margin-bottom: 0; }
.btn-aprovar { background: #2e7d32; border-color: #2e7d32; }
.orc-rascunho { background: #eceff1; color: #37474f; }
.orc-enviado { background: #fff3e0; color: #e65100; }
.orc-aprovado { background: #e8f5e9; color: #1b5e20; }
.orc-recusado { background: #ffebee; color: #b71c1c; }
.barra-pdf { margin-bottom: 1rem; align-items: center; }

.caixa-assistente { max-width: 680px; margin: 2rem auto; }
.previa-cabecalho { background: var(--pico-card-sectioning-background-color); margin: 0 0 1rem; }
.previa-logo { max-height: 48px; max-width: 160px; object-fit: contain; align-self: center; }
.previa-texto { flex: 1; }
.previa-linha { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid currentColor; padding: .5rem 0; margin-top: .4rem; }
.previa-num { text-align: right; }

/* ---------------------------------------------------------------------------------------------
   Responsivo: menu compacto e tabelas que viram cartões no celular.
   --------------------------------------------------------------------------------------------- */
.so-celular { display: none; }
.topo nav details.dropdown { margin: 0; }
.topo nav details.dropdown summary { margin: 0; }
.topo nav details.dropdown ul li form button { width: 100%; }
.itens-orcamento .col-qtd { width: 90px; }

@media (max-width: 768px) {
  .so-desktop { display: none !important; }
  .so-celular { display: block; list-style: none; }
  .topo { margin-bottom: .5rem; }
  .topo nav { flex-wrap: nowrap; }
  .topo nav ul { flex-wrap: nowrap; }
  .logo-topo { height: 30px; }
  .topo .btn-pequeno { white-space: nowrap; }
  #dica-envio { display: block; margin-top: .4rem; }
  a[role="button"].bloco-celular { display: block; width: 100%; text-align: center; }
  main.container { padding-top: .25rem; }
  h2 { font-size: 1.4rem; }

  /* Cabeçalhos com ações: botões em largura total, empilhados */
  .cabecalho-os .acoes { width: 100%; }
  .cabecalho-os .acoes > a[role="button"], .cabecalho-os .acoes > button { flex: 1 1 auto; text-align: center; }

  /* Tabelas em cartões: cada linha vira um bloco; cada célula mostra o rótulo (data-label) */
  .overflow-auto:has(> .tabela-cards) { overflow: visible; }
  .tabela-cards, .tabela-cards tbody, .tabela-cards tfoot { display: block; width: 100%; }
  .tabela-cards thead { display: none; }
  .tabela-cards tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .75rem;
    border: 1px solid var(--pico-muted-border-color); border-radius: .5rem;
    padding: .6rem .8rem; margin-bottom: .6rem; background: var(--pico-card-background-color);
  }
  .tabela-cards.striped tbody tr:nth-child(odd) td { background: transparent; }
  .tabela-cards tbody td { display: block; border: 0; padding: 0; background: transparent; width: 100%; }
  .tabela-cards tbody td[data-label]::before {
    content: attr(data-label) ": "; color: var(--pico-muted-color); font-size: .8rem; font-weight: 600;
  }
  .tabela-cards tbody td { order: 2; }
  .tabela-cards td.cel-titulo { order: 0; width: auto; flex: 1 1 auto; font-size: 1.05rem; }
  .tabela-cards td.cel-status { order: 1; width: auto; flex: 0 0 auto; text-align: right; }
  .tabela-cards td.cel-acao { display: none; }
  .tabela-cards td.cel-vazia { text-align: center; }
  .tabela-cards tr.parada { border-color: #ef6c00; }
  .tabela-cards tr.parada td { background: transparent; }
  .tabela-cards tfoot tr { display: flex; justify-content: space-between; padding: .2rem .8rem; }
  .tabela-cards tfoot td, .tabela-cards tfoot th { border: 0; padding: .1rem 0; }

  /* Itens do orçamento: campos grandes, qtd e valor lado a lado */
  .itens-orcamento.tabela-cards tbody td[data-label]::before { display: block; margin-bottom: .1rem; }
  .itens-orcamento.tabela-cards td.col-qtd, .itens-orcamento.tabela-cards td.col-valor { width: calc(50% - .4rem); }
  .itens-orcamento.tabela-cards td.total-item { padding-top: .3rem; font-weight: bold; }
  .itens-orcamento.tabela-cards td.cel-remover { width: auto; }
  .itens-orcamento.tabela-cards .remover { padding-top: 0; }
  .total-orcamento { text-align: left; }

  /* Formulário de mudar status e de fotos: um campo por linha */
  form.grid { grid-template-columns: 1fr; }
}

.abas { display: flex; gap: .25rem; border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; overflow-x: auto; }
.abas a { padding: .5rem 1rem; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.abas a[aria-current="page"] { border-bottom-color: var(--pico-primary); font-weight: 600; }
.rodape { text-align: center; color: var(--pico-muted-color); padding: 1rem 0 2rem; }
