/* ============================================================
   Solum - Controle de Insumos
   Sistema visual: organico, terroso, com identidade propria.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- paleta base (marrom mineral) ---- */
  --brand: #8B4A2C;
  --brand-light: #C97C4C;
  --brand-lighter: #E8A874;
  --brand-dark: #5C2F1B;
  --brand-deep: #33190E;

  --ink: #251A12;
  --ink-soft: #6E5B4C;
  --ink-faint: #A4927F;

  --paper: #F9F4EE;
  --surface: #FFFFFF;
  --surface-alt: #F3E9DD;
  --line: #EAE0D2;
  --line-soft: #F2EAE0;

  /* ---- status (reservadas, nao reaproveitar para outra coisa) ---- */
  --ok: #3E8A5B;       --ok-tint: #E4F3E9;
  --info: #46709C;     --info-tint: #E8EFF6;
  --warn: #BD8A1F;     --warn-tint: #FBF1DC;
  --bad: #C24A38;      --bad-tint: #FBE8E4;

  /* ---- gradientes de marca ---- */
  --grad-brand: linear-gradient(135deg, #A8623A 0%, #7C3F22 65%, #602E19 100%);
  --grad-deep: linear-gradient(165deg, #26130B 0%, #4A2818 45%, #8B4A2C 100%);
  --grad-hairline: linear-gradient(90deg, var(--brand-light), var(--brand));

  /* ---- forma ---- */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* ---- sombra ---- */
  --shadow-sm: 0 1px 2px rgba(51, 25, 14, .05);
  --shadow-md: 0 10px 28px -10px rgba(51, 25, 14, .20), 0 2px 6px rgba(51, 25, 14, .06);
  --shadow-lg: 0 24px 56px -16px rgba(51, 25, 14, .32);
  --ring-brand: 0 0 0 4px rgba(139, 74, 44, .14);
}

* { box-sizing: border-box; }
img, svg { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: 24px; }
h2 { font-size: 18px; }
p.subtitulo { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }

::selection { background: var(--brand-lighter); color: var(--brand-deep); }

/* custom scrollbar - detalhe organico */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9C7B4; border-radius: 999px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-light); }

