/* ============================================================
   DESIGN SYSTEM DRAFER - Ocorrencia e Logistica
   Base 14px, Inter. Mobile ate 760px.
   Classes usadas pelos scripts base (NAO renomear):
     #menu-lateral.aberto, #overlay-menu.visivel, #btn-menu,
     .link-ferramenta.ativo, #status-conexao.online/.offline, #btn-sair,
     #conteudo-ferramenta, #toasts, .toast-<tipo>, .alerta, .alerta-erro
   ============================================================ */

/* ---- Variaveis ---- */
:root {
  --red: #b8212a;
  --ink: #20252c;
  --muted: #6b737e;
  --line: #e2e5e9;
  --bg: #f4f5f7;
  --white: #fff;
  --green: #218353;
  --amber: #a87a09;
  --orange: #cb6819;

  /* Derivadas (tons auxiliares) */
  --red-dark: #9d1c24;
  --red-focus: #b8212a40;
  --red-soft: #b8212a12;
  --green-soft: #21835314;
  --amber-soft: #a87a0917;
  --orange-soft: #cb681914;
  --ink-soft: #20252c0d;
  --line-strong: #cdd2d8;
  --row-hover: #fafbfc;

  --font: 'Inter', Arial, sans-serif;
  --side-w: 214px;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px #20252c0f;
  --shadow-pop: 0 18px 48px #20252c33;
}

/* ---- Reset basico ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--red);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--red-focus);
  outline-offset: 1px;
}

/* ---- Tipografia ---- */
h1 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.muted { color: var(--muted); }
.t-red { color: var(--red); }
.t-green { color: var(--green); }
.t-amber { color: var(--amber); }
.t-orange { color: var(--orange); }
.right { text-align: right; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout utilitario ---- */
.stack > * + *,
.pilha > * + * {
  margin-top: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   MARCA
   ============================================================ */
.brand-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 52px;
  background: var(--red);
  color: var(--white);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  border-radius: 3px;
  user-select: none;
}
.brand-mark.sm {
  width: 32px;
  height: 36px;
  font-size: 19px;
}

/* ============================================================
   TELA DE LOGIN (index.html)
   ============================================================ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--ink);
}

.login-card {
  width: min(380px, 100%);
  padding: 34px 30px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 24px 64px #0000004d;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.login-brand h1 {
  font-size: 19px;
  letter-spacing: -0.015em;
}
.login-brand p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.login-card .field + .field {
  margin-top: 14px;
}
.login-card .btn.primary {
  margin-top: 22px;
  height: 42px;
  font-size: 14px;
}

.login-erro {
  display: none;
  margin-top: 14px;
}
.login-erro.visivel {
  display: block;
}

.login-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ============================================================
   APP SHELL (principal.html)
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--white);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid #ffffff12;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-text strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.1;
}
.brand-text small {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  color: #ffffff80;
  white-space: nowrap;
}

/* Botao hamburguer (#btn-menu) - so aparece no mobile */
.side-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  background: transparent;
  border: 1px solid #ffffff26;
  border-radius: var(--radius-sm);
  color: var(--white);
}
.side-toggle svg {
  width: 20px;
  height: 20px;
}
.side-toggle .ico-fechar { display: none; }
.side-toggle[aria-expanded='true'] .ico-abrir { display: none; }
.side-toggle[aria-expanded='true'] .ico-fechar { display: block; }

/* Menu (#menu-lateral) */
.side-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 0 0;
}

.nav-group + .nav-group {
  margin-top: 6px;
}

.nav-label {
  display: block;
  padding: 14px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff59;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 18px;
  border: 0;
  background: transparent;
  color: #ffffffb0;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
.nav-btn:hover {
  background: #ffffff08;
  color: var(--white);
}
.nav-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}
.nav-btn.ativo,
.nav-btn[aria-current='page'] {
  background: #ffffff0d;
  box-shadow: inset 3px 0 var(--red);
  color: var(--white);
  font-weight: 600;
}

