/* Shared Layout - Modern Sidebar + Top Bar */
* { box-sizing: border-box; }

body { 
  margin: 0; 
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
  font-size: 16px; 
  background: #F8F9FA; 
  color: #111; 
  -webkit-font-smoothing: antialiased;
}

/* --- Sidebar Base --- */
.sidebar { 
  position: fixed; 
  top: 0; 
  left: 0; 
  bottom: 0; 
  width: 260px; 
  background: #fff; 
  border-right: 1px solid #e1e5eb; 
  overflow-y: auto; 
  z-index: 30; 
  transition: transform .3s ease; 
}

.sb-brand { 
  font-family: 'Inter', sans-serif;
  font-size: 22px; 
  font-weight: 800; 
  padding: 24px 20px; 
  border-bottom: 1px solid #e1e5eb; 
  color: #111;
  letter-spacing: -0.02em;
}

.sb-nav { padding: 16px 12px; }

/* --- Sidebar Buttons --- */
.sb-item { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 14px 16px; 
  margin-bottom: 6px; 
  border-radius: 12px; 
  color: #111; 
  text-decoration: none; 
  font-family: 'Roboto', sans-serif; 
  font-size: 16px; 
  font-weight: 500; 
  letter-spacing: 0.3px; 
  transition: all 0.2s;
  border: 1px solid transparent;
}

.sb-item:hover { 
  background: #f0f2f5; 
  color: #111;
}

.sb-item.active { 
  background: #f0f2f5; 
  font-weight: 700; 
  color: #2563eb; 
  border-color: #e1e5eb;
}

/* --- Dropdown (Installment) --- */
.sb-parent { 
  cursor: pointer; 
  font-weight: 500;
}

.sb-parent.has-active { 
  background: #f0f2f5; 
  font-weight: 700; 
  color: #111;
}

.sb-arrow { 
  margin-left: auto; 
  font-size: 14px; 
  color: #666; 
  transition: transform .3s ease; 
}

.sb-group.open .sb-arrow { 
  transform: rotate(180deg); 
}

/* --- Sub Menu (Level 1) --- */
.sb-sub { 
  display: none; 
  margin: 4px 0 8px 16px; /* Indent for Level 1 */
  padding-left: 12px; 
  border-left: 2px solid #e1e5eb; 
}

.sb-group.open .sb-sub { 
  display: block; 
}

.sb-sub .sb-item { 
  font-size: 15px; 
  padding: 12px 14px; 
  font-weight: 500; 
  color: #333;
  margin-bottom: 2px;
}

.sb-sub .sb-item.active {
  color: #2563eb;
  background: #f0f7ff;
  font-weight: 700;
}

/* --- Sub Sub Menu (Level 2) --- */
/* Yeh naya code hai jo level 2 ko indent karega */
.sb-sub-sub {
  display: none;
  margin: 4px 0 8px 20px; /* Indent for Level 2 (Ziada andar) */
  padding-left: 12px;
  border-left: 2px solid #e1e5eb;
}
.sb-group-sub.open .sb-sub-sub {
  display: block;
}

/* --- Main Layout --- */
.app-main { 
  margin-left: 260px; 
  min-height: 100vh; 
}

/* --- Top Bar --- */
.topbar { 
  position: sticky; 
  top: 0; 
  z-index: 20; 
  height: 70px; 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  padding: 0 24px; 
  background: #fff; 
  border-bottom: 1px solid #e1e5eb; 
}

.menu-btn { 
  display: none; 
  font-size: 22px; 
  background: #fff; 
  border: 1px solid #e1e5eb; 
  border-radius: 10px; 
  padding: 8px 14px; 
  cursor: pointer; 
  color: #111;
}

.search-box { 
  flex: 1; 
  max-width: 400px; 
  font-size: 15px; 
  font-family: 'Roboto', sans-serif; 
  padding: 12px 16px; 
  border: 1px solid #e1e5eb; 
  border-radius: 12px; 
  background: #F8F9FA; 
  outline: none;
  transition: border 0.2s;
}

.search-box:focus {
  border-color: #2563eb;
  background: #fff;
}

.top-right { 
  margin-left: auto; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.icon-btn { 
  font-size: 14px; 
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: #fff; 
  border: 1px solid #e1e5eb; 
  border-radius: 10px; 
  padding: 10px 16px; 
  cursor: pointer; 
  color: #333;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: #f0f7ff;
  border-color: #2563eb;
  color: #2563eb;
}

.user-chip { 
  font-size: 14px; 
  font-weight: 600; 
  font-family: 'Inter', sans-serif;
  padding: 10px 14px; 
  background: #f0f2f5; 
  border-radius: 10px; 
  white-space: nowrap; 
  color: #111;
}

.lay-btn { 
  font-size: 14px; 
  font-family: 'Inter', sans-serif; 
  font-weight: 600;
  background: #111; 
  color: #fff; 
  border: 0; 
  border-radius: 10px; 
  padding: 10px 18px; 
  cursor: pointer; 
  transition: background 0.2s;
}

.lay-btn:hover {
  background: #333;
}

.app-content { 
  padding: 0; 
}

/* --- Overlay & Toast --- */
.sb-overlay { 
  display: none; 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,.5); 
  z-index: 25; 
}

.lay-toast { 
  position: fixed; 
  bottom: 24px; 
  left: 50%; 
  transform: translateX(-50%); 
  background: #111; 
  color: #fff; 
  padding: 14px 20px; 
  border-radius: 12px; 
  font-size: 15px; 
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  z-index: 50; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .sidebar { 
    transform: translateX(-100%); 
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
  }
  .sidebar.open { 
    transform: translateX(0); 
  }
  .sb-overlay.show { 
    display: block; 
  }
  .app-main { 
    margin-left: 0; 
  }
  .menu-btn { 
    display: block; 
  }
  .search-box { 
    min-width: 0; 
  }
  .user-chip .uname { 
    display: none; 
  }
}