.app-body [hidden],
.app-body [hidden=""],
.app-body .app-footer-nav[hidden],
.app-body .app-drawer-backdrop[hidden] {
  display: none !important;
}

.app-body [hidden],
.app-body [hidden=""],
.app-body .app-bottom-nav[hidden],
.app-body .app-drawer-backdrop[hidden] {
  display: none !important;
}

.app-body {
  background: #f6f7fb;
  min-height: 100vh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); /* espaço para footer nav */
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-brand-logo { height: 28px; width: auto; display: block; }
.app-brand-title { font-family: var(--font); font-weight: 800; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #eee;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  cursor: pointer;
}
.app-menu-btn span { height: 2px; width: 100%; background: #222; border-radius: 2px; display: block; }

.app-logout-btn {
  border: 1px solid #eee;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-main { padding: 16px; max-width: 980px; margin: 0 auto; }

.app-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.app-h1 { margin: 0 0 10px; font-size: 1.35rem; color: var(--dark); }
.app-muted { margin: 0 0 14px; color: var(--gray); }
.app-small { margin: 12px 0 0; font-size: 0.92rem; color: var(--gray); }
.app-small a { color: var(--red); font-weight: 700; }

.app-form { max-width: 520px; }
.app-label { display: block; font-weight: 700; margin: 10px 0 6px; }
.app-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
}
.app-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12); }

.app-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 760px) {
  .app-grid2 { grid-template-columns: 1fr; }
}

.app-panel {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 14px;
}
.app-panel-title { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #666; }
.app-panel-body { margin-top: 8px; font-weight: 700; }

.app-list { display: grid; gap: 10px; margin: 12px 0 14px; }
.app-item {
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.app-item-title { font-weight: 800; margin: 0 0 6px; }
.app-item-sub { margin: 0; color: var(--gray); }
.app-item-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #eee;
  text-decoration: none;
  font-weight: 800;
  color: var(--dark);
  background: #fff;
}
.app-link.primary { background: var(--red); color: #fff; border-color: var(--red); }

.app-kv { display: grid; gap: 10px; }
.app-kv-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f1f1; }
.app-kv-key { color: #666; font-weight: 800; }
.app-kv-val { font-weight: 700; word-break: break-word; }
@media (max-width: 520px) {
  .app-kv-row { grid-template-columns: 1fr; }
}

.app-footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 220;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 70px;
  width: 100%;
}

.app-footer-item {
  flex: 1;
  text-align: center;
  color: #999;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
  background: transparent;
  border: 0;
  padding: 8px 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-footer-item:focus {
  outline: none;
}

.app-footer-item:focus-visible {
  outline: 2px solid rgba(196, 30, 58, 0.35);
  outline-offset: 2px;
  border-radius: 14px;
}

.app-footer-item .icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.app-footer-item.active {
  color: var(--red);
  font-weight: 600;
  background: rgba(196, 30, 58, 0.06);
  border-radius: 14px;
}

.app-footer-item span {
  line-height: 1.1;
}

.app-footer-item:active {
  transform: scale(0.95);
}

.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
}
.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  width: min(320px, 88vw);
  background: #fff;
  z-index: 310;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
}
.app-drawer.open { transform: translateX(0); }
.app-drawer-header { padding: 16px; border-bottom: 1px solid #eee; }
.app-user { display: flex; gap: 12px; align-items: center; }
.app-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.app-user-name { font-weight: 900; }
.app-user-sub { color: #666; font-weight: 700; font-size: 0.9rem; }
.app-drawer-nav { padding: 10px; display: grid; gap: 8px; }
.app-nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 12px;
  padding: 12px 12px;
  font-weight: 900;
  cursor: pointer;
}
.app-nav-item.is-active { border-color: var(--red); color: var(--red); background: rgba(196,30,58,0.06); }

