/**
 * OTOGO 9 AM — Structural Layout & Navigation Stylesheet
 * Responsive CSS Architecture — Device & Responsibility Separation
 * 
 * Defines shared structural wrappers, header navigation, bottom app navigation,
 * and footer layouts across the platform.
 */

/* ==========================================================================
   1. Page Containers & Wrappers
   ========================================================================== */
.page-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.page-home {
  max-width: 100%;
  padding: 0;
}

.dash-mobile-wrapper {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* ==========================================================================
   2. Grid & Flex Layout Utilities
   ========================================================================== */
.grid {
  display: grid;
  gap: var(--space-4, 16px);
}

.flex-row {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   3. Site Header & Topbar Navigation
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dark, rgba(255, 255, 255, 0.08));
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
}

.topbar .logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}

.topbar .logo img {
  width: 156px;
  max-width: 156px;
  height: auto;
  aspect-ratio: 1536 / 517;
  object-fit: contain;
  display: block;
}

.topbar .menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  cursor: pointer;
  flex: 0 0 44px;
}

.topbar .menu-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  margin: 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar-app-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  order: 2;
}

.btn-bell-notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transition: background 0.18s ease;
}

.btn-bell-notification:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-bell-notification .badge-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson, #ef4444);
  box-shadow: 0 0 0 2px var(--dark-bg, #07090e);
}

.user-avatar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-blue, #0878ef);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

/* ==========================================================================
   4. Fixed App Bottom Navigation Bar
   ========================================================================== */
.dash-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--dash-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(11, 20, 32, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 999;
}

.dash-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 44px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.dash-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.18s ease;
}

.dash-nav-item:hover,
.dash-nav-item.active {
  color: var(--brand-blue, #0878ef);
}

.dash-nav-item.active svg {
  transform: translateY(-1px);
}
