/* Mobile-first overrides for PWA / small screens */

@media (max-width: 768px) {
  /* Hide sidebar on mobile */
  .sidebar, #sidebar {
    display: none !important;
  }

  /* Full-width main content */
  .main-content, #main-content, main {
    margin-left: 0 !important;
    padding-bottom: 5rem !important;
  }

  /* Bottom navigation bar */
  .mobile-bottom-nav {
    display: flex !important;
  }

  /* Larger tap targets */
  button, .btn, a.btn, input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Full-width cards */
  .card, .bg-white.rounded-lg {
    border-radius: 0.5rem;
  }

  /* Stack table cells on mobile */
  .mobile-stack thead {
    display: none;
  }
  .mobile-stack tr {
    display: block;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
  }
  .mobile-stack td {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border: none;
  }
  .mobile-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
  }
}

/* Bottom nav — hidden on desktop */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: white;
  border-top: 1px solid #e5e7eb;
  z-index: 100;
  align-items: stretch;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: color 0.15s;
  padding: 0.25rem;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: #6366f1;
}

.mobile-bottom-nav a svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* PWA standalone mode: safe area insets */
@media (display-mode: standalone) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(4rem + env(safe-area-inset-bottom));
  }
}

/* Install prompt banner */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 4.5rem;
  left: 1rem;
  right: 1rem;
  background: #6366f1;
  color: white;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  z-index: 99;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  font-size: 0.875rem;
}

.pwa-install-banner.visible {
  display: flex;
}

.pwa-install-banner button {
  background: white;
  color: #6366f1;
  border: none;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: unset;
}

.pwa-install-banner .dismiss {
  background: transparent;
  color: rgba(255,255,255,0.7);
  padding: 0.25rem;
  min-height: unset;
  min-width: unset;
}

/* Staging banner */
.staging-banner {
  display: none;
  background: #f59e0b;
  color: white;
  text-align: center;
  padding: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 200;
}
