/* Compatibilidade celular e tablet — somente HML e PRD do Controle de Acesso. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.app-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.16));
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.app-menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: #111;
  border-radius: 2px;
}

@media (max-width: 900px) {
  html.is-compact .app-menu-btn {
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }

  html.is-compact .dashboard-sidebar {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 0.35rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: calc(0.65rem + env(safe-area-inset-top)) 0.85rem 0.65rem;
    background: var(--surface, #fff);
  }

  html.is-compact .dashboard-brand {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
  }

  html.is-compact .dashboard-brand .brand-logo img,
  html.is-compact .brand-logo img {
    max-width: 150px;
  }

  html.is-compact .dashboard-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  html.is-compact .dashboard.nav-open .dashboard-nav {
    display: block;
  }

  html.is-compact .dashboard-nav ul {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }

  html.is-compact .dashboard-nav__item {
    min-height: 44px;
    width: 100%;
  }

  .dashboard-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem !important;
  }

  .dashboard-content {
    padding: 1rem !important;
  }

  .login-page {
    padding: 1.25rem 1rem;
    align-items: flex-start;
    padding-top: max(1.25rem, env(safe-area-inset-top));
  }

  .login-card {
    padding: 1.35rem 1.05rem;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .usuarios-tabs,
  .relatorios-tabs {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .nova-empresa-modal,
  .editar-usuario-modal,
  .estacionamento-modal {
    padding: 0.75rem;
  }

  .nova-empresa-modal__content,
  .editar-usuario-modal__content,
  .estacionamento-modal__content {
    padding: 1.1rem 1rem 1.25rem;
  }

  .dashboard-cards {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .dashboard {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .dashboard-nav__item {
    min-height: 44px;
  }

  .dashboard-header,
  .dashboard-content {
    padding-inline: 1.15rem;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pwa-install {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left));
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  font-family: Montserrat, system-ui, sans-serif;
}

.pwa-install[hidden] {
  display: none !important;
}

.pwa-install__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.pwa-install__text strong {
  font-size: 0.95rem;
}

.pwa-install__hint {
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

.pwa-install__action,
.pwa-install__dismiss {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pwa-install__action {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-weight: 700;
}

.pwa-install__dismiss {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

@media (min-width: 1181px) {
  .pwa-install {
    left: auto;
    width: min(420px, calc(100vw - 2rem));
  }
}
