/* Mobile-First UI Styles & Precision Device Alignments */

.mobile-menu-btn,
.mobile-sidebar-close-btn {
  display: none;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 45;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  padding: 0.35rem 0;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 20%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-badge.red {
  background: var(--color-missed);
  color: white;
}

.bottom-nav-badge.orange {
  background: var(--color-leave);
  color: white;
}

/* Horizontal Sub-Navigation Tab Bar */
.subnav-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.subnav-tabs::-webkit-scrollbar {
  display: none;
}

/* Mobile Screen Breakpoints */
@media (max-width: 768px) {
  .mobile-backdrop {
    z-index: 998;
  }
  
  .mobile-backdrop.mobile-open {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 285px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    background: var(--bg-card);
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
  }
  
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }

  .mobile-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all var(--transition-fast);
  }

  .mobile-sidebar-close-btn:active {
    color: var(--text-main);
    background: var(--bg-body);
  }

  .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 0.75rem;
  }

  .sidebar-footer {
    flex-shrink: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
  }

  .sidebar-signout-btn {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-missed);
    background: var(--color-missed-bg);
    border: 1px solid var(--color-missed-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .sidebar-signout-btn:active {
    background: var(--color-missed);
    color: #ffffff;
  }
  
  .app-main {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-nav-height) + 1.25rem);
    width: 100%;
  }
  
  .bottom-nav {
    display: block;
  }
  
  .app-header {
    padding: 0 0.85rem;
    height: 58px;
  }
  
  .header-left {
    min-width: 0;
    flex: 1;
    gap: 0.6rem;
  }

  .header-logo {
    width: 32px;
    height: 32px;
  }
  
  .header-title-wrap {
    min-width: 0;
  }
  
  .header-title {
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-subtitle {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-clock {
    display: none;
  }
  
  .desktop-alerts-wrap {
    display: none !important;
  }
  
  .mobile-bell-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 6px 4px 0;
    font-size: 1.35rem;
    color: var(--text-main);
    background: transparent;
    border: none;
    cursor: pointer;
  }


  
  .user-info-text {
    display: none;
  }
  
  .user-profile-btn {
    padding: 2px;
    border-radius: var(--radius-full);
  }
  
  .app-content {
    padding: 0.85rem;
  }
  
  /* 2-Column Responsive Stats Grid for Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }
  
  .stat-card {
    padding: 0.85rem;
    gap: 0.65rem;
    border-radius: var(--radius-md);
  }
  
  .stat-icon-wrap {
    width: 38px;
    height: 38px;
  }
  
  .stat-icon-wrap i {
    font-size: 1.25rem !important;
  }
  
  .stat-label {
    font-size: 0.7rem;
    line-height: 1.2;
  }
  
  .stat-value {
    font-size: 1.35rem;
    margin-top: 0.1rem;
  }
  
  .alerts-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .card-header {
    padding: 0.85rem 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Mobile Modals as Bottom Sheets */
  .modal-container {
    max-width: 100%;
    margin-top: auto;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transform: translateY(100%);
  }
  
  .modal-backdrop.open .modal-container {
    transform: translateY(0);
  }
  
  .modal-body {
    max-height: 75vh;
    padding: 1rem;
  }
  
  .toast-container,
  .toast {
    display: none !important;
    visibility: hidden !important;
  }
}

@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