/* Rodape da sidebar: status PWA + sair */
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid #ffffff12;
}

.status-conexao {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: #ffffff8c;
}
.status-conexao::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status-conexao.online::before {
  background: #2fa56b;
  box-shadow: 0 0 0 3px #2fa56b26;
}
.status-conexao.offline {
  color: #ffd2a8;
}
.status-conexao.offline::before {
  background: var(--orange);
  box-shadow: 0 0 0 3px #cb681933;
}

.side-exit {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #ffffff1f;
  border-radius: var(--radius-sm);
  color: #ffffffcc;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.side-exit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-exit:hover {
  background: #b8212a2e;
  border-color: #b8212a99;
  color: var(--white);
}

/* Fundo escuro atras do menu aberto (mobile) */
#overlay-menu {
  display: none;
}

/* Area onde o modal.js renderiza cada ferramenta */
.app-main {
  margin-left: var(--side-w);
  padding: 32px 36px;
  min-height: 100vh;
}
#conteudo-ferramenta {
  max-width: 1360px;
}

/* ============================================================
   COMPONENTES
   ============================================================ */

/* ---- Cabecalho da ferramenta ---- */
.topline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.topline h1 {
  margin-top: 5px;
}
.topline p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}
.topline .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- Campos ---- */
.field,
.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label,
.field > .lbl,
.campo > label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
select,
textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea {
  height: auto;
  min-height: 92px;
  padding: 9px 11px;
  resize: vertical;
}
select {
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b737e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--red-focus);
  outline-offset: 0;
  border-color: var(--red);
}
input::placeholder,
textarea::placeholder {
  color: #9aa1aa;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}
input[type='checkbox'],
input[type='radio'] {
  width: 15px;
  height: 15px;
  accent-color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}

/* ---- Barra de filtros ---- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filterbar .field {
  flex: 1 1 150px;
}
.filterbar .field.grow {
  flex: 2 1 240px;
}
.filterbar .filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---- Botoes ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:hover {
  background: var(--row-hover);
  border-color: var(--line-strong);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}
.btn.primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn.danger {
  color: var(--red);
  background: var(--white);
  border-color: #b8212a59;
}
.btn.danger:hover {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--ink-soft);
}

.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.btn.icon {
  width: 36px;
  padding: 0;
}
.btn.sm.icon {
  width: 30px;
}
.btn.block,
.btn-bloco {
  width: 100%;
}

/* Compatibilidade com o template antigo */
.btn-perigo {
  color: var(--red);
  border-color: #b8212a59;
}
.btn-secundario {
  background: var(--white);
}

/* ---- Cards de indicador (clicaveis como filtro) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 15px 16px 14px;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
button.card:hover {
  border-color: var(--line-strong);
}
.card[aria-pressed='true'],
button.card[aria-pressed='true']:hover {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}
.card[aria-pressed='true'] .card-label {
  color: var(--red);
}
.card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card-foot {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- Painel ---- */
.panel {
  margin-bottom: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: 14px;
}
.panel-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.panel-body {
  padding: 18px;
}
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---- Tabela ---- */
.table-wrap,
.tabela-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel > .table-wrap,
.panel > .tabela-wrap {
  border: 0;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
th,
td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
th {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  background: var(--row-hover);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: var(--row-hover);
}
th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td .sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

/* Em telas estreitas: linhas viram "cartoes" usando data-label.
   Use <td data-label="Nome">...</td> com <table class="empilhavel">. */
@media (max-width: 640px) {
  table.empilhavel thead {
    display: none;
  }
  table.empilhavel,
  table.empilhavel tbody,
  table.empilhavel tr,
  table.empilhavel td {
    display: block;
    width: 100%;
  }
  table.empilhavel tr {
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
  }
  table.empilhavel td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 14px;
    border-bottom: 0;
    text-align: right;
  }
  table.empilhavel td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }
}

