.app-layout {
  display: flex;
  height: 100vh;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: hidden;
  background: var(--bg-main) !important;
  position: relative;
}

.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main) !important;
  position: relative;
  min-width: 0;
  width: 100%;
}

.top-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: #FFFFFF !important;
  border-bottom: 1px solid var(--glass-border);
  z-index: 50;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

/* --- Responsive Breakpoints --- */

/* Tablet & Smaller */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .top-header {
    padding: 0 1rem;
  }
  
  .page-content {
    padding: 1rem;
  }
}

/* Mobile Specific */
@media (max-width: 480px) {
  .top-header {
    display: none !important; /* iOS Header will handle it on small mobile */
  }
  
  .page-content {
    padding: 0.75rem;
    padding-bottom: 2rem;
  }
  
  /* Force containers to fill width */
  .card, .glass-card, .kpi-grid {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Grid adjustments */
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* Ensure images and videos are responsive */
img, video {
  max-width: 100%;
  height: auto;
}

/* Override iOS Styles from styles.css for total consistency */
.ios-navbar, .ios-search-row, .ios-large-title-row {
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  width: 100% !important;
  box-sizing: border-box;
}

.ios-header {
  background: #FFFFFF !important;
  width: 100% !important;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Ensure content doesn't get hidden under sticky headers on mobile */
@media (max-width: 480px) {
  .page-content {
    padding-top: 10px !important;
  }
}

