/* ==========================
   Raj-style App Shell + Left Navigation Drawer
   (ported from Raj Ceramics to Water Tank)
   ========================== */

/* Header tightening + mobile header (Raj-style) */
.logo-bar #username {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: #fff;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.logo-bar .dropdown {
  position: relative;
  z-index: 1050;
}

.logo-bar .dropdown-menu {
  z-index: 1051 !important;
  position: absolute !important;
  margin-top: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  min-width: 160px !important;
  background: #fff !important;
}

.logo-bar-mobile {
  /* 2026-08-07 mobile-header redesign (owner spec): fixed dark professional
     blue for the phone bar only — deliberately NOT --main-accent, which paints
     buttons/nav across the whole app and must not be repainted as a side
     effect. ~25% shorter via reduced padding + 36px controls; the content
     push-down below shrinks to match. Desktop .app-topbar untouched. */
  background-color: #143A73;
  color: #fff;
  padding: 0.3rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1050;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-bar-mobile .mobile-username {
  max-width: 96px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  opacity: .92;
}

/* push all mobile content below the fixed header (matches the compacted bar) */
@media (max-width: 767.98px) {
  body.page-employee .app-main {
    padding-top: 46px !important;
  }
}

.logo-bar-mobile .btn-light {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-weight: 500;
}

.logo-bar-mobile .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.logo-bar-mobile .dropdown-menu {
  margin-top: 0.5rem;
}

.logo-bar-mobile #mobile-panel-title {
  color: #fff;
  font-weight: 500;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  align-items: stretch;
  flex-direction: row;
  justify-content: flex-start;
}

.nav-drawer {
  width: 280px;
  flex: 0 0 280px;
  background-color: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 100;
  margin: 0;
  padding: 0;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  transition: margin-left 0.25s ease;
  margin-left: 0;
  min-width: 0;
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

@media (min-width: 992px) {
  .nav-drawer {
    width: 280px;
    flex: 0 0 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    transform: none;
    display: none; /* open via hamburger */
  }

  body.drawer-open .nav-drawer {
    display: block;
    transform: none;
  }

  .drawer-backdrop {
    display: none !important;
    pointer-events: none !important;
  }

  .app-topbar,
  .topbar,
  .logo-bar {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
}

@media (max-width: 991px) {
  .nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 70vw;
    max-width: 320px;
    z-index: 1045;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .nav-drawer.open {
    transform: translateX(0);
    z-index: 1055;
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  background-color: var(--main-accent);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-header h5 {
  color: #fff;
  margin: 0;
}


.drawer-body {
  padding: 1rem;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}

@media (max-width: 991px) {
  .drawer-backdrop.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

.drawer-toggle-desktop,
.drawer-toggle-mobile {
  transition: background-color 0.2s;
}

.drawer-toggle-desktop:hover,
.drawer-toggle-mobile:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.role-panel-nav {
  overflow: visible;
}

.role-nav-item {
  margin-bottom: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.role-nav-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
  font-weight: 600;
  color: #333;
}

.role-nav-header:hover {
  background-color: #e9ecef;
}

.role-nav-header.expanded {
  background-color: var(--main-accent);
  color: #fff;
}

.role-toggle-icon {
  font-size: 1.2rem;
  font-weight: bold;
  width: 20px;
  text-align: center;
  line-height: 1;
}

.role-name {
  flex: 1;
}

.role-panels {
  display: none;
  padding: 0.5rem;
  background-color: #fff;
}

.role-panels.show {
  display: block;
}

.panel-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
  cursor: pointer;
}

.panel-nav-item:hover {
  background-color: #f0f7ff;
  border-left: 4px solid var(--main-accent);
  padding-left: calc(1rem - 4px);
}

.panel-nav-item.active {
  background-color: #e3f2fd;
  border-left: 4px solid var(--main-accent);
  padding-left: calc(1rem - 4px);
  font-weight: 600;
  color: var(--main-accent);
}

.panel-nav-item.hidden,
.role-nav-item.hidden {
  display: none;
}