/* ---- Tag (identificadores: placa, carga, unidade) ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.tag.red {
  color: var(--red);
  background: var(--red-soft);
  border-color: #b8212a33;
}
.tag.dark {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

/* ---- Status (pilula com ponto) ---- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--muted);
  background: var(--ink-soft);
  border-radius: 999px;
}
.status::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status.ok { color: var(--green); background: var(--green-soft); }
.status.warn { color: var(--amber); background: var(--amber-soft); }
.status.alert { color: var(--orange); background: var(--orange-soft); }
.status.danger { color: var(--red); background: var(--red-soft); }
.status.neutral { color: var(--muted); background: var(--ink-soft); }

/* ---- Alertas (usados pelo modal.js e telas) ---- */
.alerta {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
}
.alerta-sucesso { border-left-color: var(--green); background: #f3faf6; }
.alerta-erro { border-left-color: var(--red); background: #fdf4f4; }
.alerta-aviso { border-left-color: var(--amber); background: #fdf9ef; }

/* ---- Estado vazio ---- */
.empty {
  padding: 36px 18px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

/* ---- Dialog (modal nativo) ---- */
dialog {
  width: min(560px, calc(100% - 24px));
  max-height: min(88vh, 860px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.wide {
  width: min(860px, calc(100% - 24px));
}
dialog::backdrop {
  background: #20252c8c;
}
dialog[open] {
  animation: dialog-entra 0.16s ease-out;
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 {
  margin-top: 4px;
  font-size: 17px;
}
.dialog-body {
  padding: 20px 22px;
}
.dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  background: var(--white);
  border-top: 1px solid var(--line);
}

@keyframes dialog-entra {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

/* ---- Toasts (script.js: window.toast(msg, 'sucesso'|'erro'|'aviso'|'info')) ---- */
#toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  width: 100%;
  padding: 12px 14px 12px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  background: var(--ink);
  border-left: 3px solid #ffffff59;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  animation: toast-entra 0.2s ease-out;
  pointer-events: auto;
}
.toast-sucesso { border-left-color: #2fa56b; }
.toast-erro { border-left-color: var(--red); background: #2b1f22; }
.toast-aviso { border-left-color: #d4a21f; }
.toast-info { border-left-color: #8fa3b8; }

@keyframes toast-entra {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   MOBILE (<= 760px): sidebar vira barra superior sticky
   ============================================================ */
@media (max-width: 760px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: 0 auto auto 0;
    width: 100%;
    height: auto;
    flex-direction: column;
  }

  .side-brand {
    padding: 9px 12px 9px 16px;
    border-bottom: 0;
  }
  .side-brand .brand-mark {
    width: 32px;
    height: 36px;
    font-size: 19px;
  }
  .side-toggle {
    display: inline-grid;
  }

  #menu-lateral {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 54px);
    max-height: calc(100dvh - 54px);
    padding-top: 4px;
    background: var(--ink);
    border-top: 1px solid #ffffff14;
    box-shadow: 0 18px 36px #0000004d;
  }
  #menu-lateral.aberto {
    display: flex;
  }
  .nav-btn {
    padding: 12px 18px;
    font-size: 14px;
  }
  .side-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .side-exit {
    width: auto;
  }

  #overlay-menu.visivel {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: #20252c66;
  }

  .app-main {
    margin-left: 0;
    padding: 22px 16px 96px;
  }

  h1,
  .topline h1 {
    font-size: 21px;
  }
  .topline .actions,
  .topline .actions .btn {
    width: 100%;
  }
  .topline .actions .btn {
    flex: 1;
  }

  .filterbar .filter-actions {
    width: 100%;
    margin-left: 0;
  }
  .filterbar .filter-actions .btn {
    flex: 1;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card-value {
    font-size: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  dialog {
    width: calc(100% - 16px);
    max-height: 92vh;
  }
  .dialog-head,
  .dialog-body,
  .dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
  .dialog-actions .btn {
    flex: 1;
  }

  #toasts {
    right: 50%;
    bottom: 16px;
    transform: translateX(50%);
    align-items: stretch;
  }

  .login-card {
    padding: 30px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
