* { box-sizing: border-box; }
body { margin: 0; padding: 1rem; background: #f3f5f3; color: #202d25; font: 1rem/1.5 system-ui, sans-serif; }
.panel { max-width: 32rem; margin: 5vh auto; padding: clamp(1rem, 4vw, 2rem); background: white; border: 1px solid #d7ded8; border-radius: .75rem; }
.cabecalho-marca { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.brand { color: #47614e; }
.cabecalho-marca .brand { flex: 1; margin: .75rem 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.logo-empresa { display: block; width: min(48%, 12.75rem); height: auto; flex: 0 1 12.75rem; object-fit: contain; }
h1 { font-size: 1.6rem; }
label { display: block; margin-top: 1rem; }
input, select, textarea, button { width: 100%; min-height: 3rem; padding: .75rem; font: inherit; border: 1px solid #738379; border-radius: .35rem; }
button, input[type=submit] { margin-top: 1.5rem; background: #275838; color: white; cursor: pointer; }
:focus-visible { outline: 3px solid #c18a18; outline-offset: 3px; }
.message { padding: .75rem; background: #fff3d6; border-left: 4px solid #986615; }
a { color: #275838; }
.button-link { display: inline-block; width: 100%; min-height: 3rem; padding: .75rem; border-radius: .35rem; background: #275838; color: white; text-align: center; text-decoration: none; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: .6rem .4rem; border-bottom: 1px solid #d7ded8; text-align: left; vertical-align: top; }
.acoes-extrato { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin: 1rem 0; }
.acoes-extrato .button-link { width: auto; }
.acao-link { display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: .7rem; border: 1px solid #738379; border-radius: .35rem; text-align: center; text-decoration: none; }
.resultados-tabela { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.resultados-tabela table { min-width: 70rem; }
.estoque-tabela table { min-width: 36rem; }
.resultados-tabela th, .resultados-tabela td { overflow-wrap: break-word; }
.coluna-acao { width: 1%; white-space: nowrap; }
.botao-acao-tabela { width: auto; min-height: 2.5rem; margin: 0; padding: .5rem .75rem; }
.modal-devolucao { width: min(28rem, calc(100% - 2rem)); padding: 0; color: #202d25; border: 1px solid #738379; border-radius: .75rem; }
.modal-devolucao::backdrop { background: rgb(32 45 37 / 55%); }
.modal-devolucao__form { padding: clamp(1rem, 5vw, 1.5rem); }
.modal-devolucao__form h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.modal-devolucao__resumo { margin: 0; padding: .75rem; background: #f3f5f3; border-radius: .35rem; }
.modal-devolucao__resumo dt:first-child { margin-top: 0; }
.modal-devolucao__acoes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1.25rem; }
.modal-devolucao__acoes button { margin: 0; }
.botao-secundario { background: white; color: #275838; }
.checkbox-label { display: flex; align-items: center; gap: .6rem; }
.checkbox-label input { width: auto; min-height: auto; }
dt { margin-top: .75rem; font-weight: 700; }
dd { margin: 0; }
.cliente-combobox { position: relative; }
.cliente-combobox__lista {
  position: absolute;
  z-index: 20;
  width: 100%;
  max-height: 18rem;
  overflow-y: auto;
  margin-top: .25rem;
  padding: .25rem;
  background: white;
  border: 1px solid #738379;
  border-radius: .35rem;
  box-shadow: 0 .4rem 1rem rgb(32 45 37 / 18%);
}
.cliente-combobox__opcao {
  min-height: 2.5rem;
  margin: 0;
  padding: .55rem .65rem;
  background: white;
  color: #202d25;
  border: 0;
  text-align: left;
}
.cliente-combobox__opcao:hover,
.cliente-combobox__opcao.ativa { background: #e7efe9; }
.cliente-combobox__vazio { margin: 0; padding: .65rem; color: #47614e; }
.panel--wide { max-width: 76rem; }
.auditoria-introducao { max-width: 48rem; color: #47614e; }
.auditoria-filtros { display: grid; grid-template-columns: repeat(4, minmax(10rem, 1fr)); gap: .75rem; align-items: end; }
.auditoria-filtros label { margin-top: 0; font-weight: 700; }
.auditoria-filtros input, .auditoria-filtros select { margin-top: .3rem; font-weight: 400; }
.auditoria-filtros button { margin-top: 0; }
.auditoria-tabela table { min-width: 64rem; }
.auditoria-evento { display: inline-block; padding: .2rem .5rem; border-left: 4px solid #738379; background: #f3f5f3; font-weight: 700; white-space: nowrap; }
.auditoria-evento--login_bloqueado, .auditoria-evento--login_falha { border-color: #986615; background: #fff3d6; }
.auditoria-evento--movimentacao_criada { border-color: #275838; background: #e7efe9; }
.auditoria-paginacao { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.auditoria-paginacao .acao-link { width: auto; }
.usuarios-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.usuarios-toolbar h1, .usuarios-toolbar p { margin-bottom: .25rem; }
.usuarios-toolbar .button-link { width: auto; flex: 0 0 auto; }
.usuarios-tabela table { min-width: 58rem; }
.usuarios-tabela form { margin: 0; }
.status-badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-weight: 700; }
.status-badge--ativo { background: #e7efe9; color: #194d2c; }
.status-badge--inativo { background: #ecefed; color: #5f6862; }
.usuarios-conta-atual { color: #47614e; white-space: nowrap; }
.credencial-provisoria code { display: block; margin-top: .25rem; padding: .85rem; overflow-wrap: anywhere; background: #eef3ef; border: 1px solid #b8c7bb; border-radius: .35rem; color: #082f87; font-size: 1.15rem; }
.desktop-sidebar, .desktop-topbar, .home-desktop { display: none; }
@media (max-width: 48rem) {
  .auditoria-filtros { grid-template-columns: 1fr; }
  .auditoria-paginacao { flex-direction: column; }
  .usuarios-toolbar { align-items: stretch; flex-direction: column; }
  .usuarios-toolbar .button-link { width: 100%; }
}

@media (min-width: 64rem) {
  .body--desktop-app {
    min-height: 100vh;
    padding: 0;
    background: #f2f5f2;
    color: #203128;
    font-family: "Segoe UI", "Source Sans 3", system-ui, sans-serif;
  }
  .app-shell {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    min-height: 100vh;
  }
  .desktop-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.25rem .9rem 1rem;
    overflow-y: auto;
    background: #194d2c;
    color: white;
  }
  .desktop-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    margin: 0 .35rem 1.15rem;
    padding: .35rem .65rem .85rem;
    color: white;
    border-bottom: 1px solid rgb(255 255 255 / 24%);
    text-decoration: none;
  }
  .desktop-brand img {
    display: block;
    width: 9.5rem;
    height: 5.7rem;
    object-fit: contain;
  }
  .desktop-brand span { font-size: .95rem; font-weight: 700; }
  .desktop-nav { flex: 1; }
  .desktop-nav__group {
    margin: 1rem .65rem .35rem;
    color: rgb(255 255 255 / 68%);
    font-size: .78rem;
    font-weight: 700;
  }
  .desktop-nav__link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 2.65rem;
    margin: .12rem 0;
    padding: .55rem .65rem;
    color: white;
    border-radius: .4rem;
    text-decoration: none;
  }
  .desktop-nav__link:hover { background: rgb(255 255 255 / 10%); }
  .desktop-nav__link.is-active {
    background: #3e8b45;
    box-shadow: inset .2rem 0 0 #f2d927;
  }
  .desktop-nav__icon {
    display: grid;
    width: 1.4rem;
    height: 1.4rem;
    place-items: center;
    flex: 0 0 1.4rem;
    font-size: 1.2rem;
    line-height: 1;
  }
  .desktop-user {
    display: grid;
    grid-template-columns: 2.25rem 1fr auto;
    gap: .65rem;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem .35rem 0;
    border-top: 1px solid rgb(255 255 255 / 24%);
  }
  .desktop-user__avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    background: #3e8b45;
    border: 2px solid rgb(255 255 255 / 55%);
    border-radius: 50%;
    font-weight: 800;
  }
  .desktop-user__identity { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
  .desktop-user__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-user__identity small { margin-top: .2rem; color: rgb(255 255 255 / 72%); }
  .desktop-user form { margin: 0; }
  .desktop-user button {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: .4rem;
    background: transparent;
    border: 0;
    color: white;
    font-weight: 700;
  }
  .body--desktop-app .app-main {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0 2rem 3rem;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .body--desktop-app .cabecalho-marca { display: none; }
  .desktop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.25rem;
    margin: 0 -2rem 2.6rem;
    padding: 0 2rem;
    background: white;
    border-bottom: 1px solid #d7ded8;
  }
  .desktop-topbar p { display: flex; gap: .6rem; margin: 0; color: #47614e; }
  .desktop-topbar a { font-weight: 700; text-decoration: none; }
  .body--desktop-app .app-main:not(.app-main--home):not(.panel--wide) > :not(.desktop-topbar) {
    max-width: 52rem;
    margin-right: auto;
    margin-left: auto;
  }
  .body--desktop-app .message { max-width: 88rem; margin: 0 auto 1rem; }
  .body--desktop-app .home-mobile { display: none; }
  .body--desktop-app .home-desktop {
    display: block;
    width: min(100%, 88rem);
    margin: 0 auto;
  }
  .home-desktop__intro { margin-bottom: 2rem; }
  .home-desktop__intro h1 { margin: 0; color: #153d24; font-size: clamp(2.1rem, 3.2vw, 3.25rem); line-height: 1.05; }
  .home-desktop__intro p { margin: .65rem 0 0; color: #47614e; font-size: 1.2rem; }
  .home-command { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .home-command__action {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 7.5rem;
    padding: 1.35rem 1.5rem;
    color: white;
    border-radius: .5rem;
    text-decoration: none;
  }
  .home-command__action--primary { background: #194d2c; }
  .home-command__action--secondary { background: #082f87; }
  .home-command__action:hover { filter: brightness(1.08); }
  .home-command__symbol { font-size: 2.2rem; text-align: center; }
  .home-command__action strong, .home-command__action small { display: block; }
  .home-command__action strong { font-size: 1.25rem; line-height: 1.2; }
  .home-command__action small { margin-top: .35rem; color: rgb(255 255 255 / 80%); font-size: .95rem; }
  .home-command__arrow { color: #f2d927; font-size: 2.3rem; line-height: 1; }
  .home-sections { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(19rem, .85fr); gap: 1.5rem; align-items: start; margin-top: 2rem; }
  .home-actions { padding: 0 1.35rem; background: white; border: 1px solid #d7ded8; border-radius: .5rem; }
  .home-actions h2 { margin: 0; padding: 1.2rem .2rem 1rem; color: #153d24; font-size: 1.35rem; }
  .home-actions a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.5rem;
    padding: .75rem .2rem;
    color: #203128;
    border-top: 1px solid #d7ded8;
    text-decoration: none;
  }
  .home-actions a:hover { color: #194d2c; background: #f7faf7; }
  .home-actions a span:last-child { color: #c7a900; font-size: 1.8rem; line-height: 1; }
  .home-actions--admin { border-top: .25rem solid #f2d927; }
  .body--desktop-app .panel--wide { max-width: none; }
  .body--desktop-app .resultados-tabela { width: 100%; }
}
