:root {
  --azul: #4f46e5;
  --azul-hover: #4338ca;
  --azul-suave: #eef2ff;
  --azul-escuro: #0f172a;
  --verde: #059669;
  --verde-suave: #ecfdf5;
  --vermelho: #dc2626;
  --vermelho-suave: #fef2f2;
  --amarelo: #d97706;
  --amarelo-suave: #fffbeb;
  --cinza-bg: #f2e9db;
  --cinza-borda: #e5e9f0;
  --texto: #0f172a;
  --texto-suave: #64748b;
  --sombra-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.04);
  --sombra-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --sombra-lg: 0 24px 60px rgba(15, 23, 42, 0.22);
  --raio: 12px;
  --raio-sm: 8px;
  --fonte: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--fonte);
  background: var(--cinza-bg);
  color: var(--texto);
  font-size: 14.5px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 20px; border: 2.5px solid var(--cinza-bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

#app { display: flex; min-height: 100vh; }

@keyframes desvanecer {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px;
  background: linear-gradient(185deg, #0f172a 0%, #111827 100%);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 14px;
}
.sidebar .brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.sidebar .brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar .brand strong { font-size: 15px; font-weight: 650; display: block; letter-spacing: -0.01em; }
.sidebar .brand span { font-size: 11.5px; color: #94a3b8; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 20px;
  margin: 1px 10px;
  border-radius: var(--raio-sm);
  cursor: pointer;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-icon { display: flex; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active {
  background: rgba(99, 102, 241, 0.16);
  color: #fff;
  font-weight: 600;
}
.nav-item.active .nav-icon { opacity: 1; color: #a5b4fc; }

.sidebar-rodape {
  margin-top: auto;
  padding: 16px 20px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.usuario-atual { font-size: 12.5px; color: #cbd5e1; margin-bottom: 8px; line-height: 1.4; }
.usuario-atual strong { display: block; color: #fff; font-weight: 650; font-size: 13px; }
.usuario-atual span { text-transform: capitalize; color: #94a3b8; }
#btn-sair { width: 100%; background: rgba(255, 255, 255, 0.06); color: #cbd5e1; box-shadow: none; }
#btn-sair:hover { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }

/* ---------- Login ---------- */
.tela-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(185deg, #0f172a 0%, #111827 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 360px;
  box-shadow: var(--sombra-lg); text-align: center;
}
.login-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; box-shadow: var(--sombra-md); }
.login-card h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: -0.01em; }
.login-card .sub-detalhe { margin: 0 0 22px; }
.login-card .campo { text-align: left; }
.login-erro { color: var(--vermelho); font-size: 12.5px; margin: -6px 0 14px; text-align: left; }

/* ---------- Main ---------- */
.main { flex: 1; padding: 30px 36px 60px; overflow-x: hidden; max-width: 1440px; }

.capa-dashboard {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 30px;
  border-radius: var(--raio);
  margin-bottom: 24px;
  background: linear-gradient(120deg, #2b1a12 0%, #4a2c1a 45%, #7a4a1f 100%);
  box-shadow: var(--sombra-md);
  position: relative;
  overflow: hidden;
  animation: desvanecer 0.3s ease;
}
.capa-dashboard::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 25%, rgba(217, 165, 60, 0.35), transparent 60%);
  pointer-events: none;
}
.capa-logo {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%;
  background: #fff; object-fit: cover;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  position: relative; z-index: 1;
}
.capa-texto { position: relative; z-index: 1; }
.capa-texto h2 { margin: 0 0 3px; font-size: 21px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.capa-texto p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.capa-texto p.capa-frase { font-size: 14px; font-style: italic; max-width: 560px; line-height: 1.5; color: rgba(255, 255, 255, 0.88); }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  animation: desvanecer 0.3s ease;
}
.page-header h1 { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Painel colapsavel (ex: Proximos Vencimentos) ---------- */
.btn-colapsar {
  background: transparent; border: none; box-shadow: none; padding: 2px 4px 2px 0;
  display: flex; align-items: center; gap: 8px; cursor: pointer; color: inherit;
}
.btn-colapsar:hover { background: transparent; box-shadow: none; }
.btn-colapsar:hover h3 { color: var(--azul); }
.btn-colapsar .seta-colapsar {
  font-size: 13px; color: var(--texto-suave); transition: transform 0.2s ease;
  display: inline-block;
}
.btn-colapsar.colapsado .seta-colapsar { transform: rotate(-90deg); }

button, .btn {
  border: none;
  background: var(--azul);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--raio-sm);
  font-size: 13.5px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.12);
}
button:hover { background: var(--azul-hover); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28); }
button:active { transform: translateY(1px); }
button.secundario { background: #fff; color: var(--azul); border: 1px solid var(--cinza-borda); box-shadow: var(--sombra-sm); }
button.secundario:hover { background: var(--azul-suave); border-color: var(--azul); box-shadow: var(--sombra-sm); }
button.perigo { background: var(--vermelho); box-shadow: 0 1px 2px rgba(220, 38, 38, 0.15); }
button.perigo:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25); }
button.sutil { background: transparent; color: var(--texto-suave); font-weight: 500; box-shadow: none; }
button.sutil:hover { background: #f1f5f9; color: var(--texto); box-shadow: none; }

input, select, textarea {
  width: 100%;
  padding: 8.5px 11px;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  font-size: 13.5px;
  background: #fff;
  color: var(--texto);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #cbd5e1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px var(--azul-suave);
}
label { font-family: inherit; }

/* ---------- Cards resumo ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--raio);
  padding: 18px 20px;
  border: 1px solid var(--cinza-borda);
  border-top: 3px solid var(--azul);
  box-shadow: var(--sombra-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: desvanecer 0.35s ease;
}
.card:hover { box-shadow: var(--sombra-md); transform: translateY(-2px); }
.card-clicavel { cursor: pointer; }
.card-clicavel:hover { box-shadow: var(--sombra-md); transform: translateY(-2px); border-color: var(--azul); }
.card-clicavel:active { transform: translateY(0); }
.card.receita { border-top-color: var(--verde); }
.card.despesa { border-top-color: var(--vermelho); }
.card.saldo { border-top-color: var(--azul); }
.card.pendente { border-top-color: var(--amarelo); }
.card.lucro { border-top-color: #0d9488; }
.card .label { font-size: 11.5px; letter-spacing: 0.05em; color: var(--texto-suave); text-transform: uppercase; font-weight: 650; }
.card .valor { font-size: 24px; font-weight: 700; margin: 7px 0 3px; letter-spacing: -0.01em; }
.card .sub { font-size: 12px; color: var(--texto-suave); }

/* ---------- Painel / tabela ---------- */
.painel {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--raio);
  padding: 22px;
  border: 1px solid var(--cinza-borda);
  box-shadow: var(--sombra-sm);
  margin-bottom: 20px;
  animation: desvanecer 0.35s ease;
  overflow-x: auto;
}
.painel h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 650; letter-spacing: -0.005em; }
.chart-wrap { position: relative; height: 260px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--cinza-borda); }
th { color: var(--texto-suave); font-weight: 650; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; border-bottom-width: 1.5px; }
tbody tr { transition: background 0.1s ease; }
tr:hover td { background: #fafbfd; }
tr.linha-clicavel { cursor: pointer; }
tr.linha-clicavel:hover td { background: var(--azul-suave); }
tr.linha-ativa td { background: var(--azul-suave); box-shadow: inset 3px 0 0 var(--azul); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.linha-grupo-categoria td {
  background: #f8fafc; font-weight: 700; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--texto-suave); padding: 9px 10px;
  border-bottom: 1px solid var(--cinza-borda);
}
.linha-grupo-categoria:hover td { background: #f8fafc; }
.linha-grupo-categoria .sub-detalhe { text-transform: none; letter-spacing: normal; font-weight: 600; }

.rateio-lista { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.rateio-linha {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  font-size: 12.5px; padding-bottom: 5px; border-bottom: 1px dashed var(--cinza-borda);
}
.rateio-linha:last-child { border-bottom: none; padding-bottom: 0; }
.rateio-linha > span:first-child { color: var(--texto-suave); }

.badge { display: inline-block; padding: 3.5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.01em; }
.badge.pago { background: var(--verde-suave); color: #0f7a4f; }
.badge.pendente { background: var(--amarelo-suave); color: #92400e; }
.badge.receita { background: var(--verde-suave); color: #0f7a4f; }
.badge.despesa { background: var(--vermelho-suave); color: #991b1b; }

.valor-receita { color: var(--verde); font-weight: 650; }
.valor-despesa { color: var(--vermelho); font-weight: 650; }

.sub-detalhe { color: var(--texto-suave); font-size: 12px; }

.badge-situacao { display: inline-block; padding: 3.5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: #f1f5f9; color: var(--texto-suave); }
.badge-situacao.vence-breve { background: var(--amarelo-suave); color: #92400e; }
.badge-situacao.vence-hoje { background: #ffedd5; color: #c2410c; }
.badge-situacao.atrasado { background: var(--vermelho-suave); color: #991b1b; }

tr.atrasado td { background: #fef7f7; }
tr.atrasado:hover td { background: var(--vermelho-suave); }
tr.vence-hoje td { background: #fffaf3; }

.chip-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--cinza-borda); background: #fff; color: var(--texto-suave);
  padding: 6.5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--azul); color: var(--azul); }
.chip.ativo { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip.ativo:hover { color: #fff; }
.chk-pago { width: 18px; height: 18px; cursor: pointer; accent-color: var(--verde); }

.linha-acoes { display: flex; gap: 6px; }
.linha-acoes button { padding: 5px 11px; font-size: 12px; }

.vazio { text-align: center; color: var(--texto-suave); padding: 34px 0; font-size: 13.5px; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 300;
  animation: desvanecer 0.15s ease;
}
.modal {
  background: #fff; border-radius: 16px; padding: 28px 30px; width: 100%;
  max-width: 560px; box-shadow: var(--sombra-lg);
}
.modal.modal-largo {
  max-width: 860px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  animation: desvanecer 0.22s ease;
}
.modal h2 { margin-top: 0; margin-bottom: 18px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; padding-bottom: 14px; border-bottom: 1px solid var(--cinza-borda); }
.modal-secao { padding: 18px 0; border-top: 1px solid var(--cinza-borda); }
.modal-secao:first-of-type { border-top: none; padding-top: 0; }
.modal-secao-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texto-suave); margin: 0 0 14px; }
.opcao-toggle {
  display: flex; flex-direction: column; gap: 7px; padding: 13px 15px;
  border: 1px solid var(--cinza-borda); border-radius: var(--raio-sm);
  background: #f8fafc; margin-bottom: 14px; transition: border-color 0.15s ease, background 0.15s ease;
}
.opcao-toggle:has(input:checked) { border-color: var(--azul); background: var(--azul-suave); }
.opcao-toggle-label { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 13.5px; cursor: pointer; color: var(--texto); }
.opcao-toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--azul); cursor: pointer; }
.opcao-toggle .sub-detalhe { margin-left: 25px; }
.painel-destaque { padding: 13px 15px; background: #f8fafc; border-radius: var(--raio-sm); border: 1px solid var(--cinza-borda); }
.painel-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--azul-escuro); border-radius: var(--raio-sm); margin: 4px 0 18px; }
.painel-total span:first-child { color: #94a3b8; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.painel-total span:last-child { color: #fff; font-size: 18px; font-weight: 700; }
.campo { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; position: relative; }
.campo label { font-size: 12px; font-weight: 650; color: var(--texto-suave); }
.linha { display: flex; gap: 10px; }
.linha .campo { flex: 1; }

/* Autocomplete proprio (nao usa <datalist> nativo - o Safari do iPhone nao
   exibe as sugestoes de datalist de jeito nenhum, entao esses campos
   ficariam "mudos" no celular). Fica ancorado no .campo pai (position:
   relative acima), logo abaixo do input. */
.autocomplete-lista {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  margin-top: 2px; max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--cinza-borda); border-radius: var(--raio-sm);
  box-shadow: var(--sombra-md);
}
.autocomplete-item { padding: 10px 12px; font-size: 14px; cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.ativo { background: var(--azul-suave); color: var(--azul); }
.autocomplete-item:not(:last-child) { border-bottom: 1px solid #f1f5f9; }

.item-produto { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.item-produto .campo { margin-bottom: 0; min-width: 0; }

.item-produto-wrap { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--cinza-borda); }
.item-produto-wrap:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.item-produto-wrap .item-produto { margin-bottom: 0; }
.calc-pacotes-linha { margin-top: 4px; }
.btn-calc-pacotes { padding: 2px 0; font-size: 11.5px; font-weight: 500; background: transparent; color: var(--texto-suave); box-shadow: none; }
.btn-calc-pacotes:hover { background: transparent; color: var(--azul); box-shadow: none; }
.calc-pacotes { display: flex; gap: 6px; align-items: center; margin-top: 5px; max-width: 320px; }
.calc-pacotes input { flex: 1; min-width: 0; }
.btn-calc-total { padding: 2px 0; font-size: 11.5px; font-weight: 500; background: transparent; color: var(--texto-suave); box-shadow: none; }
.btn-calc-total:hover { background: transparent; color: var(--azul); box-shadow: none; }
.calc-total { display: flex; gap: 6px; align-items: center; margin-top: 5px; max-width: 320px; }
.calc-total input { flex: 1; min-width: 0; }

.item-rateio { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.item-rateio .campo { margin-bottom: 0; min-width: 0; }

.item-almoxarifado { display: grid; grid-template-columns: 1.6fr 0.8fr 0.8fr 0.9fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.item-almoxarifado .campo { margin-bottom: 0; min-width: 0; }

.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--azul-escuro); color: #fff;
  padding: 12px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 500; z-index: 320;
  box-shadow: var(--sombra-lg);
  animation: desvanecer 0.25s ease;
}

/* ---------- Notas ---------- */
.notas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.nota-card {
  border: 1px solid var(--cinza-borda);
  border-radius: var(--raio-sm);
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  box-shadow: var(--sombra-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: desvanecer 0.3s ease;
}
.nota-card:hover { box-shadow: var(--sombra-md); transform: translateY(-2px); }
.nota-card.fixada { box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35), var(--sombra-sm); }
.nota-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.nota-topo h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em; word-break: break-word; }
.nota-topo h3.nota-sem-titulo { color: var(--texto-suave); font-weight: 600; font-style: italic; }
.btn-fixar-nota {
  background: transparent; box-shadow: none; padding: 3px; flex-shrink: 0;
  color: var(--texto-suave); display: flex; align-items: center;
}
.btn-fixar-nota:hover { background: rgba(15, 23, 42, 0.06); color: var(--texto); }
.btn-fixar-nota.ativo { color: var(--azul); }
.nota-conteudo {
  flex: 1; margin: 0 0 12px; font-size: 13.5px; color: var(--texto);
  white-space: pre-wrap; word-break: break-word; line-height: 1.5;
}
.nota-rodape {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-top: 8px; border-top: 1px dashed rgba(15, 23, 42, 0.12);
}
.nota-data { font-size: 11px; color: var(--texto-suave); }
.nota-acoes { display: flex; gap: 4px; }
.nota-acoes button { padding: 4px 9px; font-size: 11.5px; }
.nota-acoes button.perigo { background: transparent; color: var(--vermelho); box-shadow: none; }
.nota-acoes button.perigo:hover { background: var(--vermelho-suave); }

.cores-nota { display: flex; gap: 8px; }
.swatch-cor {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; box-shadow: none; padding: 0;
}
.swatch-cor.ativo { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--azul-escuro) !important; }

/* ---------- Responsivo (celular/tablet) ----------
   Abaixo do breakpoint o app ganha cara de app de verdade: barra superior
   fixa com a marca, barra inferior com os atalhos do perfil (estilo
   Nubank/Instagram/apps nativos em geral) e a sidebar completa vira uma
   gaveta acionada pelo hamburguer ou pelo "Mais" da barra inferior.
   Acima do breakpoint nada disso aparece - fica exatamente como sempre foi. */
.mobile-appbar, .bottom-nav, .btn-menu-mobile { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  z-index: 215; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.sidebar-backdrop.aberta { opacity: 1; pointer-events: auto; }

@media (max-width: 860px) {
  .sidebar-backdrop { display: block; }
  #app { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 220;
    width: 280px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--sombra-lg);
    padding-top: calc(22px + env(safe-area-inset-top));
  }
  .sidebar.aberta { transform: translateX(0); }

  /* Barra superior: marca + hamburguer, sempre visivel, tipo app bar nativo */
  .mobile-appbar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 205;
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
    background: linear-gradient(185deg, #0f172a 0%, #111827 100%);
    box-shadow: var(--sombra-md);
  }
  .btn-menu-mobile {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08); color: #fff; border: none; border-radius: var(--raio-sm);
    cursor: pointer;
  }
  .mobile-appbar-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
  .mobile-appbar-titulo { color: #fff; font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Barra inferior: atalhos do perfil + "Mais", estilo app nativo */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 205;
    background: linear-gradient(0deg, #0f172a 0%, #111827 100%);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.18);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; background: none; border: none; color: #94a3b8;
    font-size: 10.5px; font-weight: 600; cursor: pointer; border-radius: var(--raio-sm);
    box-shadow: none; min-width: 0;
  }
  .bottom-nav-item .nav-icon { opacity: 0.85; }
  .bottom-nav-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .bottom-nav-item.ativo { color: #fff; }
  .bottom-nav-item.ativo .nav-icon { opacity: 1; color: #a5b4fc; }

  .main { padding: calc(54px + env(safe-area-inset-top) + 16px) 14px calc(72px + env(safe-area-inset-bottom)); max-width: 100%; }
  .toast { left: 14px; right: 14px; bottom: calc(72px + env(safe-area-inset-bottom) + 10px); text-align: center; }
  .linha { flex-direction: column; }
  .capa-dashboard { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px; }
  .page-header h1 { font-size: 21px; }
  /* Campo com fonte < 16px faz o iOS dar zoom sozinho ao tocar - trava isso
     sem mudar o tamanho visual dos botoes/chips. */
  input, select, textarea { font-size: 16px; }
}
.swatch-cor:hover { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