/* entrada suave para conteudo carregado */
@keyframes surgir {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Layout geral ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--grad-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* blobs organicos decorativos, puramente visuais */
.sidebar::before, .sidebar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  opacity: .35;
}
.sidebar::before {
  width: 260px; height: 260px;
  background: var(--brand-light);
  top: -110px; left: -90px;
}
.sidebar::after {
  width: 200px; height: 200px;
  background: #A8623A;
  bottom: -80px; right: -70px;
  opacity: .25;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar .logo-area {
  padding: 26px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar .logo-chip {
  display: inline-block;
  background: rgba(255,255,255,0.95);
  border-radius: var(--r-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar .logo-area img { width: 100%; max-width: 128px; display: block; }
.sidebar .logo-area span {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  font-weight: 600;
}

.menu-mobile { display: none; }

.sidebar nav { flex: 1; padding: 18px 14px; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 3px;
  text-decoration: none;
  position: relative;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar nav a .nav-icone { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.sidebar nav a .nav-icone svg { width: 100%; height: 100%; }

.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; transform: translateX(2px); }
.sidebar nav a.ativo {
  background: linear-gradient(135deg, rgba(233,168,116,.95), rgba(139,74,44,.95));
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(0,0,0,.35);
}
.sidebar nav a.ativo .nav-icone { opacity: 1; }

.sidebar nav .grupo-titulo {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  padding: 18px 13px 7px;
}

.sidebar .usuario-area {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-lighter), var(--brand-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-deep);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.sidebar .usuario-info { min-width: 0; flex: 1; }
.sidebar .usuario-area .nome {
  color: #fff; font-weight: 600; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .usuario-area .perfil { color: rgba(255,255,255,0.5); font-size: 12px; }
.sidebar .usuario-area a.sair {
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  transition: background .15s ease, color .15s ease;
}
.sidebar .usuario-area a.sair:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .usuario-area a.sair svg { width: 16px; height: 16px; }

.conteudo { flex: 1; min-width: 0; padding: 30px 36px 60px; animation: surgir .35s ease both; }

.topo-pagina {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.topo-pagina > div { min-width: 0; }

/* ---------- Mensagens flash ---------- */
.alerta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  animation: surgir .3s ease both;
}
.alerta-sucesso { background: var(--ok-tint); color: var(--ok); border-color: #cfe7d7; }
.alerta-erro { background: var(--bad-tint); color: var(--bad); border-color: #f0cdc7; }
.alerta .alerta-fechar {
  margin-left: auto;
  cursor: pointer;
  opacity: .6;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: inherit;
  padding: 2px 4px;
  border-radius: 6px;
}
.alerta .alerta-fechar:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ---------- Cards / KPIs ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  position: relative;
  transition: box-shadow .2s ease, transform .2s ease;
  min-width: 0;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-kpi {
  overflow: hidden;
  padding-left: 24px;
}
.card-kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--grad-hairline);
}
.card-kpi .rotulo {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.card-kpi .valor {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}
.card-kpi .valor.destaque { color: var(--brand); }

/* ---------- Botoes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--grad-brand);
  color: #fff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 4px 14px -4px rgba(139,74,44,.5);
  transition: transform .15s ease, box-shadow .15s ease, color .15s ease;
}
/* efeito "shine sweep" no hover, estilo uiverse */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .55s ease;
  z-index: -1;
}
.btn:hover::before { transform: translateX(120%); }
.btn:hover { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(139,74,44,.6); }
.btn:active { transform: translateY(0) scale(.98); }

.btn-secundario {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn-secundario::before { display: none; }
.btn-secundario:hover { background: var(--surface-alt); color: var(--ink); border-color: var(--brand-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-perigo { background: linear-gradient(135deg, #D2604B, #A8382A); box-shadow: 0 4px 14px -4px rgba(194,74,56,.5); }
.btn-perigo:hover { box-shadow: 0 8px 20px -6px rgba(194,74,56,.6); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* pequena marca de "ripple" ao clicar (via JS) */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  transform: scale(0);
  animation: ripple .55s ease-out;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Formularios ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  max-width: 760px;
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.campo { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--ink); }
.campo .dica { font-size: 12px; color: var(--ink-faint); font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
select, textarea {
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #DCCBB8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring-brand);
}
textarea { resize: vertical; min-height: 74px; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E5B4C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.form-acoes { display: flex; gap: 10px; margin-top: 8px; }

.cadastro-rapido {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  margin: 4px 0 20px;
}
.cadastro-rapido h2 { margin-bottom: 2px; }

/* interruptor organico para campos "ativo" */
.interruptor { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; user-select: none; }
.interruptor input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor .trilho {
  width: 42px; height: 24px;
  background: #E3D6C6;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background .2s ease;
  cursor: pointer;
}
.interruptor .trilho::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease;
}
.interruptor input:checked + .trilho { background: var(--grad-brand); }
.interruptor input:checked + .trilho::after { transform: translateX(18px); }
.interruptor input:focus-visible + .trilho { box-shadow: var(--ring-brand); }
.interruptor label { font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }

/* ---------- Tabelas ---------- */
.tabela-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 13px 16px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
  background: var(--surface-alt);
}
thead th:first-child { border-top-left-radius: var(--r-lg); }
thead th:last-child { border-top-right-radius: var(--r-lg); }
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  position: relative;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #FDFAF6; }
tbody tr:hover td:first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad-hairline);
}
td.num, th.num { text-align: right; }
.linha-inativa { opacity: .5; }

.acoes-tabela { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-entrada { background: var(--ok-tint); color: var(--ok); }
.badge-entrada::before { background: var(--ok); }
.badge-saida { background: var(--info-tint); color: var(--info); }
.badge-saida::before { background: var(--info); }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-ok::before { background: var(--ok); }
.badge-baixo { background: var(--warn-tint); color: var(--warn); }
.badge-baixo::before { background: var(--warn); }
.badge-zerado { background: var(--bad-tint); color: var(--bad); }
.badge-zerado::before { background: var(--bad); animation: pulso 1.6s ease-in-out infinite; }
.badge-inativo { background: var(--surface-alt); color: var(--ink-faint); }
.badge-inativo::before { background: var(--ink-faint); }

@keyframes pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194,74,56,.45); }
  50% { box-shadow: 0 0 0 4px rgba(194,74,56,0); }
}

/* ---------- Filtros ---------- */
.barra-filtros {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 18px;
}
.barra-filtros .campo { margin-bottom: 0; min-width: 160px; }

/* ---------- Tela de login / instalacao ---------- */
.tela-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--grad-deep);
  padding: 20px;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .45;
  pointer-events: none;
}
.blob-1 { width: 420px; height: 420px; background: var(--brand-light); top: -140px; left: -120px; }
.blob-2 { width: 360px; height: 360px; background: #A8623A; bottom: -140px; right: -100px; opacity: .35; }
.blob-3 { width: 260px; height: 260px; background: var(--brand-lighter); bottom: 10%; left: 8%; opacity: .18; }

.caixa-login {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 38px 34px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: surgir .5s ease both;
}
.caixa-login img { width: 175px; margin: 0 auto 8px; display: block; }
.caixa-login .subtitulo-marca {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 24px;
  font-weight: 600;
}
.caixa-login h2 { font-size: 20px; }
.caixa-login form { text-align: left; }
.caixa-login .campo label { font-size: 13px; }
.caixa-login .btn { width: 100%; justify-content: center; padding: 12px; margin-top: 8px; }

/* ---------- Estado vazio ---------- */
.texto-vazio {
  color: var(--ink-faint);
  padding: 46px 20px;
  text-align: center;
  font-size: 14px;
}
.texto-vazio::before {
  content: "";
  display: block;
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C7B6A2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18l5-8 3 4 2-3 6 7'/%3E%3Cline x1='3' y1='18' x2='21' y2='18' stroke-dasharray='2.2 2.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  opacity: .8;
}

.dois-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.dois-col > * { min-width: 0; }
.estoque-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.estoque-item > div { min-width: 0; overflow-wrap: anywhere; }
.estoque-item .estoque-detalhe { color: var(--ink-soft); font-size: 13px; }
/* ---------- Responsividade ---------- */
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .conteudo { padding: 26px 24px 50px; }
  .dois-col { grid-template-columns: 1fr; }
  .barra-filtros { gap: 10px; }
  .barra-filtros .campo { min-width: 145px; flex: 1 1 145px; }
}

@media (max-width: 900px) {
  .app { display: block; }
  .sidebar {
    width: 100%;
    position: relative;
    overflow: visible;
  }
  .sidebar .logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
  }
  .sidebar .logo-chip { padding: 8px 12px; }
  .sidebar .logo-area img { max-width: 105px; }
  .sidebar .logo-area span { margin: 0; font-size: 9px; }
  .menu-mobile {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 9px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    cursor: pointer;
  }
  .sidebar .logo-area .menu-mobile > span {
    display: block;
    flex: 0 0 2px;
    width: 22px;
    height: 2px;
    min-height: 2px;
    margin: 0 auto;
    border-radius: 99px;
    background-color: #fff !important;
    opacity: 1;
    transition: transform .2s ease, opacity .2s ease;
  }
  .menu-mobile[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-mobile[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-mobile[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sidebar nav {
    display: none;
    padding: 8px 14px 14px;
    border-top: 1px solid rgba(255,255,255,.10);
    animation: surgir .22s ease both;
  }
  .sidebar nav.menu-aberto {
    display: block;
  }
  .sidebar nav a {
    margin: 0;
    padding: 11px 13px;
  }
  .sidebar nav .grupo-titulo { display: none; }
  .sidebar .usuario-area {
    padding: 10px 20px 13px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .conteudo { padding: 24px 22px 48px; }
}

@media (max-width: 640px) {
  html, body { font-size: 14px; }
  .sidebar .logo-area { padding: 12px 14px; }
  .sidebar .logo-area span { display: none; }
  .sidebar nav { padding: 8px 10px 10px; }
  .sidebar nav a { font-size: 13px; padding: 9px 10px; }
  .sidebar nav a .nav-icone { width: 16px; height: 16px; }
  .sidebar .usuario-area { padding: 9px 14px 11px; }

  .conteudo { padding: 20px 14px 36px; }
  .topo-pagina { margin-bottom: 18px; gap: 12px; }
  h1 { font-size: 22px; }
  p.subtitulo { font-size: 13px; margin-bottom: 14px; }
  .topo-pagina > .btn,
  .topo-pagina > .acoes-tabela { width: 100%; }
  .topo-pagina > .btn { justify-content: center; }
  .acoes-tabela { gap: 6px; }
  .acoes-tabela .btn { flex: 1 1 auto; justify-content: center; }

  .form-card { padding: 19px 16px; border-radius: var(--r-md); }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .campo { margin-bottom: 15px; }
  .form-acoes { flex-wrap: wrap; }
  .form-acoes .btn { flex: 1 1 130px; justify-content: center; }
  .cadastro-rapido { padding: 14px; }
  .btn-cadastro-rapido { width: 100%; justify-content: center; }
  .estoque-item { align-items: flex-start; }
  .estoque-item .badge { flex-shrink: 0; }

  .barra-filtros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: var(--r-md);
  }
  .barra-filtros .campo { min-width: 0; width: 100%; }
  .barra-filtros .campo:first-child { grid-column: 1 / -1; }
  .barra-filtros > .btn { width: 100%; justify-content: center; }

  .tabela-wrap {
    border-radius: var(--r-md);
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 720px; }
  thead th, tbody td { padding: 11px 12px; }
}

@media (max-width: 400px) {
  .conteudo { padding-left: 10px; padding-right: 10px; }
  .barra-filtros { grid-template-columns: 1fr; }
  .barra-filtros .campo:first-child { grid-column: auto; }
  .form-card { padding: 16px 13px; }
  .form-acoes .btn { flex-basis: 100%; }
  .usuario-area .nome { max-width: 170px; }
  .caixa-login { padding: 28px 20px 24px; border-radius: var(--r-lg); }
  .caixa-login img { width: 145px; }
}
