/* Layout "fluxo e voucher" com a paleta do painel claro (tema claro fixo). Cores só em variáveis. */
:root {
  --bg: #f4f6fb; --card: #ffffff; --tx: #1b2333; --su: #6b7690; --bd: #e3e8f2;
  --pri: #3156e8; --pri-tx: #ffffff; --pri2: #eaf0ff;
  --nav: #101a33; --nav-tx: #cfd8f3; --nav-on: #7d9bff;
  --ok: #15935b; --okb: #e5f6ee; --wa: #b7791f; --wab: #fff4dc; --er: #c0392b; --erb: #fdecea;
  --neutro: #eceff5; --raio: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--tx); }
a { color: var(--pri); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; } h2 { font-size: .8rem; margin: 0 0 .75rem; color: var(--su);
  text-transform: uppercase; letter-spacing: .06em; }
small { color: var(--su); font-weight: normal; }
.sub { color: var(--su); margin-bottom: 1.1rem; }

/* menu: lateral fixa no computador; no celular vira gaveta aberta pelo botão da barra superior */
body.com-menu { display: flex; min-height: 100vh; }
.conteudo { flex: 1; min-width: 0; }
.lateral { width: 240px; flex: none; background: var(--nav); color: var(--nav-tx); padding: 20px 14px 14px;
           display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: #fff; }
.lateral .marca { padding: 4px 10px 18px; font-size: 1.05rem; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; }
.lateral nav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 10px;
                 color: var(--nav-tx); text-decoration: none; }
.lateral nav a i { font-style: normal; width: 1.2rem; text-align: center; opacity: .85; }
.lateral nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lateral nav a.on { background: rgba(125, 155, 255, .18); color: #fff; box-shadow: inset 3px 0 0 var(--nav-on); }
.lateral .grupo { margin: 1rem .8rem .3rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.usuario { margin: auto 0 0; padding-top: .9rem; border-top: 1px solid rgba(255, 255, 255, .12); display: flex;
           flex-direction: column; gap: .5rem; }
.usuario .nome { color: #fff; text-decoration: none; padding: 0 .6rem; line-height: 1.3; }
.usuario .nome small { display: block; color: var(--nav-tx); opacity: .75; }
.usuario button.link { align-self: flex-start; padding: .2rem .6rem; color: var(--nav-on); }
button.link { background: none; border: 0; color: var(--nav-on); cursor: pointer; font: inherit; }
.contador { margin-left: auto; min-width: 1.4rem; padding: 0 .45rem; border-radius: 99px; background: #f1c36a; color: #3b2a00;
            font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4rem; text-decoration: none; }
.barra-mobile, .fundo-menu { display: none; }
.topo-simples { padding: 1rem 24px; background: var(--nav); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 22px; }
.cartao { background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio);
          padding: 1.25rem; margin-bottom: 1rem; }
.estreito { max-width: 460px; margin-left: auto; margin-right: auto; }
.cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cab h1 { margin: 0; }

/* formulários */
label { display: block; margin-bottom: .9rem; font-weight: 600; }
label small { font-weight: normal; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number],
select, textarea { width: 100%; padding: .65rem .75rem; margin-top: .3rem; font: inherit; color: var(--tx);
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri2); border-color: var(--pri); }
.marca-linha { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
button, .botao { display: inline-block; padding: .7rem 1.2rem; font: inherit; font-weight: 700; border-radius: 11px;
  border: 1px solid var(--bd); cursor: pointer; text-decoration: none; background: var(--card); color: var(--tx); }
button.primario, .botao { background: var(--pri); color: var(--pri-tx); border-color: var(--pri); }
button.perigo { background: var(--erb); color: var(--er); border-color: transparent; }
.aviso { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid var(--bd); background: var(--wab); }
.aviso.ok { background: var(--okb); border-color: var(--ok); } .aviso.erro { background: var(--erb); border-color: var(--er); }
.nota { color: var(--su); }
.filtro { margin: 0; min-width: 190px; } .filtro label { margin: 0; }
.linha { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.linha label { margin: 0; } .linha .larga { flex: 1 1 260px; }

/* duas colunas: acompanhamento + lateral */
.wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: start; }
.principal, .lado { min-width: 0; }
.lado .cartao { padding: 1rem 1.25rem; }
.ln.atual { background: var(--pri2); margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; }
details.ajuste { margin-bottom: .9rem; } details.ajuste summary { cursor: pointer; color: var(--pri); font-weight: 600; margin-bottom: .6rem; }
details.ajuste .linha { margin-bottom: 0; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio); padding: .9rem 1rem; }
.kpi b { display: block; font-size: 1.5rem; line-height: 1.2; } .kpi span { color: var(--su); font-size: .85rem; }
.kpi.alerta { background: var(--wab); border-color: var(--wa); }

/* lista de solicitações */
.lista { padding: .25rem 1.25rem; }
.ln { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0;
      border-top: 1px solid var(--bd); color: inherit; text-decoration: none; }
.lista .ln:first-child { border-top: 0; } .ln:hover b { color: var(--pri); }
.ln b { display: block; } .ln span.d { color: var(--su); font-size: .86rem; }
.motivo { margin: .45rem 0 0; padding: .5rem .75rem; border-left: 3px solid var(--pri); border-radius: 0 8px 8px 0;
          background: var(--pri2); white-space: pre-wrap; overflow-wrap: anywhere; }
.motivo-destaque { margin: 0 0 1.2rem; padding: .85rem 1.1rem; border-left: 4px solid var(--pri); border-radius: 0 12px 12px 0;
                   background: var(--pri2); }
.motivo-destaque small { display: block; margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.motivo-destaque p { margin: 0; font-size: 1.08rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.barra-lote { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .85rem 1.25rem; }
.barra-lote label { margin: 0; } .barra-lote button { margin-left: auto; } .barra-lote button:disabled { opacity: .5; cursor: not-allowed; }
.barra-lote p { flex-basis: 100%; margin: 0; font-size: .86rem; }
.item-fila { align-items: flex-start; justify-content: flex-start; }
.item-fila .sel { margin: 0; padding: .1rem .3rem; cursor: pointer; }
.item-fila input[type=checkbox] { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.item-fila .corpo { flex: 1; min-width: 0; } .item-fila .nota { margin: .4rem 0 0; font-size: .86rem; }
.botao-sec { flex: none; padding: .35rem .8rem; border: 1px solid var(--bd); border-radius: 9px; font-weight: 600; text-decoration: none; }
.pill, .etiqueta { display: inline-block; padding: .15rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 700;
                   white-space: nowrap; vertical-align: middle; }
.st-P { background: var(--wab); color: var(--wa); } .st-A { background: var(--okb); color: var(--ok); }
.st-U { background: var(--neutro); color: var(--su); } .st-R, .st-C, .st-V { background: var(--erb); color: var(--er); }

/* etapas */
.etapas { display: flex; margin: 1.1rem 0 1.4rem; }
.etapas div { flex: 1; text-align: center; position: relative; font-size: .82rem; color: var(--su); }
.etapas div::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--bd); }
.etapas div:first-child::before { display: none; }
.etapas i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; margin: 0 auto 6px;
            background: var(--bd); font-style: normal; font-weight: 700; position: relative; z-index: 1; color: var(--su); }
.etapas .feita, .etapas .agora { color: var(--tx); }
.etapas .feita i { background: var(--ok); color: #fff; } .etapas .feita::before, .etapas .agora::before { background: var(--ok); }
.etapas .agora i { background: var(--wa); color: #fff; }
.faixa { padding: .8rem 1rem; border-radius: 12px; background: var(--erb); color: var(--er); font-weight: 700; margin: 1rem 0 1.2rem; }

/* ticket do código */
.ticket { display: grid; grid-template-columns: 1fr 170px; border-radius: 18px; overflow: hidden; position: relative;
          background: linear-gradient(135deg, var(--pri2), var(--card)); border: 1px solid var(--bd); margin-bottom: 1.2rem; }
.ticket .esq { padding: 1.3rem; } .ticket .dir { padding: 1.3rem .9rem; border-left: 2px dashed var(--bd); display: flex;
  flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .1rem; }
.ticket::before, .ticket::after { content: ""; position: absolute; right: 159px; width: 22px; height: 22px; border-radius: 99px; background: var(--bg); }
.ticket::before { top: -11px; } .ticket::after { bottom: -11px; }
.ticket small { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }
.codigo { font: 800 2.1rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--pri); margin: .2rem 0 .5rem; user-select: all; }
.ticket .dir b { font-size: 1.3rem; } .ticket.usado { opacity: .75; }

.ficha { display: grid; grid-template-columns: 9rem 1fr; gap: .55rem 1rem; margin: 0; }
.ficha dt { color: var(--su); } .ficha dd { margin: 0; } .ficha .texto { white-space: pre-wrap; }
.dec { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.dec form { display: contents; }

/* busca de cliente */
.resultados { list-style: none; margin: -.6rem 0 1rem; padding: 0; border: 1px solid var(--bd); border-radius: 10px;
              background: var(--card); max-height: 260px; overflow-y: auto; }
.resultados li { padding: .6rem .75rem; cursor: pointer; border-bottom: 1px solid var(--bd); }
.resultados li:hover, .resultados li:focus { background: var(--pri2); outline: none; }
[hidden] { display: none !important; }

/* tabelas (usuários, auditoria) */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--bd); border-radius: var(--raio); }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--bd); vertical-align: top; }
th { color: var(--su); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }

@media (max-width: 760px) {
  main { padding: 16px; } .kpis { grid-template-columns: 1fr 1fr; }
  .wrap { grid-template-columns: 1fr; gap: 0; }
  .ticket { grid-template-columns: 1fr; } .ticket .dir { border-left: 0; border-top: 2px dashed var(--bd); }
  .ticket::before, .ticket::after { display: none; }
  .ficha { grid-template-columns: 1fr; gap: .1rem; } .ficha dd { margin-bottom: .6rem; }
  .dec { grid-template-columns: 1fr; }
  .item-fila { flex-wrap: wrap; gap: .5rem .6rem; } .item-fila .corpo { flex-basis: calc(100% - 3rem); }
  .botao-sec { margin-left: auto; }
  table.cartoes thead { display: none; }
  table.cartoes, table.cartoes tbody, table.cartoes tr, table.cartoes td { display: block; width: 100%; }
  table.cartoes tr { border: 1px solid var(--bd); border-radius: 12px; margin-bottom: .75rem; padding: .4rem .6rem; background: var(--card); }
  table.cartoes td { border: 0; padding: .25rem 0; }
  table.cartoes td[data-rotulo]::before { content: attr(data-rotulo) ": "; color: var(--su); font-size: .85rem; }
}

@media (max-width: 900px) {
  body.com-menu { display: block; }
  .barra-mobile { display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 20;
                  padding: .6rem 14px; background: var(--nav); }
  .barra-mobile button { background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 10px;
                         width: 44px; height: 44px; font-size: 1.4rem; padding: 0; line-height: 1; }
  .barra-mobile .contador { margin-left: auto; }
  .lateral { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; height: auto; width: min(82vw, 300px);
             transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 30px #0006; }
  body.menu-aberto .lateral { transform: none; }
  .fundo-menu { z-index: 30; position: fixed; inset: 0; background: #0008; }
  body.menu-aberto .fundo-menu { display: block; }
  body.menu-aberto { overflow: hidden; }
  .lateral nav a { padding: .85rem .9rem; }
}
