/*====================
Blok 1 — Mobile App Shell: mengatur layout utama aplikasi di HP, termasuk sidebar, header, area konten, dan perilaku scroll.
======================*/

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-y: auto;
  }

  .app-body {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .app-container {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    padding: 0;
  }

  .app-layout {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    width: 100%;
    min-width: 0;
    min-height: 100dvh;
    height: auto;
  }

/*====================
Blok 1 — Mobile Header: menyelaraskan judul halaman dan profil pengguna pada layar HP.
======================*/

.app-header {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 16px;
  background: #ffffff;
  color: var(--text-main, #1e293b);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.header-left {
  display: none;
}

.header-title {
  display: block;
  min-width: 0;
  margin: 0;
  color: var(--text-main, #1e293b);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}

.header-right,
.header-right.header-profile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  flex-shrink: 1;
}

.header-profile .badge {
  flex-shrink: 0;
  color: var(--text-main, #1e293b);
  background: #f1f5f9;
  border-color: var(--border-color, #e2e8f0);
  font-size: 10px;
}

.header-profile .username {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-left: auto;
  color: var(--text-main, #1e293b);
  font-size: 12px;
  font-weight: 600;
}

#user-display-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-main, #1e293b);
  font-size: 12px;
}

.header-profile .user-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--border-color, #0e5ec7);
}

.attendance-notification-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
  color: #000;
}

.sidebar-toggle {
  display: none;
}


  .app-content {
  width: 100%;
  min-height: 100dvh;
  height: auto;
  margin-left: 0;
  padding: 8px 16px 96px;
  overflow: visible;
}
}

/*====================
Blok 2 — Mobile Bottom Navigation: mengatur navigasi bawah dengan lekukan melengkung dan tombol Absensi berbentuk lingkaran di tengah.
======================*/

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 200;
    height: 70px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--border-color, #bad2f0);
    border-radius: 22px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    isolation: isolate;
  }

   .mobile-nav-item {
    position: relative;
    min-width: 0;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #5898f0;
    text-decoration: none;
    font-family: "Poppins", sans-serif;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
  }

  .mobile-nav-item i,
  .mobile-nav-item svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke-width: 2;
    box-sizing: content-box;
    padding: 7px;
    border-radius: 10px;
    background: transparent;
    transition:
      background 0.2s ease,
      color 0.2s ease;
  }

  .mobile-nav-item.active:not(.mobile-nav-center) {
    color: var(--primary, #2563eb);
    background: transparent;
    font-weight: 700;
  }

  .mobile-nav-item.active:not(.mobile-nav-center) i,
  .mobile-nav-item.active:not(.mobile-nav-center) svg {
    background:  #e7edf8;
    stroke-width: 2.4;
  }
  
  /* Tombol Absensi di tengah */
  .mobile-nav-center {
    z-index: 99;
    justify-self: center;
    align-self: start;
    width: 58px;
    height: 58px;
    margin-top: -17px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border: 5px solid #f8fafc;
    border-radius: 50%;
    background: #502e87;
    color: #ececf4;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.28);
  }

  /* Lingkaran putih di belakang tombol */
  .mobile-nav-center::before {
    content: "";
    position: absolute;
    z-index: -99;
    inset: -9px;
    border-radius: 50%;
    background: none;
    border: 5px solid #f8fafc;
    pointer-events: none;
  }

  .mobile-nav-center i,
  .mobile-nav-center svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 23px;
    height: 23px;
    color: #ffffff;
    stroke: #ffffff;
    stroke-width: 2.2;
  }

  .mobile-nav-center.active {
    background: #1746a2;
    color: #ffffff;
  }

  .app-content {
    padding-bottom: 110px;
  }
}


/*====================
Blok 3 — Mobile More Menu: mengatur overlay dan menu navigasi tambahan di HP, termasuk header, tombol tutup, grid menu, dan interaksi tombol.
======================*/

.mobile-more-menu,
.mobile-more-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-more-overlay {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
    z-index: 250;
  }

  .mobile-more-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 88px;
    display: block;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.25s ease,
      opacity 0.25s ease,
      visibility 0.25s ease;
    z-index: 300;
  }

  .mobile-more-menu.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .mobile-more-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  .mobile-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .mobile-more-header strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #1e293b);
  }

  .mobile-more-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--bg-main, #f1f5f9);
    color: var(--text-muted, #64748b);
    cursor: pointer;
  }

  .mobile-more-close i {
    width: 18px;
    height: 18px;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .mobile-more-item {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 4px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 13px;
    background: #ffffff;
    color: #5898f0;    text-decoration: none;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    transition:
      color 0.2s ease,
      background-color 0.2s ease,
      border-color 0.2s ease;
  }

  .mobile-more-item i {
    width: 20px;
    height: 20px;
    color: var(--primary, #2563eb);
  }

  .mobile-more-item:active {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary, #2563eb);
  }

  .mobile-nav-item {
    border: none;
    font-family: inherit;
    cursor: pointer;
  }
}

