/* ==========================================================================
   LAYOUT, APP SHELL & VIEW MANAGEMENT
   Agenda Semanal
   ========================================================================== */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

/* Header */
.app-header {
  flex-shrink: 0;
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  z-index: var(--z-sticky-header);
}

.app-header.transparent {
  border-bottom-color: transparent;
}

/* Main Views Container */
#main-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* View Screens */
.view-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast) ease-out, transform var(--transition-fast) ease-out;
  transform: translateY(4px);
  overflow: hidden;
  background-color: var(--bg-app);
}

.view-screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  z-index: var(--z-base);
}

/* Scrollable View Content */
.view-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 24px) 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.view-content.no-padding {
  padding: 0 0 calc(var(--nav-height) + var(--safe-bottom)) 0;
}

/* Section Containers */
.section-block {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
